agentleFS
AvinavaAvinava/document-design-system/skills/diagram-design/SKILL.md

diagram-design

Skill2 starsChanged 37 days 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, system maps, change views, deployment maps, and dependency graphs. 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.

47 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use pretty-mermaid, transitions-dev and 10 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.
  • drafaelSkill

    pretty-mermaid

    Render beautiful Mermaid diagrams as SVG or ASCII art using the beautiful-mermaid library. Supports 15+ themes, 5 diagram types (flowchart, sequence, state, class, ER), and ultra-fast rendering.

    Also in 3 projects that use this

  • AnasX7Skill

    transitions-dev

    Production-ready CSS transitions for web apps. Use when implementing notification badges, dropdowns, modals, panel reveals, page transitions, card resizes, number pop-ins, text swaps, icon swaps, success checks, avatar group hovers, error state shakes, search/input clear, skeleton loaders, shimmer text, sliding tabs, tooltips, staggered text reveals, card hover tilt, plus-to-menu morph, accordions, toasts, like buttons, learn-more hovers, checkbox checks, spinning counters, toggles, AI thinking states, reasoning streams, streaming text, matrix dot loaders, or banner stacking. Triggers on "add a transition", "animate the dropdown", "make the modal open smoothly", "swap icon", "page slide", "stagger animation", "open / close transition", "make it animate", "fade between", "success animation", "form error", "shake on invalid", "hover lift", "avatar stack hover", "clear the search", "skeleton loader", "loading shimmer", "shimmer text", "sliding tabs", "segmented control", "tooltip", "reveal text", "tilt card", "3D hover tilt", "cursor glare", "plus to menu", "FAB morph", "accordion", "collapsible", "expand / collapse", "disclosure", "toast", "snackbar", "like button", "heart animation", "learn more arrow", "checkbox", "check animation", "spinning counter", "odometer", "slot machine digits", "toggle", "switch", "thinking states", "AI status line", "agent reasoning", "reasoning stream", "streaming text", "stream words in", "matrix loader", "dot loader", "banner stack", "stacked toasts". Also "motion tokens", "scan for ad-hoc transitions", "replace hardcoded durations with motion tokens", "tokenize my animations", and the commands transitions reveal, transitions review, transitions apply, transitions refine.

    Also in 3 projects that use this

  • PydanticSkill

    i-have-adhd

    Shape every response for an ADHD reader who reviews the work but does not do the coding — the agent does. Use whenever responding to ANY message — coding, debugging, planning, casual. Lead with the result or the decision. Surface anything needing the user's input as a structured question, never buried in prose they'll skim past. No preamble, no recap, no closers. State errors matter-of-factly. Make finished work visible. Trigger even on casual messages and even when brevity wasn't requested.

    Also in 4 projects that use this

  • HK-hubSkill

    overdrive

    Pushes interfaces past conventional limits with technically ambitious implementations — shaders, spring physics, scroll-driven reveals, 60fps animations. Use when the user wants to wow, impress, go all-out, or make something that feels extraordinary.

    Also in 3 projects that use this

  • AnasX7Skill

    design-taste-frontend

    Anti-slop frontend skill for landing pages, portfolios, and redesigns. The agent reads the brief, infers the right design direction, and ships interfaces that do not look templated. Real design systems when applicable, audit-first on redesigns, strict pre-flight check.

    Also in 9 projects that use this

  • HK-hubSkill

    delight

    Add moments of joy, personality, and unexpected touches that make interfaces memorable and enjoyable to use. Elevates functional to delightful. Use when the user asks to add polish, personality, animations, micro-interactions, delight, or make an interface feel fun or memorable.

    Also in 3 projects that use this

  • +2 more from AnasX7

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 44 edited versions we read keep these.

  • 3

    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
  1. Distinctive:

    If the answer is "nothing," write the prose.

    line 12
  2. Distinctive:

    If the answer is "several of these," the diagram is doing too much.

    line 44
  3. Distinctive:

    Never encode meaning in lightness alone: Every theme is legible, and a dark theme inverts which fill reads heavier, so "darker means more" …

    line 89

“Common” is measured: kept by at least 6 in 10 of the 44 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 understandForm
How parts are arranged and what talks to whatArchitecture / system map
How something moves through steps, with branchesFlow
Who calls whom, in what order, over timeSequence
What states exist and what transitions between themState machine
How entities relate and what they holdData model
What happened when, and in what orderTimeline
How responsibility is divided across actorsSwimlane
How options compare on two independent axesQuadrant
What sits on top of whatLayer stack
How something narrows or concentratesFunnel
How sets overlapVenn
How one thing decomposes into partsTree / nested
What a change adds, removes, and leaves aloneChange view
Where each part runs: cluster, namespace, replicasDeployment map
What must finish before what, and which chain sets the dateDependency graph

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.

DestinationColorsTheming
Inline in the documentvar(--…) referencesFollows the document's data-theme
<img>, email, external embedLiteral valuesSelf-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. For the second case, write literal colours for the light reading into the shapes, then add a <style> block inside the SVG whose @media (prefers-color-scheme: dark) rule overrides those fills and strokes by class, so one file serves both host themes without reaching for the page's tokens.

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 and var(--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.
  • Never encode meaning in lightness alone. Every theme is legible, and a dark theme inverts which fill reads heavier, so "darker means more" breaks the moment the theme changes. Legends name each encoding in words ("dashed: outside Platform"), never only by swatch.
  • Mark the structure. g.node (node-focal, node-external, node-muted), path.edge, g.edge-label, g.boundary, g.legend, g.callout, g.annotation — the classes are what scripts/check_diagrams.py measures.

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.

SourcePath
Sequence, state, class, ER, flowchart where auto-layout is honestscripts/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 meaningHand-author from templates/diagram.svg. Auto-layout does not know that "closer" means "coupled," so it will destroy the point of the diagram
Existing .drawio or Mermaid flowchartscripts/import_diagram.py extracts nodes, edges, and groups as JSON with no coordinates; redraw that structure under the rules above — never embed the original

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.
  • Legends name every encoding in words; nothing relies on lightness alone.
  • scripts/check_diagrams.py figure.svg reports no findings.

Paths in this skill

core/…, scripts/… and templates/… are relative to this skill's directory — the folder that contains this SKILL.md — not to your working directory. Each skill carries its own copy, so it works however it was installed. Prefix them with that directory:

node "<skill-dir>/scripts/render_diagram.mjs" in.mmd --id x --title "…" --desc "…" --out x.svg
python3 "<skill-dir>/scripts/check_diagrams.py" x.svg          # markup and geometry rules
python3 "<skill-dir>/scripts/import_diagram.py" old.drawio     # structure only, as JSON

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 — the Mermaid renderer, theme bridging, coverage limits.
  • references/importing.md — draw.io and Mermaid import: the neutral model, the safety caps, and redrawing.

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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.