-
Check the index at docs/architecture/README.md.
- If the document is listed as planned, pick up its slug and status.
- If it is not listed, add a row to the index first (or update this skill's output to include that change).
-
Create the file at docs/architecture/<slug>.md.
-
Structure the document:
# <Title>
<One-paragraph summary. A reader who reads only this paragraph must be able to say what this document covers and who it is for.>
## Context
<What this subsystem is responsible for, and which ADRs drove its design. One or two paragraphs with ADR links.>
## Design
<The actual how. Subdivide with `###` headings as the topic requires: components, data structures, flows, boundaries.>
### <Component or flow 1>
<Prose description. Include a Mermaid diagram if it clarifies boundaries, flow, or state transitions.>
### <Component or flow 2>
…
## Invariants
<Bulleted list of the invariants this subsystem maintains. These are the claims a reader can rely on and a tester can exercise.>
## Trade-offs
<What this design gives up, and why. This is a design document, not marketing — the downsides must be present.>
## Open questions
<Questions still to be answered. Linked to issues or future ADRs where applicable.>
## References
- ADRs and external literature.
-
Write the summary paragraph carefully. This paragraph is the document's thesis. A reader who skims only the summary should come away with the subsystem's purpose and its place in the system.
-
Use Mermaid for every diagram. Per documentation-style.md:
- Inline fenced code blocks with the
mermaid language tag.
- Preceded by a prose description (accessibility — screen readers depend on this).
- Earn their place: boundary, flow, or state machine, not decoration.
- Keep small (< 15 nodes). Split if larger.
Example:
The IPC send flow crosses three boundaries: syscall entry, endpoint rendezvous, and receiver delivery.
```mermaid
sequenceDiagram
participant S as Sender task
participant K as Kernel
participant R as Receiver task
S->>K: syscall: send(endpoint, msg)
K->>K: check send capability
K->>R: deliver if receiver waiting, else block
R->>K: return after receive
K->>S: return Ok
```
-
Cross-reference ADRs wherever the document makes a claim that rests on a decision. Format: see [ADR-NNNN: Title](../decisions/NNNN-slug.md).
-
Link the glossary on first use of any project-specific term (see [capability](../glossary.md)).
-
Update the index.
- Edit
docs/architecture/README.md — change the document's status column from Planned to Accepted (or Draft if it is a substantial but incomplete pass).
- Update the index description if the document's scope differs from what was planned.
-
Commit per commit-style.md:
- Message:
docs(arch): <subsystem> — e.g. docs(arch): ipc design.
- Body: a sentence or two on what the document covers.
- Trailer:
Refs: ADR-NNNN for each ADR the document reflects.