← Docs home
diagram-design
  1. Overview
  2. How it works
  3. Types
  4. Gallery
  5. Commands
  6. Anti-patterns
  7. Findings
  8. Build your own
  9. Sources
Skill explainer · cathrynlavery/diagram-design

Diagram Design

Forty-five editorial diagram types, one rule above all: delete until nothing can be removed.

A Claude/Cursor skill that writes self-contained HTML with inline SVG in a skinnable editorial system. It routes a request through 9 semantic patterns to 45 type references, ships importers for draw.io, Excalidraw and Mermaid, and backs its charts with geometry verifiers. I read the skill, ran all 74 repository checks and the 6 shipped scripts. The highest-quality move is usually deletion.

v2.6.119plugin version
7a12007commit, 21 Oct 2026
45visual types
6commands
6skill scripts
74/74repo checks pass

Who it is for

Anyone who wants a diagram that looks designed rather than generated: architecture, charts, journeys, maps.

What you get

One HTML file per diagram, optional SVG/PNG export, and a brand profile you can save and reload.

How It Works

It Picks A Pattern, Then A Type, Then Asks

The skill is a router. Behavior picks the pattern, the pattern picks the nearest layout, and the plan is confirmed before anything is drawn.

1

Style gate. If they are still the shipped defaults (paper #f5f5f5, ink #2d3142, accent #bf4520), pause and ask the user.

2

Semantic pattern. When behavior, state, enforcement, or risk carries the meaning, first load semantic-patterns.md.

3

Visual type. Always load the chosen type reference linked in the guide before drawing.

4

Confirm. Before rendering, state the plan in one short message: the chosen visual type (and semantic pattern, if routed), the size preset, and anything the complexity budget (§7) will force out.

5

Density. Target density: 4/10. Enough to be technically complete. Not so dense it needs a guide. Above 9 nodes, it's probably two diagrams.

The 9 Semantic Patterns

Behavioral triggerPatternNearest type
Fan-in, queue depth, finite capacity, bottleneckFan-in queue / bottleneckData flow
Repeated Question / Input / Governance / Output slots across stagesStage framework with semantic slotsProcess
Conversation or loose input becomes a structured durable artifactUnstructured input → structured artifactData flow
Two rule traces need pass/fail/skipped/not-reached and first divergencePaired policy-evaluation tracesFlowchart
Trust boundaries plus permitted/forbidden ingress or deploy pathsSecure paved roadArchitecture
Controls grouped by where they are enforcedGovernance / control catalogLayer stack
Defenses compensate for prior gaps and residual risk propagatesCompensating security layersLayer stack
Hierarchical, ID-addressable decomposition needing per-block I/O, constraints, and a code linkTraceable block decompositionTree
One subject progresses through phases, waits, retries, cancellation, and terminal outcomesLifecycle phase mapState Machine
The Types

Every Type Is A Reference File With Rules And Anti-Patterns

Pick a type. The tag is the row from the SKILL.md §3 guide; How it works lists the reference file’s layout conventions; the quotes are its own anti-patterns, all checked at build time.

Commands And Scripts

Importers Parse; The Skill Redraws

Six slash commands drive the workflow. Six stdlib-first scripts do the deterministic work, and I ran each one.

Taste

It Names The Slop It Refuses To Make

The universal anti-patterns from SKILL.md §4, verbatim.

Anti-patternWhy it fails
Dark mode + cyan/purple glowLooks "technical" without design decisions
JetBrains Mono as blanket "dev" fontMono is for technical content — ports, commands, URLs. Names go in Geist sans.
Identical boxes for every nodeErases hierarchy
Legend floating inside the diagram areaCollides with nodes
Arrow labels with no masking rectBleeds through the line
Vertical writing-mode text on arrowsUnreadable
3 equal-width summary cards as defaultGeneric grid — vary widths
Shadow on any elementShadows are out. Borders are in.
rounded-2xl on boxesMax radius 6–10px or none
Coral on every "important" nodeCoral is 1–2 editorial accents, not a signaling system
Reproducing Mermaid's renderer layoutImports automatic spacing and routing instead of making an editorial layout
Any breach of the six §6 connector rulesAutomatic fail: diagonal slants, labels touching their stroke, masks clipped by a later node, overlapping paths, shared attach points, transit behind a non-endpoint box
What I Found Running It

The Code Is Solid; The Runner Is Inconsistent

I ran 74 repository checks (every scripts/test-*.py and verify-*.py) plus the 6 skill scripts on the box, with nice and timeout, at commit 7a12007.

RunResultNote
74 repo checks, first pass59 pass, 15 fail12 verifiers exit 2 when given no paths; 3 Playwright tests fail before Chromium is installed.
Same 15, rerun correctly15/15 passAfter playwright install chromium and adding --all (or --shipped for verify-motion).
self_check.py over 217 assets215 OK, 2 FAILicons.html and index.html are galleries, not diagrams; exit code 1 for the batch.
3 extractors on fixturespassdraw.io: 12 nodes / 8 edges, node budget flagged OVER (max 9).
export_svg / export_pngpass9 KB SVG and 38 KB PNG from example-waterfall.html.
git status after all runscleanNo files written into the repo.

Gap Verifier flags disagree

Most verifiers take --all; verify-motion takes --shipped and rejects --all. Without a flag they print usage and exit 2, which reads like a failure in CI.

Gap Playwright is a silent prerequisite

Three tests and PNG export need a downloaded Chromium. The export command documents this; the test scripts just crash with a stack trace.

Gap Version drift

plugin.json says 2.6.119; SKILL.md metadata says 2.6.

Bug Escaped IR headers

drawio_extract and excalidraw_extract print the file name markdown-escaped (sample\-architecture\.drawio); mermaid_extract does not.

Copy Untrusted-input stance in parsers

The Excalidraw and Mermaid extractors treat labels as data and discard links and payloads. That is the right default for anything an agent reads.

Copy Verifiers for the chart math

Waterfall, Sankey, beeswarm and others check the rendered geometry against declared values, so a plausible-but-wrong chart fails.

Build Your Own

What To Steal

  1. One reference file per output type. Each has Best for, layout rules and anti-patterns. The agent loads only the one it needs.

  2. Route by meaning before layout. A semantic pattern picks the behavior; the type picks geometry.

  3. Gate on brand tokens. Refuse to ship defaults into a branded project without asking.

  4. Confirm the plan in one message. Type, size and what the budget cuts, before drawing.

  5. Ship the checker. self_check.py lets the agent verify its own file.

Sources

Everything Here Is Checked

Each quote on this page is compared with its source file at build time; the build fails on any mismatch.

  1. skills/diagram-design/SKILL.md
  2. skills/diagram-design/references/semantic-patterns.md
  3. commands/export-diagram.md
  4. .claude-plugin/plugin.json
  5. github.com/cathrynlavery/diagram-design