Skip to content

Commit 65a84a1

Browse files
davidkoppclaude
andcommitted
Restructure documentation for better organization and maintainability
Major documentation overhaul to improve discoverability and reduce duplication: **New Documentation Structure:** - docs/guides/ - User-focused guides (quick-start, troubleshooting) - docs/usage/ - Detailed usage documentation (CLI, API, output format) - docs/technical/ - Technical docs with nested architecture and ADRs **Key Changes:** - Simplified README.md from 169 to 75 lines (60% reduction) - Simplified SPECIFICATION.md from ~200 to ~120 lines (40% reduction) - Created comprehensive usage guides with extracted content - Reorganized ADRs under architecture/ for logical grouping - Updated all cross-references and file paths - Improved Flask example with realistic build system integration **Benefits:** - Progressive disclosure: Basic → Detailed documentation flow - Eliminated content duplication between files - Clear separation of user guides vs technical implementation - Better organized technical documentation hierarchy - Maintainable structure for future additions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a748da3 commit 65a84a1

28 files changed

+1223
-260
lines changed

CLAUDE.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,15 @@ python3 -c "from dependency_resolver.detectors.dpkg_detector import DpkgDetector
7070
- `dependency_resolver/executors/` - Environment execution adapters
7171
- `dependency_resolver/core/` - Base interfaces and orchestrator
7272
- `tests/` - Test suites organized by component (detectors, executors, integration, specialized)
73-
- `docs/adr/` - Architecture decision records
74-
- `docs/detectors/` - Individual detector documentation
73+
- `docs/guides/` - User guides (quick start, troubleshooting)
74+
- `docs/usage/` - Detailed usage documentation (CLI, API, output format)
75+
- `docs/technical/` - Technical documentation including:
76+
- `docs/technical/architecture/adr/` - Architecture decision records
77+
- `docs/technical/detectors/` - Individual detector documentation
78+
- `docs/technical/architecture/` - System architecture documentation
79+
- `docs/technical/adding-new-detectors.md` - Guide for implementing new package manager detectors
7580

7681
## Project Files
7782

83+
- [README.md](./README.md) - Overview with links to detailed docs
7884
- [SPECIFICATION.md](./SPECIFICATION.md) - Requirements and constraints
79-
- [README.md](./README.md) - Update after adding features

CONTRIBUTING.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Please refer to the [CLAUDE.md](./CLAUDE.md) file for detailed development guide
131131

132132
## Adding New Package Manager Detectors
133133

134-
To add support for a new package manager, follow the comprehensive guide in [docs/ADDING_NEW_DETECTORS.md](./docs/ADDING_NEW_DETECTORS.md). This guide covers:
134+
To add support for a new package manager, follow the comprehensive guide in [docs/technical/adding-new-detectors.md](./docs/technical/adding-new-detectors.md). This guide covers:
135135

136136
- Implementation patterns and interface requirements
137137
- Testing strategies with Docker environments
@@ -143,7 +143,8 @@ To add support for a new package manager, follow the comprehensive guide in [doc
143143
If you have questions or need help:
144144

145145
- Check the [SPECIFICATION.md](./SPECIFICATION.md) for project requirements and design approaches
146-
- Review [docs/ADDING_NEW_DETECTORS.md](./docs/ADDING_NEW_DETECTORS.md) for detector implementation guidance
146+
- Review [docs/technical/adding-new-detectors.md](./docs/technical/adding-new-detectors.md) for detector implementation guidance
147+
- Check [docs/technical/](./docs/technical/) for architecture documentation and ADRs
147148
- Review existing code for patterns and conventions
148149
- Open an issue for discussion if you're unsure about an approach
149150

README.md

Lines changed: 36 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -1,168 +1,75 @@
11
# dependency-resolver
22

33
A tool for creating snapshots of installed packages on specified target environments. The project provides both a command-line interface and a Python library for programmatic use.
4-
Its main focus is dependency resolving of Docker containers, but it also supports dependency resolving on the host system.
5-
The output is a structured JSON that includes information about all the installed packages from supported sources with their version and unique hash values.
4+
5+
Its main focus is dependency resolving of Docker containers, but it also supports dependency resolving on the host system. The output is a structured JSON that includes information about all the installed packages from supported sources with their version and unique hash values.
66

77
## Installation
88

99
```bash
10-
# Clone and install
1110
git clone https://github.com/green-coding-solutions/dependency-resolver
1211
cd dependency-resolver
1312
pip install .
1413
```
1514

16-
## Usage
17-
18-
The dependency-resolver can be used in two ways:
19-
20-
1. **Command Line Interface (CLI)** - For direct terminal usage
21-
2. **Programmatic Interface** - As a Python library in other projects
22-
23-
### Command Line Interface
15+
## Quick Start
2416

2517
```bash
26-
# Analyze host system (default behavior)
18+
# Analyze host system
2719
python3 -m dependency_resolver
2820

29-
# Explicitly specify host environment
30-
python3 -m dependency_resolver host
31-
32-
# Analyze Docker container by name
21+
# Analyze Docker container
3322
python3 -m dependency_resolver docker nginx
3423

35-
# Analyze Docker container by ID
36-
python3 -m dependency_resolver docker a1b2c3d4e5f6
37-
38-
# Get only container metadata (skip dependency detection)
39-
python3 -m dependency_resolver docker nginx --only-container-info
40-
41-
# Enable debug output
42-
python3 -m dependency_resolver --debug
43-
44-
# Set working directory
45-
python3 -m dependency_resolver --working-dir /path/to/project
46-
47-
# Skip system scope package managers
48-
python3 -m dependency_resolver --skip-system-scope
49-
50-
# Pretty print JSON output
24+
# Pretty print output
5125
python3 -m dependency_resolver --pretty-print
52-
```
53-
54-
### Programmatic Interface
55-
56-
The dependency-resolver can also be used as a Python library in other projects. Here are some examples:
5726

58-
```python
59-
import dependency_resolver
60-
61-
# Simple host system analysis
62-
deps_json = dependency_resolver.resolve_host_dependencies()
63-
64-
# Get results as Python dictionary for further processing
65-
deps_dict = dependency_resolver.resolve_dependencies_as_dict(
66-
environment_type="host",
67-
skip_system_scope=True
68-
)
69-
70-
# Docker container analysis
71-
docker_deps = dependency_resolver.resolve_docker_dependencies(
72-
container_identifier="nginx",
73-
working_dir="/app"
74-
)
75-
76-
# Advanced usage with direct access to core classes
77-
from dependency_resolver import Orchestrator, HostExecutor, OutputFormatter
78-
79-
executor = HostExecutor()
80-
orchestrator = Orchestrator(debug=True, skip_system_scope=True)
81-
dependencies = orchestrator.resolve_dependencies(executor)
82-
formatter = OutputFormatter()
83-
json_output = formatter.format_json(dependencies, pretty_print=True)
27+
# Get help with all options
28+
python3 -m dependency_resolver -h
8429
```
8530

86-
**Available convenience functions:**
31+
## Supported Package Managers
32+
33+
- **apt/dpkg** - System packages Ubuntu/Debian
34+
- **apk** - System packages of Alpine
35+
- **pip** - Python packages
36+
- **npm** - Node.js packages
8737

88-
- `resolve_host_dependencies()` - Analyze host system, returns JSON string
89-
- `resolve_docker_dependencies()` - Analyze Docker container, returns JSON string
90-
- `resolve_docker_dependencies_as_dict()` - Analyze Docker container, returns Python dictionary
91-
- `resolve_dependencies_as_dict()` - Generic analysis, returns Python dictionary
38+
Also captures **Docker container metadata** when analyzing containers.
9239

93-
**Available classes for advanced usage:**
40+
## Usage Options
9441

95-
- `Orchestrator` - Main dependency resolution coordinator
96-
- `HostExecutor`, `DockerExecutor` - Environment adapters
97-
- `OutputFormatter` - JSON formatting utilities
42+
### Command Line Interface
9843

99-
### Supported Environments
44+
For terminal usage with full control over options and environments.
10045

101-
- **host** - Host system analysis (default)
102-
- **docker** - Docker container analysis (requires container ID or name)
46+
### Programmatic Interface
10347

104-
### Supported Detectors
48+
Use as a Python library in other projects:
10549

106-
**Package Managers:**
50+
```python
51+
import dependency_resolver
10752

108-
- **apt/dpkg** - System packages Ubuntu/Debian
109-
- **apk** - System packages of Alpine
110-
- **pip** - Python packages
111-
- **npm** - Node.js packages
53+
# Analyze host system
54+
deps = dependency_resolver.resolve_host_dependencies()
11255

113-
**Container Information:**
114-
115-
- **docker-info** - Docker container metadata and base image details
116-
117-
### Output Format
118-
119-
The tool outputs JSON with the following structure:
120-
121-
```json
122-
{
123-
"_container-info": {
124-
"name": "nginx-container",
125-
"image": "nginx:latest",
126-
"hash": "sha256:2cd1d97f893f..."
127-
},
128-
"dpkg": {
129-
"scope": "system",
130-
"dependencies": {
131-
"package-name": {
132-
"version": "1.2.3 amd64",
133-
"hash": "abc123..."
134-
}
135-
}
136-
},
137-
"pip": {
138-
"scope": "project",
139-
"location": "/path/to/venv/lib/python3.12/site-packages",
140-
"hash": "def456...",
141-
"dependencies": {
142-
"package-name": {
143-
"version": "1.2.3"
144-
}
145-
}
146-
}
147-
}
56+
# Analyze Docker container
57+
docker_deps = dependency_resolver.resolve_docker_dependencies("nginx")
14858
```
14959

15060
## Documentation
15161

152-
### Architecture & Detector Documentation
153-
154-
For detailed information about architectural decisions and package manager implementations:
155-
156-
- **Architecture Decision Records**: See [docs/adr/](./docs/adr/) for architectural decisions
157-
- **Detector Documentation**: See [docs/detectors/](./docs/detectors/) for detailed implementation information:
158-
- [APK Detector](./docs/detectors/apk_detector.md) - Alpine Linux package detection
159-
- [DPKG Detector](./docs/detectors/dpkg_detector.md) - Debian/Ubuntu package detection
160-
- [NPM Detector](./docs/detectors/npm_detector.md) - Node.js package detection
161-
- [PIP Detector](./docs/detectors/pip_detector.md) - Python package detection
162-
- [Docker Info Detector](./docs/detectors/docker_info_detector.md) - Individual container metadata
163-
164-
See the complete [SPECIFICATION.md](./SPECIFICATION.md) for detailed requirements and implementation constraints.
62+
- **[Quick Start Guide](./docs/guides/quick-start.md)** - Get up and running
63+
- **[CLI Usage Guide](./docs/usage/cli-guide.md)** - Complete command line reference
64+
- **[Python API Guide](./docs/usage/programmatic-api.md)** - Programmatic usage
65+
- **[Output Format Guide](./docs/usage/output-format.md)** - Understanding the JSON results
66+
- **[Troubleshooting](./docs/guides/troubleshooting.md)** - Common issues and solutions
67+
- **[Technical Documentation](./docs/technical/)** - Architecture and implementation details
16568

16669
## Contributing
16770

16871
For development setup, contribution guidelines, and information about running tests and code quality checks, please see [CONTRIBUTING.md](./CONTRIBUTING.md).
72+
73+
## Requirements and Design
74+
75+
See the complete [SPECIFICATION.md](./SPECIFICATION.md) for detailed requirements and implementation constraints.

0 commit comments

Comments
 (0)