/diagram-skills:diagram-reviewfrom Diagram Skills
Validate and critique Mermaid diagrams in Markdown docs, ADRs, READMEs, PR descriptions or a reply. Checks that each diagram parses under the Mermaid version GitHub renders, follows the accessible profile (accTitle/accDescr, quoted labels, legend, colour never the only signal), stays within the reader's node cap, and is true - every node traced to a real file, Quest record or lore doc, with prose that says what the picture shows. Use this skill whenever someone asks to check, review, lint, validate, fix or audit a diagram, when a Mermaid diagram fails to render on GitHub, when a docs PR adds or changes diagrams, or before publishing any diagram another diagram-* skill drew, even if they only say "does this look right". Also owns the shared engine and references the other diagram skills use. To draw a new diagram, use diagram-architecture, diagram-process, diagram-decision, diagram-plan or diagram-data instead.
Ships in Diagram Skills. 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.
Checks diagrams the way a careful reviewer would. The first two questions are cheap and mechanical: does it render, and does it follow the rules? The third is the one that matters: is it true? The other five diagram skills draw; this one judges, and it owns the engine they all call.
| Skill | Draws |
|---|---|
| diagram-architecture | C4 context, container and component views |
| diagram-process | Flows, lanes, sequences and state machines |
| diagram-decision | ADR and Quest decision diagrams |
| diagram-plan | Quest dependency and milestone views |
| diagram-data | ER and schema diagrams |
<engine> below is ${CLAUDE_SKILL_DIR}/scripts. Sibling skills reach it at
${CLAUDE_SKILL_DIR}/../diagram-review/scripts.
Take the files the user names. With none named, take the Markdown files
changed on the branch (git diff --name-only origin/dev...HEAD -- '*.md'), or
ask. A diagram pasted into chat goes into a scratch .md file with the prose
around it.
Set up once with npm ci --prefix <engine> --no-audit --no-fund. Then:
node <engine>/mermaid-check.mjs <paths>
python3 <engine>/diagram_lint.py <paths> [--level beginner|intermediate|advanced]
python3 <engine>/diagram_truth.py --root <repo root> <paths>
Exit 2 from the parse check is an install problem, not a verdict. Fix the
install or report that the parse check could not run; never call an
unchecked diagram valid. references/checks.md explains every exit code and
rule.
The scripts cannot judge everything. For each diagram, answer:
references/truth.md,
section 4. Every component the explanation names is drawn, every
relationship it claims has an edge in the right direction, and every
count matches.%% ref proves the node exists, not that the
edge is right. Spot-check the two or three edges the claim depends on
against the code or records.references/levels.md)?ext: ref. Each should be a person
or a system outside the repository.Lead with the verdict per diagram: pass, fix or redraw. Then list
the findings, most serious first: false before broken, broken before
unclear. Each finding names the location (file:line), what is wrong, and
the exact fix. Quote the corrected Mermaid lines for syntax and labelling
fixes. Keep it at the user's level; a beginner gets the verdict and the one
fix that matters, not the rule names.
Change only what the findings name, then re-run all three checks and show
that they pass. A diagram that cannot be traced to a source gets its
invented nodes removed, or named in the prose as assumptions. It does not
get an ext: ref to make the check pass.
.github/workflows/ci.yml runs the parse check over docs/ and skills/,
self-tests the gate (tests/mermaid_selftest.sh proves broken diagrams fail
and fixed ones pass), lints, and runs lore check. lore check never looks
inside a Mermaid fence, so this gate is the only one on diagram syntax.
Diagrams stay as Mermaid source by default. GitHub and the IDEs render it,
and source diffs cleanly. When the user needs a picture file for slides,
email or Confluence, use <engine>/diagram_export.py:
python3 <engine>/diagram_export.py install # prints the cost (~650 MB); installs nothing
python3 <engine>/diagram_export.py install --yes # only after the user agrees to that cost
python3 <engine>/diagram_export.py export --format svg|png|both --out <dir> <files>
python3 <engine>/diagram_export.py uninstall # removes its cache directory, nothing else
Every diagram is parse-checked before rendering, and a failure is refused.
Every SVG is also inspected, because mmdc can exit 0 while writing an
image that only says "Syntax error". Renders happen locally; never send a
diagram to an online render service unless the user explicitly asks,
because that publishes its content. Exit 1 means at least one diagram was
refused or failed. Report which ones; never present a partial export as
complete.
references/checks.md: the three checks, exit codes, repair loop and limits.references/mermaid-profile.md: allowed types, parse traps, safe templates, comment conventions.references/accessibility.md: accTitle/accDescr, colour and legends, the measured palette.references/levels.md: beginner, intermediate and advanced caps and explanations.references/truth.md: reading the source, %% ref kinds, the prose-agreement checklist.references/persisting.md: where diagrams live in lore and how they link to Quest.scripts/: mermaid-check.mjs, diagram_lint.py, diagram_truth.py, the generators quest_graph.py, schema_er.py, repo_inventory.py, and the opt-in diagram_export.py.examples/review-of-a-flawed-diagram.md (opens in a new tab)references/accessibility.md (opens in a new tab)references/checks.md (opens in a new tab)references/levels.md (opens in a new tab)references/mermaid-profile.md (opens in a new tab)references/persisting.md (opens in a new tab)references/truth.md (opens in a new tab)scripts/diagram_export.py (opens in a new tab)scripts/diagram_lint.py (opens in a new tab)scripts/diagram_truth.py (opens in a new tab)scripts/mermaid-check.mjs (opens in a new tab)scripts/package-lock.json (opens in a new tab)scripts/package.json (opens in a new tab)scripts/quest_graph.py (opens in a new tab)scripts/repo_inventory.py (opens in a new tab)scripts/schema_er.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
diagram-skills@opum is listed by opum-ai/opum-marketplace — review the source before installing
npx claudepluginhub opum-ai/opum-marketplace --plugin diagram-skills6 skills in this plugin
/diagram-architectureExplain and diagram a software system's architecture as C4 views - system context, containers, components - drawn from the actual repository, manifests, compose files and lore docs, never from a generic template. Produces a Mermaid diagram plus a plain-English explanation pitched to the reader (beginner, intermediate or advanced), with every box traced to a real path. Use this skill whenever someone asks how a system or repo is structured, what talks to what, for an architecture overview or C4 diagram, to onboard someone to a codebase, to document services for an arc42 or lore reference doc, or says "draw the architecture", "show me the big picture" or "what are the moving parts" - even if they never say C4 or diagram. For step-by-step flows or lifecycles use diagram-process; for database tables use diagram-data; for task plans use diagram-plan./diagram-dataExplain and diagram the shape of an application's data - tables, entities, keys and the relationships between them - as a Mermaid ER or class diagram generated or traced from the real schema (SQL migrations and DDL, Prisma, Django, SQLAlchemy, ActiveRecord or TypeScript models), with cardinality read from the schema rather than guessed, and a plain-English explanation at the reader's level. Use this skill whenever someone asks what the data model or database schema looks like, how tables or entities relate, what an order or user record holds, for an ER diagram, entity-relationship or schema diagram, a class diagram of domain models, or wants to document the data layer for onboarding or a spec - even if they only say "what do we store". For services and infrastructure use diagram-architecture; for how records change state use diagram-process.