Write architecture docs for humans first.
Use this skill to produce docs that help a person quickly understand:
- what the main parts of the system are
- how they connect
- how requests, jobs, or data move through the system
- where important boundaries and responsibilities sit
Keep architecture docs visual-first and simple.
Core rules
- Put canonical architecture docs in
docs/architecture/unless the repo has an explicit local exception. - Write for fast human understanding, not exhaustive implementation detail.
- Start with a short plain-English explanation.
- Prefer a simple Mermaid
flowchart TDdiagram near the top. - Keep diagrams high-level and readable.
- Prefer progressive disclosure when one diagram would mix too many levels or concerns. Start with the simplest useful overview, then add Level 2 / Level 3 zoom-ins instead of forcing one dense figure.
- Push exact field names, env vars, limits, commands, schemas, and operational contracts into
docs/references/. - If repo-local docs guidance conflicts with this skill, follow the repo-local docs contract.
Workflow
-
Read the repo-local docs contract first. In particular: root
AGENTS.md,docs/AGENTS.md, and the relevant existingdocs/architecture/*pages. -
Decide whether the requested doc is really architecture. If it is mainly about system shape, boundaries, flow, or major tradeoffs, keep it in
docs/architecture/. If it is mainly about exact facts or lookup rules, put it indocs/references/instead. Readreferences/02-architecture-vs-references.mdwhen unsure. -
Collect only the minimum context needed to explain the system. Focus on major components, boundaries, and flows. Avoid dumping low-level implementation details into the architecture doc.
-
Draft the doc in this order:
- short plain-English overview
- Mermaid
flowchart TD - short section explaining the main flow or boundaries
- short notes on tradeoffs or important constraints if needed
- for broader systems, use a Level 1 / Level 2 / Level 3 structure so each diagram explains one idea
-
Keep the diagram simple. Use a few meaningful nodes and connections, not every internal detail. Keep container labels passive: arrows should connect real components, not the block titles. Use consistent zone coloring only when it materially improves scanability. Read
references/01-mermaid-guidelines.mdbefore writing or refactoring diagrams. -
Keep the document easy to skim. Use short sections, direct wording, and minimal jargon. If the target renderer is available, verify the actual render and refine from what a human will really see.
-
If exact facts are needed, create or update a companion doc in
docs/references/and link it.
Default doc shape
Use this default structure unless the repo already has a strong local pattern:
- Title
- 2-4 sentence overview in plain English
- Mermaid
flowchart TD - Main parts / boundaries
- Main flow
- Key tradeoffs or notes
- Links to deeper references if needed
Read references/00-doc-shape.md for the fuller template.
When to keep it high-level
Architecture docs should answer:
- "What are the main parts?"
- "How do they connect?"
- "Where does this responsibility live?"
- "How does the system basically work?"
Architecture docs should usually not answer:
- every field name
- every API parameter
- exact env var lists
- every cache key or schema detail
- step-by-step operational runbooks
Those belong in docs/references/.
Related skills
- Use
$pretty-mermaidif you need to render, theme, or iterate on Mermaid output more deeply. - Use
$agent-native-repo-playbookwhen the user is deciding the repo-wide docs contract or AGENTS/docs policy.