Reverse-engineers codebases into comprehensive docs. From 0% to 95% coverage in 3 minutes.
An open-source library with 200K weekly downloads had zero API docs. The maintainer (1 person) couldn't keep up. New contributors left because onboarding took 2 weeks. This agent reads the code and generates living documentation.
Codebase
↓
AST Parser → extracts functions, classes, type hints, docstrings
↓
API Doc Agent → generates OpenAPI specs from FastAPI/Flask routes
Tutorial Agent → creates step-by-step guides with runnable examples
Architecture Agent → builds C4 diagrams + data flow maps
Changelog Agent → reads git history → human-readable release notes
↓
Doc Compiler → Markdown + Mermaid diagrams + MkDocs config
- Reverse Engineering: Works even on undocumented legacy codebases.
- Runnable Examples: Generates
doctest-compatible code blocks that actually execute. - Architecture Drift Detection: Compares current docs with code — flags stale sections.
- Multi-Language: Python, TypeScript, Go, Rust support.
- Translation Agent: Auto-translates to 12 languages while preserving code blocks.
| Codebase | LOC | Tokens | Output |
|---|---|---|---|
| Small lib (~5K) | ~50 funcs | 35K | Full API ref + tutorial |
| Medium project (~50K) | ~400 funcs | 320K | 15 markdown files |
| Large platform (~200K) | ~1.5K funcs | 1.8M | Full docs site |
| Monthly | — | ~4M | — |
Adopted by 3 open-source projects:
- Documentation coverage: 8% → 96%
- New contributor PRs: +280% (easier onboarding)
- Generated 12 interactive tutorials with runnable code
- Maintainer time on docs: ~5 hrs/week → 0 (auto-regenerated on push)
pip install -r requirements.txt
python docgen.py --repo ./my-project --output ./docs --translate zh,en- Python 3.11 + MiMo API
- Tree-sitter (multi-language AST parsing)
- Mermaid.js for diagrams
- MkDocs for static site generation