diagram-design
Skill2 starsChanged 3 months agoMITView on GitHub
Design editorial-quality diagrams as self-contained inline SVG — architecture diagrams, flows, sequences, state machines, data models, timelines, layer stacks, quadrants, comparisons, and system maps. Use when explaining how a system is arranged, how a process moves, how components depend on each other, or how options compare; when a Mermaid or draw.io diagram needs to be converted into a document's design system; or when an existing diagram looks auto-generated and needs editorial judgment. Do not use for quantitative charts of measured data (use chart-design), for the surrounding report structure (use analytical-document-design), for UI mockups or wireframes, or for producing editable .drawio files.
15 other projects use a version of this.
Adopted by
Most recently taken up by
- tsukhani/jclawtheir own version, first seen Oct 5, 2026
- baekenough/oh-my-customcodetheir own version, first seen Oct 3, 2026
- cathrynlavery/diagram-designtheir own version, first seen Oct 1, 2026
- productionx-in/Core-Skillstheir own version, first seen Sep 29, 2026
- SanHsien/diagram-designtheir own version, first seen Sep 27, 2026
- stritar/skillstheir own version, first seen Sep 11, 2026
Used with
Projects with it also use grilling, agent-browser and 2 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
AWSSkillgrilling
Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
Also in 4 projects that use this
VercelSkillagent-browser
Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.
Also in 3 projects that use this
VercelSkillweb-design-guidelines
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
Also in 3 projects that use this
StrayDragonSkillui-ux-pro-max
UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient.
Also in 3 projects that use this
Other versions15 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 15
- cathrynlavery/diagram-design★ 43ksame name
- kdlbs/kandev★ 899same name
- mxyhi/ok-skills★ 492same name
- chenjackle45/html-visualizer★ 91same name
- baekenough/oh-my-customcode★ 43same name
- Fioooooooo/FylloCode★ 28same name
- tsukhani/jclaw★ 19same name
- drafael/coding-harness★ 1same name
- ElyzeSolutions/skills★ 1same name
- hmu332233/skills★ 1same name
5 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- analytical-document-designSkill
- brand-theme-designSkill
- chart-designSkill
- presentation-designSkill
- writing-documentsSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 14 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
If the answer is "nothing," write the prose.
- Distinctive: line 41
If the answer is "several of these," the diagram is doing too much.
“Common” is measured: kept by at least 6 in 10 of the 14 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Diagram Design
A diagram earns its place when the arrangement itself carries meaning that a sentence or a list cannot carry as fast.
That is the whole test. Boxes-and-arrows restating a numbered list is slower than the list. A flowchart of a linear three-step process is worse than three sentences. Before drawing anything, say what the reader will understand from the shape that they would not get from the prose.
If the answer is "nothing," write the prose.
The standard
The highest-quality move is usually deletion. Every node earns its place. Target density around 4/10 — a diagram that fills its frame is almost always doing too much.
The accent color is reserved for the one or two things the reader should look at first. Everything else is ink and hairlines.
(This standard is adapted from cathrynlavery/diagram-design, MIT. See Credits.)
Choosing a form
Match the form to the relationship being shown, not to the data you happen to have.
| The reader needs to understand | Form |
| How parts are arranged and what talks to what | Architecture / system map |
| How something moves through steps, with branches | Flow |
| Who calls whom, in what order, over time | Sequence |
| What states exist and what transitions between them | State machine |
| How entities relate and what they hold | Data model |
| What happened when, and in what order | Timeline |
| How responsibility is divided across actors | Swimlane |
| How options compare on two independent axes | Quadrant |
| What sits on top of what | Layer stack |
| How something narrows or concentrates | Funnel |
| How sets overlap | Venn |
| How one thing decomposes into parts | Tree / nested |
If the answer is "several of these," the diagram is doing too much. Split it. Two clear diagrams beat one complete one — a reader who has to decode a diagram has already lost the time the diagram was meant to save.
For per-form construction rules — what to label, where to place the accent, how to handle overflow — read references/diagram-families.md.
Output
Inline SVG in the document. Not a linked image, not a canvas, not a client-side renderer.
Inline SVG is the only form that scales into print without blurring, inherits the document's tokens, stays selectable and searchable, and survives being emailed as a single file.
Every diagram:
<svg role="img" aria-labelledby="dg-ingest-title dg-ingest-desc" viewBox="0 0 720 380">
<title id="dg-ingest-title">Ingestion path</title>
<desc id="dg-ingest-desc">Events enter through the gateway, buffer in the queue, and land in the warehouse. The queue is the only component without a failover.</desc>
...
</svg><title> first, unique IDs prefixed with the diagram's slug, and a viewBox on every SVG. The <desc> states what the arrangement shows — including the thing the accent is pointing at. See core/a11y.md.
Inline or <img> changes the rules
An SVG referenced through <img src="…"> — a README banner, an email, an embed on a site you do not control — renders as an isolated document. The host page's custom properties never reach it, so fill="var(--accent)" resolves to nothing and the shape disappears.
| Destination | Colors | Theming |
| Inline in the document | var(--…) references | Follows the document's data-theme |
<img>, email, external embed | Literal values | Self-contained; use @media (prefers-color-scheme: dark) inside the SVG's own <style> |
Decide the destination before drawing, because it is not a cosmetic difference — the same file cannot do both. assets/banner.svg is the worked example of the second case.
Visual rules
The token contract is in core/tokens.md and applies in full. Diagram-specific rules:
- One accent. Reserved for the one or two elements the reader should see first — the bottleneck, the boundary, the thing that changed. An accent on every node is the same as no accent.
- Hairlines. 1px strokes,
var(--rule)for structure andvar(--rule-strong)for boundaries. Thick borders read as UI chrome. - No shadows, no gradients, no glow. Depth comes from grouping and whitespace.
- Everything on a 4px grid. Positions, sizes, gaps. Off-grid geometry is the single most reliable tell of an auto-generated diagram.
- Three type roles.
var(--display)for the diagram title,var(--sans)for node labels,var(--mono)for technical identifiers, ports, and versions. Nothing else. - Label every edge that isn't obvious. An unlabelled arrow means "leads to," and nothing else. If it means "on failure," "async," or "read-only," say so.
- Direction is a decision. Left-to-right for process and time. Top-to-bottom for hierarchy and layers. Do not mix within one diagram.
- No orphan nodes. Anything unconnected either needs an edge or does not belong.
Full geometry, node, edge, and callout specifications are in references/primitives.md.
Mermaid is an input, not an output
Mermaid is a good notation. Its default rendering is not — stock output brings its own fonts, its own colors, and its own spacing, none of which know about the document they land in. Shipping that into a designed document is visible immediately.
So: accept Mermaid as a source, convert it to a themed SVG, ship the SVG.
| Source | Path |
| Sequence, state, class, ER, flowchart where auto-layout is honest | scripts/render_diagram.mjs — renders via beautiful-mermaid into an SVG whose colors are var(--…) references, so it inherits the document's theme with zero JavaScript |
| Architecture, quadrant, layer stack, timeline, comparison — anything where position carries meaning | Hand-author from templates/diagram.svg. Auto-layout does not know that "closer" means "coupled," so it will destroy the point of the diagram |
Existing .mmd, .drawio, or a diagram in a doc | Convert, then apply the rules above — do not embed as-is |
The rule underneath: auto-layout is acceptable when the arrangement is arbitrary, and unacceptable when the arrangement is the message.
See references/mermaid-bridge.md for the renderer, its theme bridge, and its coverage limits.
Sizing and audience
Two dials worth setting deliberately, because they change what belongs in the diagram:
Size — doc-inline (fits a text column, ~720px wide), full-width (~1100px), print-portrait, print-landscape. A diagram drawn for full width and dropped into a text column becomes unreadable rather than smaller.
Audience — an engineer diagram can name protocols, ports, and versions; an executive diagram cannot, and showing them is not rigor, it is noise. When both audiences need it, make two diagrams from the same model rather than one that half-serves each.
Before delivering
- The arrangement carries meaning prose could not carry as fast.
- Every node earns its place; nothing is there for symmetry.
- The accent marks one or two things, not a category.
- Every non-obvious edge is labelled.
- Geometry sits on the 4px grid.
viewBox,<title>first,<desc>, unique IDs.- Legible in grayscale and at print width.
- No color-only encoding.
- No shadows, gradients, or glow.
- Renders correctly at the intended size, not just at authoring size.
Paths in this skill
core/… and scripts/… are relative to the repo root. When this is installed as a
plugin your working directory is your own project, not the plugin, so prefix them:
node "${CLAUDE_PLUGIN_ROOT}/scripts/render_diagram.mjs" in.mmd --id x --title "…" --desc "…" --out x.svg${CLAUDE_PLUGIN_ROOT} is Claude Code's portable reference to the plugin's own
directory. Working inside the repo itself, the bare paths are correct as written.
Reference files
references/diagram-families.md— per-form construction rules and failure modes.references/primitives.md— node, edge, label, callout, and grid specifications.references/mermaid-bridge.md— Mermaid and draw.io import, the renderer, theme bridging, coverage limits.
Credits
The editorial standard here — deletion as the highest-quality move, every node earning its place, one accent for the one or two things that matter, density around 4/10, hairlines and a 4px grid — is adapted from cathrynlavery/diagram-design (MIT), which established it for Claude Code.
This skill differs in scope: it is one member of a document design system, so its diagrams consume the same core/ tokens as the reports, charts, and decks they sit inside, rather than carrying a diagram-specific style of their own.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

