C4 Architecture Diagrams
Generate C4 architecture diagrams using Mermaid syntax.
Default Behavior
- •Always generate: Context (L1) and Container (L2) diagrams
- •Only on request: Component (L3) - user must explicitly ask
- •Output format: Mermaid C4 syntax in markdown code blocks
- •Write to:
scratch/plans/orscratch/context/depending on purpose
Process
- •Analyze the code path or feature requested
- •Identify system boundaries, external actors, containers
- •Generate Context diagram (L1) - system and external dependencies
- •Generate Container diagram (L2) - internal structure
- •Skip Component (L3) unless explicitly requested
Output Structure
markdown
# [Feature/System] Architecture ## Context Diagram (L1) [mermaid block] Brief description of external interactions. ## Container Diagram (L2) [mermaid block] Brief description of internal structure.
Templates
Reference @templates/context.md and @templates/container.md for Mermaid C4 syntax.
Rules
- •Keep descriptions concise (1-2 sentences per diagram)
- •Use snake_case for IDs in mermaid
- •Label all relationships with action verbs
- •Include external systems and actors
- •Write output to scratch/ per workspace rules