Package Exports
- @techdebtgpt/archdoc-generator
- @techdebtgpt/archdoc-generator/dist/src/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@techdebtgpt/archdoc-generator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
šļø ArchDoc Generator
AI-powered architecture documentation generator for any codebase using LangChain and multi-agent workflows.
ArchDoc Generator is an intelligent tool that analyzes your codebase and generates comprehensive, accurate architectural documentation automatically. It supports any programming language and uses AI-powered agents to understand your project structure, dependencies, patterns, security, and data flows.
š Table of Contents
- Features
- Quick Start
- CLI Usage
- Programmatic Usage
- Configuration
- What Gets Generated
- Available Agents
- Architecture Highlights
- Supported Languages
- Contributing
- License
⨠Features
- š¤ 7 Specialized Agents: File Structure, Dependencies, Patterns, Flows, Schemas, Architecture, and Security.
- š Language Agnostic: Works with TypeScript, Python, Java, Go, and more.
- š§ AI-Powered: Uses LangChain with Claude 4.5, GPT-5, Gemini 2.5, or Grok 3.
- š Comprehensive Analysis: Structure, dependencies, patterns, flows, schemas, and security.
- š Markdown Output: Clean, version-controllable documentation.
- š Iterative Refinement: Self-improving analysis with quality checks.
- šØ Customizable: Prompt-based agent selection and configuration.
- š LangSmith Tracing: Full observability of AI workflows.
- š Security Analysis: Vulnerability detection, authentication review, and crypto analysis.
š Quick Start
Installation
# Using npm
npm install -g @techdebtgpt/archdoc-generator
# Using yarn
yarn global add @techdebtgpt/archdoc-generator
# Using pnpm
pnpm add -g @techdebtgpt/archdoc-generatorInteractive Setup (Recommended)
Run the interactive configuration wizard:
archdoc config --initThis will:
- Prompt you to choose an LLM provider (Anthropic/OpenAI/Google).
- Ask for your API key.
- Create
.archdoc.config.jsonwith your configuration. - Validate your setup.
Basic Usage
# Analyze current directory
archdoc analyze
# Analyze specific project
archdoc analyze /path/to/your/project
# Focused analysis with prompt
archdoc analyze --prompt "analyze dependencies and security vulnerabilities"
# Custom output location
archdoc analyze --output ./docs
# Quick analysis (faster, less detailed)
archdoc analyze --depth quickCLI Usage
archdoc analyze [path] [options]Options:
| Option | Description | Default |
|---|---|---|
--output <dir> |
Output directory | .arch-docs |
--prompt <text> |
Focus analysis with natural language | |
--depth <level> |
Analysis depth: quick, normal, deep |
normal |
--provider <name> |
LLM provider: anthropic, openai, google |
|
--model <name> |
Specific model to use | |
--refinement |
Enable iterative refinement | true |
--refinement-iterations <n> |
Max refinement iterations | 5 |
--refinement-threshold <n> |
Clarity threshold % | 80 |
--no-clean |
Don't clear output directory | |
--verbose |
Show detailed progress |
š§ Programmatic Usage
Use the library in your Node.js applications:
import {
DocumentationOrchestrator,
AgentRegistry,
FileSystemScanner,
} from '@techdebtgpt/archdoc-generator';
// Setup registry with agents
const registry = new AgentRegistry();
const scanner = new FileSystemScanner();
const orchestrator = new DocumentationOrchestrator(registry, scanner);
// Generate documentation
const docs = await orchestrator.generateDocumentation('/path/to/project', {
maxTokens: 100000,
parallel: true,
iterativeRefinement: {
enabled: true,
maxIterations: 5,
clarityThreshold: 80,
},
});
console.log('Generated:', docs.summary);See the API Reference for complete programmatic documentation.
āļø Configuration
Environment Variables
| Variable | Description |
|---|---|
ANTHROPIC_API_KEY |
Anthropic Claude API key |
OPENAI_API_KEY |
OpenAI GPT API key |
GOOGLE_API_KEY |
Google Gemini API key |
XAI_API_KEY |
xAI Grok API key |
DEFAULT_LLM_PROVIDER |
Default provider (e.g., anthropic) |
DEFAULT_LLM_MODEL |
Default model (e.g., claude-sonnet-4-5-20250929) |
LANGCHAIN_TRACING_V2 |
Enable LangSmith tracing (true) |
LANGCHAIN_API_KEY |
LangSmith API key |
LANGCHAIN_PROJECT |
LangSmith project name |
See the Configuration Guide for detailed options.
šØ What Gets Generated
The tool generates a multi-file documentation structure:
docs/
āāā index.md
āāā metadata.md
āāā file-structure.md
āāā dependencies.md
āāā patterns.md
āāā flows.md
āāā schemas.md
āāā architecture.md
āāā security.md
āāā recommendations.mdš¤ Available Agents
Each agent specializes in a specific analysis task:
| Agent | Purpose | Priority |
|---|---|---|
| File Structure | Project organization, entry points | HIGH |
| Dependency Analyzer | External deps, internal imports | HIGH |
| Architecture Analyzer | High-level design | HIGH |
| Pattern Detector | Design patterns, conventions | MEDIUM |
| Flow Visualization | Control & data flows | MEDIUM |
| Schema Generator | Data models, interfaces | MEDIUM |
| Security Analyzer | Vulnerabilities, auth, crypto | MEDIUM |
šļø Architecture Highlights
Multi-Agent System
The orchestrator coordinates agents to perform analysis.
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā Documentation Orchestrator ā
āāāāāāāāāāāāāāā¬āāāāāāāāāāāāāā
ā
āāāāāāāāāāā“āāāāāāāāāā
ā Agent Registry ā
āāāāāāāāāāā¬āāāāāāāāāā
ā
āāāāā¼āāāāā āāāāā¼āāāā āāāāā¼āāāā
ā Agent 1ā ā Agent 2ā ā Agent Nā
āāāāāāāāāā āāāāāāāāā āāāāāāāāāLangChain LCEL Integration
All agents use LangChain Expression Language (LCEL) for composable AI workflows with unified LangSmith tracing.
š Supported Languages
The tool is language-agnostic and works with:
- TypeScript/JavaScript
- Python
- Java/Kotlin
- Go
- C#/.NET
- Ruby
- PHP
- Rust (experimental)
- And more!
š¤ Contributing
We welcome contributions! See the Contributing Guide for details on:
- Development setup
- Creating custom agents
- Testing guidelines
- Code style and standards
- Pull request process
ļæ½ Resources
- š Website: techdebtgpt.com
- š¦ GitHub: github.com/techdebtgpt/architecture-doc-generator
- š Documentation: Full Documentation
- š¬ Discussions: GitHub Discussions
- š Issues: Report Issues
ļæ½š License
Apache License 2.0 - see the LICENSE file for details.
Made with ā¤ļø by TechDebtGPT