Architecture Diagrams
The/arckit.diagram command generates architecture diagrams using Mermaid or PlantUML C4 syntax for visual documentation. Diagrams integrate with ArcKit’s governance workflow and provide clear, traceable visual documentation.
What are Architecture Diagrams?
Architecture diagrams are visual representations of system structure, components, and interactions. They help:- Communicate: Complex architectures to stakeholders
- Validate: Designs against requirements and principles
- Document: Technical decisions and rationale
- Trace: Requirements through design components
Diagram Types
C4 Context Diagram (Level 1)
Purpose: Show system in context with users and external systems When to Use:- Starting a new project (after requirements phase)
- Stakeholder communication (non-technical audience)
- Understanding system boundaries
- No detailed technical design yet
C4 Container Diagram (Level 2)
Purpose: Show technical containers and technology choices When to Use:- After HLD phase
- Reviewing vendor proposals
- Understanding technical architecture
- Technology selection decisions
Deployment Diagram
Purpose: Show infrastructure topology and cloud resources When to Use:- Cloud-first compliance (TCoP Point 5)
- Infrastructure planning
- Security zone design
- DevOps / SRE discussions
Sequence Diagram
Purpose: Show API interactions and request/response flows When to Use:- API design and review
- Integration requirements (INT)
- Understanding interaction patterns
- Error handling flows
Usage
Basic Command
With Diagram Type
Output Format Selection
The command will ask you to choose:- Diagram type: Context, Container, Deployment, Sequence
- Output format: Mermaid (recommended) or PlantUML
- Renders in GitHub, VS Code, mermaid.live
- Best for diagrams with 12 or fewer elements
- Directional layout hints and richer styling
- Best for complex diagrams
- Renders in PlantUML server, VS Code extension
Viewing Diagrams
Mermaid Diagrams
- GitHub markdown: Renders automatically
- Online: Paste code into mermaid.live
- VS Code: Install Mermaid Preview extension
PlantUML Diagrams
- Online: PlantUML Server
- VS Code: Install PlantUML extension (jebbs.plantuml)
- CLI:
java -jar plantuml.jar diagram.puml
Integration with ArcKit Workflow
After Requirements Phase
After HLD Approval
Best Practices
Element Count Thresholds
| Diagram Type | Max Elements | Split Strategy |
|---|---|---|
| C4 Context | 10 | Split by domain boundary or system group |
| C4 Container | 15 | Split by deployment unit or bounded context |
| Deployment | 15 | Split by cloud region or availability zone |
| Sequence | 8 lifelines | Split by phase (setup, processing, teardown) |
Quality Criteria
- Edge crossings: Fewer than 5 for complex diagrams, 0 for simple
- Visual hierarchy: System boundary is most prominent
- Grouping: Related elements are proximate
- Flow direction: Consistent left-to-right or top-to-bottom
- Traceability: Each line can be followed from source to target
- Abstraction level: One C4 level per diagram
Strategic Context
For each component, annotate with: From Wardley Map (if available):- Evolution stage: [Genesis 0.15], [Custom 0.42], [Product 0.70], [Commodity 0.95]
- Build/Buy decision: BUILD, BUY, USE, REUSE
- NFR targets: “10K TPS”, “99.99% availability”, “Sub-200ms response”
- Compliance: “PCI-DSS Level 1”, “UK GDPR”, “WCAG 2.2 AA”
- GOV.UK services: “GOV.UK Notify”, “GOV.UK Pay”, “GOV.UK Design System”
- TCoP compliance: “Cloud First (AWS)”, “Open Source (PostgreSQL)“
Output File Format
Diagrams are saved to:projects/001-payment-gateway/diagrams/ARC-001-DIAG-001-v1.0.md
Related Commands
/arckit.wardley- Strategic positioning with Wardley Maps/arckit.hld-review- High-Level Design validation/arckit.dld-review- Detailed Design validation/arckit.requirements- Define requirements first/arckit.traceability- Map diagrams to requirements