docsmith-ai 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- docsmith_ai-0.2.1/.github/workflows/ci.yml +65 -0
- docsmith_ai-0.2.1/.gitignore +45 -0
- docsmith_ai-0.2.1/AGENTS.md +119 -0
- docsmith_ai-0.2.1/CHANGELOG.md +114 -0
- docsmith_ai-0.2.1/CONTRIBUTING.md +116 -0
- docsmith_ai-0.2.1/LICENSE +21 -0
- docsmith_ai-0.2.1/PKG-INFO +399 -0
- docsmith_ai-0.2.1/README.md +345 -0
- docsmith_ai-0.2.1/SECURITY.md +59 -0
- docsmith_ai-0.2.1/assets/banner.svg +69 -0
- docsmith_ai-0.2.1/assets/pipeline.svg +74 -0
- docsmith_ai-0.2.1/docsmith/__init__.py +4 -0
- docsmith_ai-0.2.1/docsmith/__main__.py +6 -0
- docsmith_ai-0.2.1/docsmith/ai/__init__.py +1 -0
- docsmith_ai-0.2.1/docsmith/ai/orchestrator.py +184 -0
- docsmith_ai-0.2.1/docsmith/ai/prompts/api_reference.txt +66 -0
- docsmith_ai-0.2.1/docsmith/ai/prompts/architecture.txt +50 -0
- docsmith_ai-0.2.1/docsmith/ai/prompts/changelog.txt +37 -0
- docsmith_ai-0.2.1/docsmith/ai/prompts/contributing.txt +46 -0
- docsmith_ai-0.2.1/docsmith/ai/prompts/development_guide.txt +60 -0
- docsmith_ai-0.2.1/docsmith/ai/prompts/quickstart.txt +42 -0
- docsmith_ai-0.2.1/docsmith/ai/prompts/readme.txt +71 -0
- docsmith_ai-0.2.1/docsmith/ai/prompts/security.txt +35 -0
- docsmith_ai-0.2.1/docsmith/ai/providers/__init__.py +1 -0
- docsmith_ai-0.2.1/docsmith/ai/providers/anthropic_provider.py +39 -0
- docsmith_ai-0.2.1/docsmith/ai/providers/base.py +40 -0
- docsmith_ai-0.2.1/docsmith/ai/providers/gemini.py +67 -0
- docsmith_ai-0.2.1/docsmith/ai/providers/mistral_provider.py +39 -0
- docsmith_ai-0.2.1/docsmith/ai/providers/openai_provider.py +39 -0
- docsmith_ai-0.2.1/docsmith/analysis/__init__.py +1 -0
- docsmith_ai-0.2.1/docsmith/analysis/analyzer.py +78 -0
- docsmith_ai-0.2.1/docsmith/analysis/architecture_builder.py +142 -0
- docsmith_ai-0.2.1/docsmith/analysis/cli_detector.py +115 -0
- docsmith_ai-0.2.1/docsmith/analysis/dependency_detector.py +250 -0
- docsmith_ai-0.2.1/docsmith/analysis/framework_detector.py +89 -0
- docsmith_ai-0.2.1/docsmith/analysis/route_detector.py +125 -0
- docsmith_ai-0.2.1/docsmith/config/__init__.py +1 -0
- docsmith_ai-0.2.1/docsmith/config/settings.py +233 -0
- docsmith_ai-0.2.1/docsmith/config/storage.py +189 -0
- docsmith_ai-0.2.1/docsmith/generation/__init__.py +1 -0
- docsmith_ai-0.2.1/docsmith/generation/evidence.py +499 -0
- docsmith_ai-0.2.1/docsmith/generation/planner.py +329 -0
- docsmith_ai-0.2.1/docsmith/generation/refiner.py +78 -0
- docsmith_ai-0.2.1/docsmith/generation/reviewer.py +400 -0
- docsmith_ai-0.2.1/docsmith/generation/scorer.py +200 -0
- docsmith_ai-0.2.1/docsmith/generation/writer.py +239 -0
- docsmith_ai-0.2.1/docsmith/github/__init__.py +1 -0
- docsmith_ai-0.2.1/docsmith/github/fetcher.py +551 -0
- docsmith_ai-0.2.1/docsmith/github/parser.py +125 -0
- docsmith_ai-0.2.1/docsmith/github/repository_context.py +103 -0
- docsmith_ai-0.2.1/docsmith/main.py +546 -0
- docsmith_ai-0.2.1/docsmith/models/__init__.py +29 -0
- docsmith_ai-0.2.1/docsmith/models/documentation_plan.py +82 -0
- docsmith_ai-0.2.1/docsmith/models/generated_document.py +82 -0
- docsmith_ai-0.2.1/docsmith/models/repo_context.py +217 -0
- docsmith_ai-0.2.1/docsmith/output/__init__.py +1 -0
- docsmith_ai-0.2.1/docsmith/output/filesystem.py +37 -0
- docsmith_ai-0.2.1/docsmith/output/preview.py +31 -0
- docsmith_ai-0.2.1/docsmith/output/summary.py +97 -0
- docsmith_ai-0.2.1/pyproject.toml +108 -0
- docsmith_ai-0.2.1/tests/__init__.py +1 -0
- docsmith_ai-0.2.1/tests/test_analyzer.py +228 -0
- docsmith_ai-0.2.1/tests/test_config.py +242 -0
- docsmith_ai-0.2.1/tests/test_evidence.py +320 -0
- docsmith_ai-0.2.1/tests/test_generation.py +150 -0
- docsmith_ai-0.2.1/tests/test_github.py +268 -0
- docsmith_ai-0.2.1/tests/test_main.py +182 -0
- docsmith_ai-0.2.1/tests/test_models.py +172 -0
- docsmith_ai-0.2.1/tests/test_orchestrator.py +118 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
tags: ["v*"]
|
|
7
|
+
pull_request:
|
|
8
|
+
branches: [main]
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
test:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
strategy:
|
|
17
|
+
matrix:
|
|
18
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
|
|
23
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
24
|
+
uses: actions/setup-python@v5
|
|
25
|
+
with:
|
|
26
|
+
python-version: ${{ matrix.python-version }}
|
|
27
|
+
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: |
|
|
30
|
+
python -m pip install --upgrade pip
|
|
31
|
+
pip install -e ".[dev]"
|
|
32
|
+
|
|
33
|
+
- name: Lint with ruff
|
|
34
|
+
run: |
|
|
35
|
+
ruff check .
|
|
36
|
+
ruff format --check .
|
|
37
|
+
|
|
38
|
+
- name: Run tests
|
|
39
|
+
run: pytest --cov=docsmith --cov-report=term-missing
|
|
40
|
+
|
|
41
|
+
publish:
|
|
42
|
+
needs: test
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
|
45
|
+
|
|
46
|
+
permissions:
|
|
47
|
+
contents: read
|
|
48
|
+
id-token: write
|
|
49
|
+
|
|
50
|
+
steps:
|
|
51
|
+
- uses: actions/checkout@v4
|
|
52
|
+
|
|
53
|
+
- name: Set up Python
|
|
54
|
+
uses: actions/setup-python@v5
|
|
55
|
+
with:
|
|
56
|
+
python-version: "3.12"
|
|
57
|
+
|
|
58
|
+
- name: Install build tools
|
|
59
|
+
run: pip install build
|
|
60
|
+
|
|
61
|
+
- name: Build package
|
|
62
|
+
run: python -m build
|
|
63
|
+
|
|
64
|
+
- name: Publish to PyPI
|
|
65
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
*.egg-info/
|
|
7
|
+
*.egg
|
|
8
|
+
dist/
|
|
9
|
+
build/
|
|
10
|
+
.eggs/
|
|
11
|
+
|
|
12
|
+
# Virtual environments
|
|
13
|
+
.venv/
|
|
14
|
+
venv/
|
|
15
|
+
ENV/
|
|
16
|
+
|
|
17
|
+
# IDE
|
|
18
|
+
.vscode/
|
|
19
|
+
.idea/
|
|
20
|
+
*.swp
|
|
21
|
+
*.swo
|
|
22
|
+
*~
|
|
23
|
+
|
|
24
|
+
# Testing
|
|
25
|
+
.pytest_cache/
|
|
26
|
+
.coverage
|
|
27
|
+
htmlcov/
|
|
28
|
+
.tox/
|
|
29
|
+
|
|
30
|
+
# Ruff
|
|
31
|
+
.ruff_cache/
|
|
32
|
+
|
|
33
|
+
# OS
|
|
34
|
+
.DS_Store
|
|
35
|
+
Thumbs.db
|
|
36
|
+
|
|
37
|
+
# Project
|
|
38
|
+
docsmith-output/
|
|
39
|
+
*.log
|
|
40
|
+
|
|
41
|
+
# Config (user secrets)
|
|
42
|
+
# Note: ~/.docsmith/ is in home dir, not repo
|
|
43
|
+
|
|
44
|
+
# Prompt file (development only)
|
|
45
|
+
prompt.txt
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# AGENTS.md — DocSmith Repository Intelligence
|
|
2
|
+
|
|
3
|
+
> This file provides repository-level instructions for AI coding agents.
|
|
4
|
+
> Consult this before making any changes.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Project Vision
|
|
9
|
+
|
|
10
|
+
DocSmith is an AI-powered documentation engineer CLI that analyzes GitHub repositories,
|
|
11
|
+
understands their structure, extracts intelligence, and generates production-ready documentation.
|
|
12
|
+
|
|
13
|
+
**Core Principle:** Every generated document must contain repository-specific information.
|
|
14
|
+
No generic AI slop. The output should feel like it was written by a human maintainer
|
|
15
|
+
who deeply understands the codebase.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Architecture Rules
|
|
20
|
+
|
|
21
|
+
### Pipeline
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
Repository URL → GitHub Fetcher → Parser → Analyzer → RepoContext → Planner → Writer → Reviewer → Scorer → Output
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Module Responsibilities
|
|
28
|
+
|
|
29
|
+
| Module | Responsibility |
|
|
30
|
+
|--------|---------------|
|
|
31
|
+
| `docsmith/github/` | Fetch repository data via GitHub REST API |
|
|
32
|
+
| `docsmith/analysis/` | Extract structured intelligence from raw repo data |
|
|
33
|
+
| `docsmith/ai/` | AI provider abstraction + prompt management |
|
|
34
|
+
| `docsmith/generation/` | Plan, write, review, score documentation |
|
|
35
|
+
| `docsmith/generation/evidence.py` | Build the bounded, redacted evidence brief that grounds every model call |
|
|
36
|
+
| `docsmith/config/` | Settings management and persistent storage |
|
|
37
|
+
| `docsmith/output/` | File output, preview, and summary display |
|
|
38
|
+
| `docsmith/models/` | Pydantic data models shared across modules |
|
|
39
|
+
|
|
40
|
+
### Key Constraints
|
|
41
|
+
|
|
42
|
+
1. **Never send raw repository content to the LLM.** All model input goes through the
|
|
43
|
+
analysis pipeline and `docsmith/generation/evidence.py`, which selects, caps, and
|
|
44
|
+
redacts what is sent. Prompt templates must consume the `{{ evidence }}` block and
|
|
45
|
+
must not invent facts that are absent from it.
|
|
46
|
+
2. **Provider abstraction is mandatory.** All AI calls go through the provider interface.
|
|
47
|
+
3. **Pydantic models everywhere.** All data structures use Pydantic for validation.
|
|
48
|
+
4. **Rich terminal output.** All user-facing output uses the Rich library.
|
|
49
|
+
5. **Graceful error handling.** Every failure mode has an actionable error message.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Coding Standards
|
|
54
|
+
|
|
55
|
+
- **Python 3.10+** with type hints on all function signatures
|
|
56
|
+
- **Pydantic v2** for all data models
|
|
57
|
+
- **`ruff`** for linting (`ruff check .`)
|
|
58
|
+
- **`ruff format`** for formatting (`ruff format .`)
|
|
59
|
+
- **`pytest`** for testing (`pytest -v`)
|
|
60
|
+
- **Docstrings** on all public classes and functions (Google style)
|
|
61
|
+
- **No wildcard imports**
|
|
62
|
+
- **No mutable default arguments**
|
|
63
|
+
- **Async-ready** where applicable (AI providers)
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Testing Commands
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# Run all tests
|
|
71
|
+
pytest -v
|
|
72
|
+
|
|
73
|
+
# Run with coverage
|
|
74
|
+
pytest --cov=docsmith --cov-report=term-missing
|
|
75
|
+
|
|
76
|
+
# Run specific test module
|
|
77
|
+
pytest tests/test_analyzer.py -v
|
|
78
|
+
|
|
79
|
+
# Lint
|
|
80
|
+
ruff check .
|
|
81
|
+
|
|
82
|
+
# Format
|
|
83
|
+
ruff format .
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## File Naming Conventions
|
|
89
|
+
|
|
90
|
+
- Snake_case for all Python files
|
|
91
|
+
- Models use singular nouns (`repo_context.py`, not `repo_contexts.py`)
|
|
92
|
+
- Providers use `<name>_provider.py` pattern (except Gemini which is `gemini.py`)
|
|
93
|
+
- Prompt templates use `.txt` extension in `docsmith/ai/prompts/`
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Dependencies
|
|
98
|
+
|
|
99
|
+
Core: `typer`, `rich`, `questionary`, `requests`, `pyperclip`, `pydantic`, `jinja2`
|
|
100
|
+
|
|
101
|
+
AI Providers: `google-genai`, `openai`, `anthropic`, `mistralai`
|
|
102
|
+
|
|
103
|
+
Dev: `pytest`, `pytest-cov`, `ruff`, `pytest-mock`
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Configuration
|
|
108
|
+
|
|
109
|
+
User config stored at `~/.docsmith/config.json`
|
|
110
|
+
Cache stored at `~/.docsmith/cache/`
|
|
111
|
+
|
|
112
|
+
First-run triggers an interactive setup wizard for provider selection and API key input.
|
|
113
|
+
|
|
114
|
+
Environment variables override the config file and work without one:
|
|
115
|
+
`DOCSMITH_PROVIDER`, `DOCSMITH_<PROVIDER>_API_KEY`, `DOCSMITH_MODEL`, and
|
|
116
|
+
`DOCSMITH_GITHUB_TOKEN`. Conventional names such as `GEMINI_API_KEY`,
|
|
117
|
+
`OPENAI_API_KEY`, and `GITHUB_TOKEN` are also accepted. Environment keys must
|
|
118
|
+
never be persisted to disk. Non-interactive runs must use `--quick`; commands
|
|
119
|
+
fail fast instead of prompting when no TTY is attached.
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to DocSmith will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.2.1] - 2026-10-20
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **Evidence-grounded generation**: a new evidence builder
|
|
12
|
+
(`docsmith/generation/evidence.py`) assembles a bounded, redacted brief from
|
|
13
|
+
repository facts, file layout, dependencies, code intelligence, existing README
|
|
14
|
+
commands, and selected source excerpts. Every prompt now receives this evidence
|
|
15
|
+
and is instructed to state only what the evidence supports.
|
|
16
|
+
- Prompt templates for the three document types that previously fell back to a
|
|
17
|
+
generic prompt: `CHANGELOG`, `DEVELOPMENT_GUIDE`, and `QUICKSTART`. All eight
|
|
18
|
+
document types now ship a template and consume the `{{ evidence }}` block.
|
|
19
|
+
- Silent credential redaction and `.env` exclusion in source excerpts.
|
|
20
|
+
- Template placeholders (for example `<YOUR_GIT_URL>`) are stripped from the
|
|
21
|
+
existing-README evidence before it reaches the model.
|
|
22
|
+
- Gemini support now uses the supported `google-genai` SDK instead of the
|
|
23
|
+
end-of-life `google-generativeai` package.
|
|
24
|
+
- `python -m docsmith` is now a supported entry point.
|
|
25
|
+
- Environment-first configuration: `DOCSMITH_PROVIDER`, `DOCSMITH_<PROVIDER>_API_KEY`,
|
|
26
|
+
`DOCSMITH_MODEL`, and `DOCSMITH_GITHUB_TOKEN` work without a config file.
|
|
27
|
+
Conventional names such as `GEMINI_API_KEY`, `OPENAI_API_KEY`, and
|
|
28
|
+
`GITHUB_TOKEN` are also accepted. Environment keys are never written to disk.
|
|
29
|
+
- Non-interactive mode: commands fail fast with actionable instructions when no
|
|
30
|
+
terminal is available, and `--quick` lets CI run end-to-end without prompts.
|
|
31
|
+
- Friendly CLI error handling through the `docsmith.main:cli` wrapper, with
|
|
32
|
+
`DOCSMITH_DEBUG=1` available for full tracebacks.
|
|
33
|
+
|
|
34
|
+
### Changed
|
|
35
|
+
- Reviewer now validates generated shell commands against the detected dependency
|
|
36
|
+
set, validates documented endpoints, and flags placeholder values. Unsupported
|
|
37
|
+
commands and placeholders are reported as refinable issues. `needs_refinement()`
|
|
38
|
+
decides the refinement pass, so warnings are no longer ignored when only
|
|
39
|
+
critical issues used to trigger a rewrite.
|
|
40
|
+
- Refiner receives the same evidence as the writer, refuses to introduce new
|
|
41
|
+
claims, keeps the original document when the model returns nothing, and
|
|
42
|
+
re-applies the emoji preference after rewriting.
|
|
43
|
+
- AI retries now use exponential backoff and only retry transient failures
|
|
44
|
+
(429/5xx/timeouts). Missing SDKs, bad API keys, and permission errors fail
|
|
45
|
+
immediately instead of being retried three times.
|
|
46
|
+
- GitHub API layer retries transient failures (timeouts, connection errors, 429,
|
|
47
|
+
5xx) with exponential backoff, reports rate limits versus permission errors
|
|
48
|
+
separately, honours `Retry-After`, and warns about truncated trees.
|
|
49
|
+
- GitHub file selection ranks the shallowest copy of each manifest first and
|
|
50
|
+
deprioritises `examples/`, `docs/`, `tests/`, and vendor directories, so real
|
|
51
|
+
project code is no longer crowded out by sample apps. Real `.env` files are
|
|
52
|
+
never fetched; only `.env.example`/`.env.sample`/`.env.template`.
|
|
53
|
+
- Evidence budgeting now truncates the tail of the source-excerpt section instead
|
|
54
|
+
of dropping it, so real code survives budget pressure.
|
|
55
|
+
- pyproject dependency parsing now understands PEP 621, Poetry, and dependency
|
|
56
|
+
groups, and duplicate declarations are collapsed.
|
|
57
|
+
- Config and cache writes are atomic and owner-only (`0600`).
|
|
58
|
+
- `docsmith config` now merges into the existing configuration instead of
|
|
59
|
+
replacing it, preserving other provider keys, tokens, and preferences.
|
|
60
|
+
- `--quick` uses the configured audience and tone, and the output directory
|
|
61
|
+
follows `output_dir` unless `--output` is passed.
|
|
62
|
+
- README rewritten around the evidence pipeline, with an install matrix
|
|
63
|
+
(pip/uvx/pipx), document-type and CLI tables, a live generated excerpt, an
|
|
64
|
+
FAQ, and custom SVG banner/pipeline visuals.
|
|
65
|
+
- `SECURITY.md` now points to GitHub private vulnerability reporting instead of
|
|
66
|
+
an unreachable email address.
|
|
67
|
+
|
|
68
|
+
### Fixed
|
|
69
|
+
- Old cache files that contained `.env` contents are scrubbed when loaded.
|
|
70
|
+
- Repository descriptions containing bracket characters no longer crash the
|
|
71
|
+
analysis table.
|
|
72
|
+
- The corrupted-config message now prints the actual config path instead of the
|
|
73
|
+
literal `{CONFIG_FILE}`.
|
|
74
|
+
- `pyproject.toml` project URLs now point to the real repository, the publish job
|
|
75
|
+
keeps `contents: read`, and the deprecated `typer[all]` extra was removed.
|
|
76
|
+
- `ruff format --check` now passes across the repository.
|
|
77
|
+
|
|
78
|
+
### Refactored
|
|
79
|
+
- Extracted magic numbers into constants in `scorer.py` and `reviewer.py`
|
|
80
|
+
- Simplified framework detection with data-driven lookup
|
|
81
|
+
- Reused Markdown responses clean up utility between writer and refiner
|
|
82
|
+
- Removed redundant continue/empty instructions and comments across modules
|
|
83
|
+
|
|
84
|
+
## [0.1.0] - 2026-06-04
|
|
85
|
+
|
|
86
|
+
### Added
|
|
87
|
+
|
|
88
|
+
- **Core CLI** with `generate`, `analyze`, `config`, `cache`, and `version` commands
|
|
89
|
+
- **GitHub integration** with intelligent file selection and rate limit handling
|
|
90
|
+
- **Repository analysis engine**:
|
|
91
|
+
- Dependency detection (Python, JavaScript, Rust, Go)
|
|
92
|
+
- Framework detection (FastAPI, Flask, Django, Express, Typer, Click, and more)
|
|
93
|
+
- API route detection (FastAPI, Flask, Django, Express)
|
|
94
|
+
- CLI command detection (Typer, Click)
|
|
95
|
+
- Code intelligence extraction (classes, functions, env variables)
|
|
96
|
+
- **Multi-provider AI support**:
|
|
97
|
+
- Google Gemini (default)
|
|
98
|
+
- OpenAI (GPT-4o)
|
|
99
|
+
- Anthropic (Claude)
|
|
100
|
+
- Mistral AI
|
|
101
|
+
- **Documentation generation pipeline**:
|
|
102
|
+
- Intelligent planner with context-aware section planning
|
|
103
|
+
- Jinja2 prompt templates for consistent output
|
|
104
|
+
- Quality reviewer (catches hallucinations, missing sections, placeholders)
|
|
105
|
+
- Multi-dimensional scorer (completeness, correctness, examples, usability, maintainability)
|
|
106
|
+
- Auto-refiner for fixing review issues
|
|
107
|
+
- **9 document types**: README, CONTRIBUTING, SECURITY, ARCHITECTURE, API_REFERENCE, CHANGELOG, DEVELOPMENT_GUIDE, QUICKSTART, LICENSE
|
|
108
|
+
- **Interactive questionnaire** for customizing generation options
|
|
109
|
+
- **First-run setup wizard** for provider configuration
|
|
110
|
+
- **Repository analysis caching** with configurable TTL
|
|
111
|
+
- **Rich terminal UI** with progress bars, tables, and Markdown preview
|
|
112
|
+
- **Preview mode** for terminal output without file writing
|
|
113
|
+
- **65 unit tests** covering models, analysis, generation, and configuration
|
|
114
|
+
- **CI pipeline** with GitHub Actions (Python 3.10–3.13 matrix)
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Contributing to DocSmith
|
|
2
|
+
|
|
3
|
+
Thank you for considering contributing to DocSmith!
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
1. **Fork** the repository
|
|
8
|
+
2. **Clone** your fork:
|
|
9
|
+
```bash
|
|
10
|
+
git clone https://github.com/<your-username>/DocSmith.git
|
|
11
|
+
cd DocSmith
|
|
12
|
+
```
|
|
13
|
+
3. **Set up** the development environment:
|
|
14
|
+
```bash
|
|
15
|
+
python -m venv .venv
|
|
16
|
+
source .venv/bin/activate # or .venv\Scripts\activate on Windows
|
|
17
|
+
pip install -e ".[dev,all-providers]"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Development Workflow
|
|
21
|
+
|
|
22
|
+
### Branch naming
|
|
23
|
+
|
|
24
|
+
- `feat/description` — new features
|
|
25
|
+
- `fix/description` — bug fixes
|
|
26
|
+
- `docs/description` — documentation changes
|
|
27
|
+
- `refactor/description` — code refactoring
|
|
28
|
+
|
|
29
|
+
### Making changes
|
|
30
|
+
|
|
31
|
+
1. Create a branch: `git checkout -b feat/my-feature`
|
|
32
|
+
2. Make your changes
|
|
33
|
+
3. Run tests: `pytest -v`
|
|
34
|
+
4. Run lints: `ruff check . && ruff format --check .`
|
|
35
|
+
5. Commit: `git commit -m "feat: add my feature"`
|
|
36
|
+
6. Push: `git push origin feat/my-feature`
|
|
37
|
+
7. Open a Pull Request
|
|
38
|
+
|
|
39
|
+
## Testing
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Run all tests
|
|
43
|
+
pytest -v
|
|
44
|
+
|
|
45
|
+
# Run with coverage
|
|
46
|
+
pytest --cov=docsmith --cov-report=term-missing
|
|
47
|
+
|
|
48
|
+
# Run a specific test file
|
|
49
|
+
pytest tests/test_analyzer.py -v
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Code Style
|
|
53
|
+
|
|
54
|
+
We use **ruff** for both linting and formatting:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# Check for issues
|
|
58
|
+
ruff check .
|
|
59
|
+
|
|
60
|
+
# Auto-fix issues
|
|
61
|
+
ruff check . --fix
|
|
62
|
+
|
|
63
|
+
# Format code
|
|
64
|
+
ruff format .
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Style rules
|
|
68
|
+
|
|
69
|
+
- Python 3.10+ with type hints on all function signatures
|
|
70
|
+
- Pydantic v2 for all data models
|
|
71
|
+
- Google-style docstrings on all public classes and functions
|
|
72
|
+
- No wildcard imports
|
|
73
|
+
- No mutable default arguments
|
|
74
|
+
|
|
75
|
+
## Project Structure
|
|
76
|
+
|
|
77
|
+
| Directory | Purpose |
|
|
78
|
+
|-----------|---------|
|
|
79
|
+
| `docsmith/ai/` | AI provider abstraction + prompts |
|
|
80
|
+
| `docsmith/analysis/` | Code intelligence extraction |
|
|
81
|
+
| `docsmith/config/` | Settings and persistent storage |
|
|
82
|
+
| `docsmith/generation/` | Evidence builder, planning, writing, review, scoring |
|
|
83
|
+
| `docsmith/github/` | GitHub API integration |
|
|
84
|
+
| `docsmith/models/` | Pydantic data models |
|
|
85
|
+
| `docsmith/output/` | File output and terminal preview |
|
|
86
|
+
| `tests/` | Test suite |
|
|
87
|
+
|
|
88
|
+
## Commit Messages
|
|
89
|
+
|
|
90
|
+
Follow [Conventional Commits](https://www.conventionalcommits.org/):
|
|
91
|
+
|
|
92
|
+
- `feat:` — new feature
|
|
93
|
+
- `fix:` — bug fix
|
|
94
|
+
- `docs:` — documentation
|
|
95
|
+
- `test:` — tests
|
|
96
|
+
- `refactor:` — code refactoring
|
|
97
|
+
- `chore:` — maintenance
|
|
98
|
+
|
|
99
|
+
## Reporting Bugs
|
|
100
|
+
|
|
101
|
+
Open an issue with:
|
|
102
|
+
- DocSmith version (`docsmith version`)
|
|
103
|
+
- Python version
|
|
104
|
+
- Steps to reproduce
|
|
105
|
+
- Expected vs actual behavior
|
|
106
|
+
|
|
107
|
+
## Feature Requests
|
|
108
|
+
|
|
109
|
+
Open an issue with the `enhancement` label describing:
|
|
110
|
+
- The problem you're trying to solve
|
|
111
|
+
- Your proposed solution
|
|
112
|
+
- Alternative approaches you've considered
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
Thank you for helping make DocSmith better!
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DocSmith Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|