system-architecture-document skill produces a System Architecture Document (SAD) — the definitive reference for how a software system is organized, why key architectural choices were made, and how the system connects to the world around it. It maps the full structural picture across multiple levels of abstraction using the C4 model and five architectural views, serving onboarding engineers, architects reviewing change impact, security auditors, and operators planning infrastructure changes.
Best for
New system documentation
Existing system archaeology
Compliance and security review
Senior engineer onboarding
What it produces
The skill generates a 10–20 page SAD (excluding appendices) with these major artifacts:- Architecture principles — guiding principles that govern all decisions and act as tie-breakers during trade-offs
- C4 model diagrams — System Context (Level 1), Container (Level 2), and Component (Level 3) in Mermaid
- Process view — sequence diagrams for critical runtime flows including error paths
- Deployment view — infrastructure topology with network tiers, regions, and managed services
- Integration map — every external integration with protocol, auth, error handling, and SLA dependency
- Data flow and trust boundaries — where data crosses trust zones, sensitive data classification
- Security architecture — STRIDE threat model summary, security controls by trust zone, secrets management, network security
- Disaster recovery — RPO/RTO targets, backup strategy, and failover procedure
- Observability architecture — structured logging, metrics, distributed tracing, and alerting severity levels
- Data architecture — schema overview, partitioning strategy, caching strategy, data lifecycle
- API governance — versioning policy, rate limiting tiers, API gateway configuration
- Cost model — monthly infrastructure cost breakdown with 10x and 100x scaling cost curves
- Testing architecture — environment matrix, CI/CD pipeline gates, contract testing
- Development view — code organization, module boundaries, dependency rules
- Architecture Decision Record log — every significant architectural decision with full MADR-format entries
- Known technical debt — deliberate compromises with remediation paths
How to invoke it
Example scenarios
- “Document the system architecture for our payment gateway platform”
- “Create a SAD for our new microservices-based notification system”
- “I need a C4 diagram and architecture overview for our SaaS billing platform”
Key concepts
C4 model — four zoom levels
The C4 model (Simon Brown) provides a hierarchical approach to architecture documentation — like Google Maps with multiple zoom levels. All diagrams are produced in Mermaid for version control.- Level 1: System Context
- Level 2: Container
- Level 3: Component
- Level 4: Code
Diagram model selection
The skill selects the diagramming approach based on team size and system complexity:4+1 view model (Kruchten)
The SAD documents five complementary views of the same architecture:Architecture Decision Records (ADRs) in the SAD
Every significant architectural decision must be recorded as an immutable ADR inline in the SAD. The document includes an ADR log summary table plus full MADR-format entries for each decision. ADR states follow the lifecycle:Proposed → Accepted → Deprecated → Superseded by ADR-XXX
Each inline ADR captures: context, decision, alternatives considered (with pros/cons and rejection reason), and consequences (positive and negative).
For standalone ADRs created outside the SAD, see the architecture-decision-record skill.
Security architecture
The SAD includes a dedicated security section with:- STRIDE threat model summary — key threat categories (Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, Elevation of Privilege) mapped to architectural controls
- Security controls by trust zone — external (WAF, TLS termination), DMZ (auth enforcement, CORS), internal (service-to-service auth, parameterized queries), data (encryption at rest, access logging)
- Secrets management — how secrets are stored, rotated, and accessed (never in code or config files)
- Sensitive data classification — Restricted, Confidential, Internal, Public with storage and transmission requirements per category
Observability architecture
The SAD specifies the full observability stack before implementation:- Logging — structured JSON format, correlation IDs, log levels, aggregation pipeline, retention
- Metrics — request rate, error rate, latency percentiles (p50/p95/p99), queue depth, DB connection pool utilization
- Distributed tracing — W3C Trace Context or B3 propagation, sampling rate, trace storage
- Alerting — severity levels P1 (Critical) through P4 (Info) with response time targets and escalation paths
Interview process
Context loading
.engineering-docs/ files. Extracts tech stack, team structure, existing constraints, and NFR targets from prior documents without re-asking.Socratic clarification (max 2–3 questions)
System context (60 min)
Container architecture (2 hrs)
Component architecture (2–4 hrs)
Deployment view (90 min)
Integration and data flow (60 min)
NFR and quality attributes (60 min)
ADR log (60 min per ADR)
Output structure
Executive Summary
Executive Summary
Architecture Principles
Architecture Principles
C4 Level 1: System Context
C4 Level 1: System Context
C4 Level 2: Container Architecture
C4 Level 2: Container Architecture
C4 Level 3: Component Architecture
C4 Level 3: Component Architecture
Deployment View
Deployment View
Process View — Key Flows
Process View — Key Flows
Integration Map
Integration Map
Data Flow and Trust Boundaries
Data Flow and Trust Boundaries
Security Architecture
Security Architecture
Disaster Recovery
Disaster Recovery
Observability Architecture
Observability Architecture
Data Architecture
Data Architecture
API Governance
API Governance
Cost Model
Cost Model
Testing Architecture
Testing Architecture
Development View
Development View
Architecture Decision Record Log
Architecture Decision Record Log
architecture-decision-record skill for decisions created ad-hoc.Quality Attribute Requirements
Quality Attribute Requirements
Alternatives Considered
Alternatives Considered
Known Technical Debt
Known Technical Debt
Handoff
Reads from:technical-specification— functional and non-functional requirements that drive architectural decisionstechnical-feasibility-study— technology constraints, integration feasibility, risk mitigations2-project-plan— delivery timeline, team structure, dependenciesux-flow-specification— frontend component structure and API interaction points
- Implementation — architectural structure guiding code organization and module boundaries
infrastructure-specification— deployment topology, scaling strategy, monitoring needs- Security review — trust boundaries, data flow, and threat model foundation
Quality gate
Before marking the documentfinal, verify:
- C4 diagrams exist at Level 1 (System Context) and Level 2 (Container), with Level 3 (Component) for critical containers
- The Alternatives Considered table documents at least two rejected alternatives with specific, evidence-based reasoning
- Trust boundaries and data flow are explicitly mapped with sensitive data classification
- Every significant architectural decision has a corresponding ADR in the log
- Non-functional requirements have measurable targets linked to architectural decisions
