/ceh-codebase-explanation:document-architecturefrom ceh-codebase-explanation
Load this skill when creating or updating ARCHITECTURE.yaml (Mermaid diagrams plus a Key Decisions log), or when a change to the system's shape must be brought back into it. Trigger on "write the architecture doc", "diagram the system", "record this decision", "high-level overview".
Ships in ceh-codebase-explanation. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Maintain one living .agents_workspace/product/ARCHITECTURE.yaml, the always-current picture of the
system, with ARCHITECTURE.md rendered beside it. It opens with a 3-second Overview, then is
mainly Mermaid diagrams, then a Key Decisions log that holds the durable, cross-version
"why". A file whose technical design was settled before the build also holds a Technical
Design section, which this skill leaves as it is. Done when the YAML passes its check, every Mermaid block was rendered and looked at, and
the Markdown is rendered from the last edit.
This is the durable counterpart to the architecture diagram in a plan's design. The plan
visualizes one version's change; ARCHITECTURE.yaml shows the whole current system and the
decision trail behind it. When a plan is built, its lasting Design decisions are copied here as
Key Decisions entries, so a reader gets the reasoning without opening every plan in
.agents_workspace/product/plan/.
uv run --script ${CLAUDE_SKILL_DIR}/scripts/artifact.py check <dir>/ARCHITECTURE.yaml and stop
on exit 1 with its errors. With no file yet, start one as Storage says.planned: true that you bring in line
with the code loses the mark, and the built entry of the same name that it replaces is
deleted.artifact.py with render, and fix the YAML for each error it
lists.planned: true, which only
ceh-build-plan:write-technical-design writes, for a design settled before the build. Never
add the mark here, and remove it when you redraw that diagram from the code.technical_design as written. The section records the choices several features
share, and this skill draws what the code is, so write no entry there, change none, and append no key_decisions entry on a topic an
entry covers. A new file drops the template's technical_design key. When
the code contradicts an entry, say so in the report, and that
ceh-build-plan:write-technical-design changes it.ARCHITECTURE.yaml (architecture/v3),
and ARCHITECTURE.md is rendered from it with its numbers, Contents list and anchors, per
references/architecture-schema.md. Before an edit, run
uv run --script ${CLAUDE_SKILL_DIR}/scripts/artifact.py check <dir>/ARCHITECTURE.yaml and stop
on exit 1 with its errors. After the last edit, run it with render and fix the YAML for each
error it lists. On exit 2 or 3, or without uv, say in the report that the file went unchecked
and unrendered. An ARCHITECTURE.md with no YAML beside it is moved first, as the schema says.A diagram can render without an error and still be unreadable:
A ~~~ B) and give each direction LR, or Mermaid lays
them out in an arbitrary order.gantt chart with axisFormat %b %Y, set tickInterval 2month or wider, or the axis
labels overlap.xychart-beta's height under config.xyChart.height in the diagram's front
matter, or a chart with few bars renders far too tall.npx -p @mermaid-js/mermaid-cli mmdc -i <file>.md -o <out>.md, then look at the rendered
result, because overflowing labels and a diagram scaled down to unreadable text both pass the
CLI.ARCHITECTURE.md opens, after its Contents list, with an ## 01. Overview section a newcomer
absorbs in seconds, before any diagram. It answers "what is this thing?" and nothing else. Two
parts:
## 01. Overview
- Shoppers browse a catalogue and place orders, and staff fulfil them from an admin console.
- The storefront takes the order and the Orders API records it.
- Fulfilment books a carrier and ships it.
```mermaid
flowchart LR
shopper([Shopper]) --> store[Storefront] --> orders[Orders API] --> fulfil[Fulfilment]
```
Orders, Fulfilment — never OrderAggregateService,
and never a framework or database name; those belong in the Components diagram.ARCHITECTURE.md that predates
this section, write the Overview before any other edit — it is the cheapest part to produce and
the part most readers never get past.Include the diagrams that apply; omit ones the system doesn't have. Order them outside-in. System context earns a separate diagram only when the externals are too many to sit legibly on Components. Otherwise draw them on Components, outside the boundary, as the example below does.
| Diagram | Mermaid type | Shows |
|---|---|---|
| System context | flowchart | External actors and systems around the boundary — who/what talks to it |
| Components | flowchart | The expanded Overview — every internal piece and what crosses each connection (rules below) |
| Key flows | sequenceDiagram | 1–3 critical request/lifecycle paths end to end |
| Data model | erDiagram | Core entities and relationships (mirrors the project's own entity rules) |
| State machines | stateDiagram-v2 | Legal status transitions for key entities (mirrors the project's own status rules) |
Components is the Overview with the detail put back — same system, no longer a line. The Overview is a spine by rule; Components branches, fans out, and loops back wherever the real system does. There is no separate "expanded overview" diagram; when you want more than the spine, you want this one:
subgraph. Anything outside it is someone else's
system: you cannot change it, and it fails independently.Orders API · FastAPI). This is the diagram where stack
names belong.subgraph with one edge to the group.flowchart LR
shopper([Shopper]) -->|HTTPS| fe[Storefront · SvelteKit]
subgraph platform [Platform boundary]
fe -->|REST /api| api[Orders API · FastAPI]
api -->|SQL| db[(PostgreSQL)]
api -->|enqueue job| queue[[Job Queue]]
queue --> worker[Fulfilment Worker]
worker -->|SQL| db
end
api -->|charge| stripe([Stripe])
worker -->|book label| carrier([Carrier API])
State-machine diagrams must match the project's own entity and status rules, for example the
ceh-python-service:write-postgresql-code rule that not all transitions are legal — draw only the
legal edges:
stateDiagram-v2
[*] --> active
active --> archived
archived --> active
active --> deleted
archived --> deleted
The durable record of significant architectural decisions — ones that would confuse a future developer without context, or that reversing would require a migration or refactor. This is the single home for decision rationale; record one whenever you choose a framework/runtime/persistence strategy, pick between fundamentally different patterns, plan a major dependency upgrade, or reverse a prior decision in a new version.
Append entries to key_decisions in ARCHITECTURE.yaml, newest last, in the shape of
assets/architecture.template.yaml, per references/architecture-schema.md. The rendered
Markdown shows them as the numbered Key Decisions section at the bottom.
Superseded by <date title>. The trail is the cross-version narrative..agents_workspace/product/ARCHITECTURE.yaml and the ARCHITECTURE.md rendered beside it, in the
target repo, unless the repo's CLAUDE.md names another path. A new file starts as a copy of
assets/architecture.template.yaml, and an older Markdown file is moved to the YAML on the next
update. Later planning reads it, so it never lives in any folder other than
.agents_workspace/product/. .agents_workspace/product/ holds the files the people and agents
building the product read, and docs/ is left to users of the product. When a
.agents_workspace/ARCHITECTURE.md from an earlier version, or an ARCHITECTURE.md at the old
root product/ in a repo whose CLAUDE.md names no location, exists and
.agents_workspace/product/ARCHITECTURE.yaml does not, move it there first and say so.
The whole document stays in the one YAML, so the spine, the diagrams and the decision trail are
readable and greppable in one place.
What SKILL.md sets; muted values are Claude Code's defaults
5 skills in this plugin
/explain-codebaseLoad this skill when a whole repo or knowledge base must be understood and the understanding written to .agents_workspace/CODEBASE_EXPLAINED.md, component by component. Trigger on "explain this codebase", "walk me through this project", "I inherited this repo"./explain-until-understoodLoad this skill when someone in the session must understand a subsystem, design, diff, or tool: explain from zero until they can answer unaided. Trigger on "explain this to me", "I don't understand this diff". Not for a repo-wide file (use ceh-codebase-explanation:explain-codebase)./Other plugins' skills for the same job
npx claudepluginhub cheneeheng/ceh-claude-code-library --plugin ceh-codebase-explanation