Constructdocs
section · guides

Doc Visual Matrix

2 min read·guides / concepts / doc-visual-matrix

Document structure and visual matrix

A document that exists only as prose hides its decision logic, its timeline, and its interactions. Each document type below names the structure it must carry and the visual that makes it legible. The Enforced column marks what lib/templates/visual-requirements.mjs checks today; the rest are recommended and will be promoted to enforced as the templates gain scaffolding.

Modern practice is consistent on two points: a diagram should show the happy path and at least one error path, and diagrams belong in version control next to the text they describe — which is why every visual here is Mermaid, not an image. See Mermaid in technical documentation and version-controlled architecture diagrams.

Doc typeRequired visualMermaid kind / tableRationaleEnforced
runbookDiagnostic decision treeflowchartA troubleshooting flowchart lets an operator branch to a fix faster than ordered prose. srcyes
incident-reportEvent timelinetable Time (UTC) | Event (or timeline)A timeline reconstructs detection→mitigation→all-clear at a glance. srcyes
rfcProposed-behavior sequencesequenceDiagramA sequence diagram makes interactions explicit and cuts "what about this edge case?" review churn; include an error path. srcyes
adrContext / decision diagramflowchart or graphShows how the decision sits among components and alternatives.recommended
prd / prd-platformUser flow + metrics tableflowchart + tableA flow makes the user journey concrete; a metrics table pins success criteria.recommended
architecture / conceptsComponent or C4 diagramflowchart / C4ContextPairs a structural view with the common user flow. srcrecommended
strategyRoadmap or bet matrixtimeline / tableSequences bets and time horizons.recommended
test-planCoverage / flow matrixtableMaps scenarios to what they verify.recommended

How enforcement works

Each enforced row is a postcondition (artifact-has-mermaid by kind, or artifact-table-has-columns) in lib/templates/visual-requirements.mjs, evaluated by the same validateArtifactPostconditions engine that checks contract handoffs. The shipped template for each enforced type carries the visual as scaffolding, and tests/template-visuals.test.mjs fails if a template ever drops it — so the matrix and the templates cannot diverge.

References