Skip to main content

ADR 006: Use C4 Model for Architecture Documentation

Status

Accepted

Context

Architecture diagrams need to communicate at multiple levels of abstraction:

  • System context (Level 1)
  • Container level (Level 2)
  • Component level (Level 3)
  • Code level (Level 4 - optional)

Decision

Use the C4 Model methodology for all architecture documentation.

Consequences

Positive

  • Hierarchical abstraction levels
  • Clear stakeholder communication
  • Tool-agnostic (can use Structurizr, Mermaid, PlantUML)
  • Industry standard
  • Forces clear thinking about boundaries

Negative

  • Requires learning C4 notation
  • Can be verbose for simple systems
  • Multiple diagrams needed for full picture

C4 Levels

C1: System Context

C2: Container Level

C3: Component Level

(Detailed in TDD)

Mapping to Artifacts

C4 LevelArtifactAudience
C1 - ContextSDD Section 2Business stakeholders
C2 - ContainerSDD Section 3, TDD Section 5Architects
C3 - ComponentTDD Section 4Developers
C4 - CodeSource codeDevelopers

Alternatives Considered

AlternativeProsCons
UMLStandardComplex, verbose
ArchiMateEnterprise focusHeavyweight
Custom diagramsFlexibleInconsistent
No diagramsSimplePoor communication

Implementation

Use Mermaid for C4 diagrams (native GitHub support):

```mermaid
C4Context
title System Context Diagram

Person(user, "User", "Video content creator")
System(pipeline, "Pipeline", "Video-to-Knowledge")
System_Ext(youtube, "YouTube", "Video platform")

Rel(user, pipeline, "Submits URL")
Rel(pipeline, youtube, "Downloads")

## Notes
Generate all 3 levels (C1, C2, C3) for every artifact set. C4 is optional for simple components.