LegacyDoc AI
AI-powered documentation generator for legacy codebases.
Stop struggling with undocumented legacy code. LegacyDoc AI analyzes your code and generates comprehensive documentation — JSDoc comments, Markdown docs, and Mermaid architecture diagrams — in seconds.
Features
One-Click Documentation
- Right-click any file, selection, or folder → Generate Documentation
- Command Palette →
LegacyDoc AI: Generate Documentation
- Sidebar Panel → Quick access buttons
Three Output Modes
- Inline — JSDoc/docstring comments inserted directly into your code (preserves original style)
- Markdown — Standalone
.docs.md file with function docs, usage examples, and architecture overview
- Both — Get inline comments AND a Markdown reference file
Architecture Diagrams
Automatically generates Mermaid flowcharts and class diagrams showing module relationships — rendered live in the sidebar.
Multi-Provider AI
Bring your own API key. Supports:
- Anthropic (Claude 4 / Sonnet) — Best code understanding
- OpenAI (GPT-4o)
- xAI (Grok)
- Custom — Any OpenAI-compatible endpoint (local LLMs, Azure, etc.)
Legacy-First Approach
Unlike general AI assistants, LegacyDoc AI is optimized for legacy code:
- Preserves original code style and conventions
- Documents what code actually does, not what it should do
- Flags potential issues without modifying code
- Handles large files with automatic chunking
Getting Started
- Install the extension
- Open Command Palette →
LegacyDoc AI: Set API Key
- Right-click any code →
LegacyDoc AI: Document This File
Free vs Pro
| Feature |
Free |
Pro ($9/mo) |
| Daily generations |
5 |
Unlimited |
| Inline JSDoc |
Yes |
Yes |
| Markdown docs |
Yes |
Yes |
| Mermaid diagrams |
Yes |
Yes |
| Custom prompt templates |
- |
Yes |
| Batch file processing |
- |
Yes |
Settings
| Setting |
Description |
legacyDocAi.provider |
AI provider (anthropic, openai, xai, custom) |
legacyDocAi.outputMode |
Output format (inline, markdown, both) |
legacyDocAi.customBaseUrl |
Custom endpoint URL |
legacyDocAi.customModel |
Custom model name |
legacyDocAi.licenseKey |
Pro license key |
legacyDocAi.customPrompt |
[Pro] Custom system prompt |
Supported Languages
JavaScript, TypeScript, Python, Go, Java, Ruby, Rust, C/C++, C#, PHP — and more coming soon.
Security
- API keys are stored in your system keychain via VS Code's
secrets API
- Code is sent directly to your chosen AI provider — no intermediary servers
- All processing happens locally except the AI API call
Feedback & Issues
GitHub Issues
Made with AI, for developers drowning in legacy code.