Generate architecture documentation using arc42 or C4 model. Use for creating system context, container, and component diagrams with narrative.
Create comprehensive architecture documentation for a system or component.
Extract from user input:
arc42, c4, or both (default: c4)context, container, or component (default: container)Explore the codebase to understand:
Use file exploration to gather information:
Based on the format argument:
If format = c4:
c4-documentation skillIf format = arc42:
arc42-documentation skillIf format = both:
Create documentation file(s):
For C4:
docs/architecture/
└── {subject}-c4-{level}.md
For arc42:
docs/architecture/
└── {subject}-arc42.md
For both:
docs/architecture/
├── {subject}-architecture.md # arc42 with embedded C4
└── diagrams/
├── context.mmd
├── container.mmd
└── component.mmd
Every generated document should include:
Header with metadata
Diagrams (Mermaid format)
Narrative
References
/doc-architecture "order service"
→ Generates C4 container diagram for order service
/doc-architecture "payment gateway" format=arc42
→ Generates full arc42 documentation
/doc-architecture "api gateway" format=c4 level=component
→ Generates C4 component diagram
/doc-architecture "entire system" format=both level=context
→ Generates arc42 with embedded C4 context diagram
Generated documentation must: