AI Documentation Generator
Enterprise-grade documentation automation powered by DeepSeek's 671B-parameter AI model. OverviewThe AI Documentation Generator is a VS Code/Cursor extension that automatically analyzes code repositories and generates comprehensive technical documentation using DeepSeek R1T2 Chimera (671B parameter model). Designed for teams requiring always-accurate documentation synchronized with their codebase. Key Value Proposition
Target Use Cases
ArchitectureSystem Design
Core Components1. Code Analyzer Engine
2. AI Processing Layer
3. Output Generation System
Data Flow Process
FeaturesCore Capabilities
AI Model Specifications
Advanced Capabilities
Installation & SetupSystem Requirements
Installation Procedure1. Install Extension
2. Configure API Access
3. Extension Configuration (.vscode/settings.json)
4. Initialize Documentation
API ReferenceExtension Command API
|
Parameter | Type | Default | Description |
---|---|---|---|
ai.model |
string | deepseek-chimera-v1 |
Alternative models: claude-3-opus |
ai.temperature |
number | 0.1 |
Range: 0-1 (higher = more creative) |
output.diagramFormat |
string | mermaid |
Alternatives: plantuml , graphviz |
git.commitMessage |
string | docs: auto-update documentation |
Supports template variables: {date}, {fileCount} |
Configuration
Full Configuration Schema (.docgenrc.json)
{
"$schema": "./docgen.schema.json",
"analysis": {
"depth": "full", // 'module' or 'function'
"languageOverrides": {
"typescript": {
"parserOptions": {
"jsx": true,
"experimentalDecorators": true
}
}
}
},
"output": {
"formats": [
{
"template": "./templates/README.md.mustache",
"outputPath": "./README.md"
},
{
"template": "api-reference",
"outputPath": "./docs/API.md"
}
],
"diagram": {
"format": "mermaid",
"depth": 2 // Relationship depth for diagrams
}
},
"ai": {
"maxRetries": 3,
"timeout": 30000,
"fallbackModel": "claude-3-sonnet"
}
}
Environment Variables
# Priority order: env vars > config file > defaults
export DOCGEN_API_KEY=sk_your_key_here # Overrides ai.apiKey
export DOCGEN_LOG_LEVEL=debug # error|warn|info|debug
export DOCGEN_CACHE_DIR=.docgen_cache # Cache location
export DOCGEN_MAX_CONCURRENT=5 # Parallel processing threads
Usage Examples
Basic Generation Workflow
# Generate full documentation suite
> AI Doc Generator: Generate Project Documentation
# Monitor generation progress in Output panel:
# [info] Analyzing src/ (24 files)
# [info] Generating API documentation...
# [success] Documentation generated in 4.2s
Custom Template Implementation
<!-- templates/module-overview.mustache -->
## {{moduleName}}
{{#hasDescription}}
> {{description}}
{{/hasDescription}}
### Responsibilities
{{#responsibilities}}
- {{.}}
{{/responsibilities}}
{{#dependencies}}
### Dependencies
| Module | Interface |
|--------|-----------|
{{#modules}}
| {{name}} | {{interface}} |
{{/modules}}
{{/dependencies}}
CI/CD Integration (GitHub Actions)
name: Documentation Sync
on:
push:
branches: [ main ]
paths:
- 'src/**'
- '.github/workflows/docs.yml'
jobs:
update-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate Documentation
uses: voznyye/doc-generator-action@v1
with:
api-key: ${{ secrets.DOCGEN_KEY }}
args: --strict --template=enterprise --output-dir=docs/
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: "docs: auto-update from ${{ github.sha }}"
branch: "docs/auto-update"
Advanced Usage - Monorepo Support
// .docgenrc.json
{
"monorepo": {
"packages": ["packages/*", "services/*"],
"sharedDocsPath": "./common-docs",
"rootTemplate": "./templates/monorepo-root.md.mustache",
"dependencyResolution": "hoisted" // 'nested' or 'workspace'
}
}
Development
Local Setup
Clone repository:
git clone https://github.com/voznyye/AutoDoc.git cd AutoDoc/doc-generator-extension
Install dependencies:
npm install --include=dev
Build extension:
npm run build # Compile TypeScript npm run package # Create .vsix bundle
Testing Strategy
Unit Tests (Jest):
npm test # Tests core functionality
Integration Tests:
npm run test:integration # Requires VS Code test instance
Test Coverage Areas:
- AST parsing accuracy across languages (>95% coverage per parser)
- AI prompt generation correctness (golden file comparisons)
- Git integration workflows (mock git repository tests)
Debugging Workflow
- Launch VS Code Extension Host:
npm run debug
- Set breakpoints in
src/analyzer/core.ts
orsrc/ai/engine.ts
- Use test workspace (
test-fixtures/
) for live debugging
Troubleshooting
Common Issues & Solutions
Documentation Out of Sync
[warning] Documentation mismatch detected in src/api/module.ts
Solutions:
- Force revalidation:
> AI Doc Generator: Validate Documentation --strict
- Reset documentation cache:
{ "cache": { "enabled": false } } // Add to config
AI Generation Failures
[error] AI Engine Error: Context length exceeded (16384 tokens)
Solutions:
- Reduce context size through configuration:
{ "ai.maxTokens": 8192, "analysis.depth": "module" }
- Exclude large files via glob patterns:
{ "excludePatterns": ["**/vendor/**", "**/generated/**"] }
Performance Optimization
For repositories >50k LOC:
{
"cache.enabled": true,
"analysis.concurrency": 8, // CPU core count
"ai.chunkStrategy": "hierarchical",
"fileBatchSize": 50 // Files per AI request
}
FAQ
Q: How does the generator handle private codebases?
A: All processing occurs locally except AI inference calls which use encrypted connections to DeepSeek API
Q: Can I use my own AI models?
A: Yes through OpenRouter configuration - supports any compatible OpenAI API endpoint
Q: What's the maximum repository size supported?
A: Tested up to 250k LOC - performance scales linearly with proper hardware configuration
Contributing
Development Workflow
Create feature branch from
develop
:git checkout -b feat/new-parser-engine
Implement changes with tests (>80% coverage required):
npm run test:watch # TDD workflow recommended
Submit PR with required artifacts:
- Technical design document (
DESIGN.md
) - Performance benchmarks (
benchmarks/results.md
) - Updated documentation (
docs/**
)
- Technical design document (
Contribution Areas
High Priority Features:
- WebAssembly-based AST parser (performance critical)
- OpenAPI/Swagger integration (documentation interoperability)
- Real-time collaboration features (multi-user editing)
Testing Needs:
- Large-scale performance testing (>1M LOC repositories)
- Edge case language syntax handling (obscure language features)
- Documentation validation test suite (output quality assurance)
License & Credits
License: MIT License
Full Text: LICENSE
Acknowledgments
- DeepSeek Team for R1T2 Chimera model architecture and training
- OpenRouter for enterprise-grade inference infrastructure
- VS Code team for extensibility APIs and testing framework
"Documentation is love made visible."
Generated by DeepSeek-R1-T2-Chimera at {timestamp}
This documentation was automatically generated on August 20, 2025
To update documentation content: AI Doc Generator > Update Documentation