| name | arch |
| description | Architecture Diagram Generator |
| lifecycle | experimental |
/arch - Architecture Diagram Generator
Generate Mermaid architecture diagrams from code analysis.
Usage
/arch [component] # Diagram specific component
/arch # Diagram entire project
/arch --type flowchart # Specify diagram type
Diagram Types
flowchart - Control flow and decision trees
class - Class relationships and inheritance
sequence - Component interactions over time
er - Entity relationships (database schemas)
c4 - C4 model (context, container, component)
What This Skill Does
- Scan Codebase - Identify modules, classes, functions, dependencies
- Map Relationships - Imports, inheritance, composition, calls
- Generate Mermaid - Create diagram in requested format
- Output Markdown - Ready to paste into docs or GitHub
Output Format
## Architecture: [Component/Project]
### Overview
Brief description of the architecture.
### Diagram
\`\`\`mermaid
flowchart TD
A[Module A] --> B[Module B]
B --> C[Module C]
A --> C
\`\`\`
### Components
| Component | Purpose | Dependencies |
|-----------|---------|--------------|
| Module A | Does X | None |
| Module B | Does Y | Module A |
### Key Flows
1. **Flow Name**: A -> B -> C (description)
Instructions for Claude
When /arch is invoked:
- Identify scope - Single component or whole project?
- Read code - Use Glob/Grep/Read to understand structure
- Map dependencies - Imports, function calls, class relationships
- Choose diagram type - Pick most appropriate for the code
- Generate Mermaid - Create valid Mermaid syntax
- Add context - Include component table and key flows
- Keep it readable - Limit nodes to ~15-20 per diagram, split if larger