Marketplace

documenting-architecture

Generate architecture overview documentation from codebase analysis. Uses tree-sitter-analyzer for precise code structure extraction. Generates Mermaid diagrams for visual representation. Triggers: architecture overview, project structure, module diagram, dependency graph, code structure, directory structure.

allowed_tools: Read, Write, Grep, Glob, Bash, Task

$ 安裝

git clone https://github.com/thkt/claude-config /tmp/claude-config && cp -r /tmp/claude-config/skills/documenting-architecture ~/.claude/skills/claude-config

// tip: Run this command in your terminal to install the skill


name: documenting-architecture description: > Generate architecture overview documentation from codebase analysis. Uses tree-sitter-analyzer for precise code structure extraction. Generates Mermaid diagrams for visual representation. Triggers: architecture overview, project structure, module diagram, dependency graph, code structure, directory structure. allowed-tools:

  • Read
  • Write
  • Grep
  • Glob
  • Bash
  • Task context: fork agent: architecture-analyzer

docs:architecture - Architecture Overview Generation

Auto-generate architecture documentation from codebase analysis.

Generated Content

SectionDescription
Project OverviewTech stack, framework detection
Directory Structuretree command output
Module CompositionMermaid relationship diagrams
Key ComponentsClasses, functions with statistics
DependenciesExternal/internal visualization
StatisticsFile count, line count, etc.

Processing Flow

PhaseActions
1. InitIdentify root, detect language/framework
2. Structuretree command, classify directories
3. Codetree-sitter-analyzer: classes, functions, imports
4. DependenciesParse imports, map relationships
5. GenerateMermaid diagrams, populate templates

Analysis Commands

# Directory structure
tree -L 3 -I 'node_modules|.git|dist|build|__pycache__|.venv' --dirsfirst

# Code structure (per file)
tree-sitter-analyzer {file} --structure --output-format json

# Dependencies - TypeScript/JavaScript
grep -r "^import\|^export" --include="*.ts" --include="*.tsx"

# Dependencies - Python
grep -r "^import\|^from.*import" --include="*.py"

Error Handling

ErrorResolution
Root not foundUse current directory
tree-sitter unavailableFallback to Grep/Read
Large projectSample top 100 files

Markdown Validation

After generation, validate output with:

~/.claude/skills/scripts/validate-markdown.sh {output-file}

Non-blocking (warnings only) - style issues don't block document creation.

References

  • [@../../agents/analyzers/architecture-analyzer.md] - architecture-analyzer agent
  • Command: /docs:architecture