| name | docs |
| description | Generate or update API documentation. Tracks changes since last documentation run using commit markers. |
Generate Documentation
Updates API documentation for source files that changed since the last documentation run.
Process
- Check state: Read
.claude/data/docs-state.jsonforlast_documented_commit - Find changes: Run
git diff <last_commit>..HEAD --name-only -- src/to get changed files - Filter: Only process files that define public APIs (components, modules, types)
- Generate: For each changed file, create or update corresponding doc in
docs/ - Update state: Write current HEAD commit hash to
docs-state.json
State File
.claude/data/docs-state.json:
{
"last_documented_commit": "abc123def",
"last_run": "2024-01-15T10:30:00Z"
}
If missing, document everything and create it.
Arguments
--full: Ignore state, regenerate all documentation--dry-run: Show what would be documented without writing
Output Structure
Mirror source structure under docs/:
src/components/button.rs → docs/components/button.md
src/git/repository.rs → docs/git/repository.md
Documentation Style
Use the docs agent guidelines. Each doc should have:
- Overview with basic example
- Topics grouped by purpose
- See Also for related items
After Running
Report:
- Files documented (new)
- Files updated
- Files unchanged
- Current commit hash stored