agentleFS
zeroasteriskzeroasterisk/skills/diagram-design/SKILL.md

diagram-design

Skill1 starsChanged 3 months agoApache-2.0View on GitHub

Create branded architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, loop/flywheel, nested, tree, org chart, layer stack, Venn, pyramid/funnel, bar, line, Gantt and scatter charts, high-level, process, medallion, data flow, DP integration, or DP security matrix diagrams as standalone Material Design 3 HTML/SVG/PNG with subtle Google colors. Redraw .drawio/.drawio.png/.drawio.svg or Mermaid .mmd sources at a chosen size/detail; onboard brand tokens from a website; add semantic patterns, callouts, accessible motion, or sketchy/hand-drawn styling.

15 other projects use a version of this, 12 of them edited.

Adopted by

Most recently taken up by

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.
  • AWSSkill

    grilling

    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

  • VercelSkill

    agent-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

  • VercelSkill

    web-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

  • StrayDragonSkill

    ui-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

The file

We split this skill into the rules it gives an agent

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

  • 6

    Common

    Most of the 14 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Common:

    Create visual diagrams as self-contained HTML files with inline SVG and CSS, following Material Design 3 (M3) principles and a refined …

    line 11
  2. Common:

    Don't silently ship default-skinned diagrams into a branded project.

    line 21
  3. Common:

    Every node represents a distinct idea.

    line 37
  4. Common:

    Every connection carries information.

    line 38
  5. Common:

    Use for any of the 27 visual types (§3) when a reader will learn more from a visual than from prose, a table, or a bulleted list.

    line 49
  6. Common:

    Before drawing, ask: *Would the reader learn more from this than from a well-written paragraph?* If no, don't draw.

    line 58
  7. Very specific:

    When behavior, state, enforcement, or risk carries the meaning, first load references/semantic-patterns.md and choose one primary pattern.

    line 64
  8. Very specific:

    The design system is skinnable: All colors, typography, and tokens live in a single source of truth — references/style-guide.md.

    line 140
  9. Very specific:

    Rounded right-angle (orthogonal) connectors are mandatory: Every bend must be a quarter-arc with r=8 (or r=6 for tight layouts).

    line 232
  10. Distinctive:

    Label-to-connector margin: 6–10px gap, always: Place label centered above (or beside) the line with minimum 6px gap between mask rect and …

    line 233
  11. Distinctive:

    No overlapping connectors: When crossing at a single point, apply the bridge/hop primitive.

    line 234
  12. Distinctive:

    Run before producing any diagram:

    line 323

“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.

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

Diagram Design — Material Design 3 & Google System

Create visual diagrams as self-contained HTML files with inline SVG and CSS, following Material Design 3 (M3) principles and a refined Google color system.

Twenty-seven visual types. Semantic patterns describe behavior independently; type references describe layout. Details load from references/ only when selected.


0. First-time setup — style guide gate

Before generating your first diagram in a new project, verify the style guide has been customized.

Don't silently ship default-skinned diagrams into a branded project.

First check the project root for a .diagram-design marker and resolve it per references/profiles.md. A valid marker whose profile exists selects that file directly and skips this gate; profile: default also skips it. A malformed or missing-profile marker follows the visible failure handling in that reference. Never copy a marker-selected profile over the installed working copy.

Open references/style-guide.md and check the default tokens. If they're the shipped defaults (paper #f8f9fa, ink #1f1f1f, accent #0b57d0 Google Blue), pause and ask the user if they wish to customize it or proceed with the Google Material Design 3 default.

Once the style guide has been customized (or the user explicitly opted for default), skip this gate on subsequent runs.


1. Philosophy

The highest-quality move is usually deletion.

Applied to schematics:

  • Every node represents a distinct idea. Two nodes that always travel together are one node.
  • Every connection carries information. If the relationship is obvious from layout, remove the line.
  • Focal accent (Google Blue / Red) is editorial, not a flag. 1–2 focal nodes per diagram. Using it on 5 nodes erases the signal.
  • The schematic isn't done when everything is added. It's done when nothing can be removed.
  • Material Design 3 Clarity: Clean tonal surfaces (surface-container-low, surface-container), high contrast, soft 12px rounded geometry (rx="12"), and disciplined typography.

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


2. When to Use

Use for any of the 27 visual types (§3) when a reader will learn more from a visual than from prose, a table, or a bulleted list.

Don't use for:

  • Quick unicode diagrams → use wiretext.
  • Lists of things → table or bullets.
  • Simple before/after → table.
  • One-shape "diagrams" → just write the sentence.

Before drawing, ask: Would the reader learn more from this than from a well-written paragraph? If no, don't draw.


3. Selection: semantic pattern, then visual type

When behavior, state, enforcement, or risk carries the meaning, first load references/semantic-patterns.md and choose one primary pattern. Then choose the nearest visual type for layout. If no pattern matches, choose the type directly.

Behavioral triggerSemantic pattern → nearest type
Fan-in, queue depth, finite capacity, bottleneckFan-in queue / bottleneck → Data flow
Repeated Question / Input / Governance / Output slots across stagesStage framework with semantic slots → Process
Conversation or loose input becomes a structured durable artifactUnstructured input → structured artifact → Data flow
Two rule traces need pass/fail/skipped/not-reached and first divergencePaired policy-evaluation traces → Flowchart
Trust boundaries plus permitted/forbidden ingress or deploy pathsSecure paved road → Architecture
Controls grouped by where they are enforcedGovernance / control catalog → Layer stack
Defenses compensate for prior gaps and residual risk propagatesCompensating security layers → Layer stack

The pattern owns semantic primitives and its tighter budget; the type owns layout grammar. Use references/animation.md only when motion is requested or materially clarifies ordered change; static remains the default.

Visual-type guide (27)

If you're showing…UseReference
Components + connections in a systemArchitecturetype-architecture.md
Legacy IT landscape grouped by phase/department; documents modernizationIT current-statetype-it-state.md
Decision logic with branchesFlowcharttype-flowchart.md
Time-ordered messages between actorsSequencetype-sequence.md
States + transitions + guardsState machinetype-state.md
Entities + fields + relationshipsER / data modeltype-er.md
Events positioned in timeTimelinetype-timeline.md
Cross-functional process with handoffsSwimlanetype-swimlane.md
Two-axis positioning / prioritizationQuadranttype-quadrant.md
Multiple entities scored across 3–5 quantitative criteriaRadar / Spidertype-radar.md
Reinforcing cycle / flywheel where the last step feeds the firstLooptype-loop.md
Hierarchy through containment / scopeNestedtype-nested.md
Parent → children relationshipsTreetype-tree.md
Human/agent/team ownership, reporting, routing, escalationOrg charttype-org-chart.md
Stacked abstraction levelsLayer stacktype-layers.md
Overlap between setsVenntype-venn.md
Ranked hierarchy or conversion drop-offPyramid / funneltype-pyramid.md
Quantitative comparison across categoriesBar charttype-bar.md
Continuous trends over timeLine charttype-line.md
Tasks and phases on a timelineGantttype-gantt.md
Distribution and correlation between two variablesScatter plottype-scatter.md
End-to-end data stack on a container clusterHigh-Leveltype-high-level.md
Multi-actor sequential process with data handoffsProcesstype-process.md
Multi-tier data storage with quality levels and access policiesMedalliontype-medallion.md
Role-scoped data flow: who does what at each pipeline stepData flowtype-data-flow.md
Integration topology of a data platform — sources → core → consumersDP integrationtype-dp-integration.md
Per-role / per-component access permissions matrixDP security matrixtype-dp-security-matrix.md

Always load the chosen references/type-*.md before drawing.


4. Universal Anti-patterns

These mark low-quality schematics of any type:

Anti-patternWhy it fails
Dark mode + cyan/purple neon glowLooks "technical" without design decisions
JetBrains Mono as blanket "dev" fontMono is for technical content — ports, commands, URLs. Names go in Google Sans / Roboto.
Sharp boxy corners without radiusUnrefined; Material Design 3 uses rounded geometry (rx="12" for boxes, rx="8" for chips).
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
Heavy drop shadows on elementsMuddy and busy. Use M3 tonal surface elevation and clean stroke borders.
Accent color on every "important" nodeAccent is 1–2 editorial accents, not a signaling system
Diagonal / slanted connectors between off-axis nodesRounded right-angle (orthogonal) elbows are mandatory — see §6 Mandatory connector rules
Arrow label sitting on or touching its connectorLabel must have a 6–10px gap above the line so the connector stays visible
Arrow label mask overlapping a node boxNodes paint after labels — the fill clips the text into a fragment on the border.
Two connectors overlapping or running on the same pathEach connection must be independently traceable — bridge crossings, offset parallels
Two connectors sharing a single attach point on a boxFan attach points along the edge (≥12px apart) so every arrow is clearly distinct

5. Material Design 3 Design System

The design system is skinnable. All colors, typography, and tokens live in a single source of truth — references/style-guide.md.

Semantic roles (at a glance)

RolePurposeDefault LightDefault Dark
paper, paper-2Page bg and container bg#f8f9fa / #f1f3f4#1f1f1f / #28292a
inkPrimary text / stroke#1f1f1f#e3e3e3
muted, softSecondary text, default arrows, sublabels#444746 / #747775#c4c7c5 / #8e918f
rule, rule-solidHairline borders, card outlinesrgba(31,31,31,0.12) / #c4c7c5rgba(227,227,227,0.12) / #444746
accent, accent-tint1–2 focal elements (Google Blue)#0b57d0 / rgba(11,87,208,0.08)#a8c7fa / rgba(168,199,250,0.12)
linkHTTP/API calls, external arrows#0b57d0#a8c7fa

Google Semantic Accents:

  • Google Red (#d93025 / #f28b82): Security, policy divergence, errors, fail traces.
  • Google Amber (#e37400 / #fdd663): Queues, warning thresholds, stage bottlenecks.
  • Google Green (#1e8e3e / #81c995): Storage, databases, pass traces, verified artifacts.

Node type → treatment (M3 Style)

TypeFillStrokeRadius
Focal (1–2 max)accent-tint (rgba(11,87,208,0.08))accent (#0b57d0)rx="12"
Backend / API / Service#ffffff (light) / #28292a (dark)rule-solid (#c4c7c5)rx="12"
Store / Database / Statergba(30,142,62,0.06) (Google Green)#1e8e3e or mutedrx="12"
External / Cloudrgba(11,87,208,0.04) (Google Blue)rgba(11,87,208,0.35)rx="12"
Input / Userrgba(68,71,70,0.06) / #f1f3f4soft (#747775)rx="12"
Optional / Asyncrgba(31,31,31,0.02)rgba(31,31,31,0.25) dashed 4,3rx="12"
Security / Boundaryrgba(217,48,37,0.05) (Google Red)rgba(217,48,37,0.50) dashed 4,4rx="12"

Typography (Material Design 3)

  • Title — Google Sans / Roboto, 1.75rem (28px), 500/400 — H1 only
  • Node name — Google Sans Text / Google Sans, 12px, 500/600 — human-readable labels
  • Sublabel — Roboto Mono, 9px — ports, URLs, field types
  • Eyebrow / tag — Google Sans Text, 7–8px, uppercase, tracked 0.12em — type tags, axis labels
  • Arrow label — Roboto Mono, 8px, 500 — annotation on arrows
  • Editorial aside — Google Sans Text, 13–14px, italic — callouts only
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&family=Google+Sans+Text:ital,wght@0,400;0,500;0,700;1,400&family=Roboto+Mono:wght@400;500;600&family=Roboto:ital,wght@0,400;0,500;0,700;1,400&display=swap" rel="stylesheet">

6. Core SVG Primitives

Universal building blocks:

  • Editorial callouts → primitive-annotation.md
  • Hand-drawn variant → primitive-sketchy.md
  • Icon set (Compute, Storage, Network, GCP, etc.) → primitive-icons.md
  • Terminal / CLI-window variant → primitive-terminal.md
  • Explanatory motion → animation.md

Background

Default: clean M3 surface. Single <rect> filled with paper (#f8f9fa).

<rect width="100%" height="100%" fill="#f8f9fa"/>

Arrow markers

<marker id="arrow" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
  <polygon points="0 0, 8 3, 0 6" fill="#444746"/>
</marker>
<marker id="arrow-accent" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
  <polygon points="0 0, 8 3, 0 6" fill="#0b57d0"/>
</marker>
<marker id="arrow-link" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
  <polygon points="0 0, 8 3, 0 6" fill="#0b57d0"/>
</marker>
ArrowStrokeWhen
Defaultmuted #444746Internal, generic
AccentGoogle Blue #0b57d0Primary / highlighted / headline
Link-blue#0b57d0HTTP/API calls, external systems
Green#1e8e3eData persistence, success flows
Red#d93025Rejections, critical alert paths
Dashedstroke-dasharray="5,4" + any colorOptional, passive, return, async

Draw arrows before boxes so z-order puts lines behind nodes.

Mandatory connector rules

  1. Rounded right-angle (orthogonal) connectors are mandatory. Every bend must be a quarter-arc with r=8 (or r=6 for tight layouts). Diagonal connectors are an automatic fail.
  2. Label-to-connector margin: 6–10px gap, always. Place label centered above (or beside) the line with minimum 6px gap between mask rect and stroke.
  3. No overlapping connectors. When crossing at a single point, apply the bridge/hop primitive. Offset parallel lines by ≥12px.
  4. Shared edge → fan the attach points. Spread attach points evenly along the edge with ≥12px between adjacent points.
  5. No connector passing behind an intervening box without dashed transit.
  6. No label mask overlapping a node drawn after it.

Node box — M3 pattern (rx="12")

<!-- 1. Opaque paper mask -->
<rect x="X" y="Y" width="W" height="H" rx="12" fill="#f8f9fa"/>
<!-- 2. Styled box with M3 12px rounded corner -->
<rect x="X" y="Y" width="W" height="H" rx="12" fill="FILL" stroke="STROKE" stroke-width="1"/>
<!-- 3. M3 Type Tag / Chip (rx="4" or rx="6") -->
<rect x="X+10" y="Y+8" width="32" height="14" rx="4" fill="transparent" stroke="STROKE@0.40" stroke-width="0.8"/>
<text x="X+26" y="Y+18" fill="STROKE@0.8" font-size="7" font-family="'Google Sans Text', sans-serif"
      text-anchor="middle" letter-spacing="0.08em">API</text>
<!-- 4. Node name (Google Sans / Google Sans Text) -->
<text x="CX" y="CY+2" fill="#1f1f1f" font-size="12" font-weight="500"
      font-family="'Google Sans Text', 'Google Sans', sans-serif" text-anchor="middle">Node Name</text>
<!-- 5. Technical sublabel (Roboto Mono) -->
<text x="CX" y="CY+18" fill="#444746" font-size="9"
      font-family="'Roboto Mono', monospace" text-anchor="middle">service:port</text>

Arrow labels

<!-- Mask sits 14px above the arrow. Stroke is at ARROW_Y. -->
<rect x="MID_X-18" y="ARROW_Y-20" width="36" height="12" rx="4" fill="#f8f9fa"/>
<text x="MID_X" y="ARROW_Y-11" fill="#747775" font-size="8" font-weight="500"
      font-family="'Roboto Mono', monospace" text-anchor="middle" letter-spacing="0.05em">WRITE</text>

Legend — horizontal strip at the bottom

<line x1="30" y1="LEGEND_Y-8" x2="VIEWBOX_W-30" y2="LEGEND_Y-8"
      stroke="rgba(31,31,31,0.12)" stroke-width="0.8"/>
<text x="30" y="LEGEND_Y+8" fill="#444746" font-size="8" font-weight="500"
      font-family="'Roboto Mono', monospace" letter-spacing="0.14em">LEGEND</text>

7. Layout & Spacing

4px grid

All values — font sizes, padding, node dimensions, gaps, x/y coords — divisible by 4.

CategoryAllowed values
Font sizes8, 12, 16, 20, 24, 28, 32, 40
Node width / height80, 96, 112, 120, 128, 140, 144, 160, 180, 200, 240, 320
x / y coordinatesmultiples of 4
Gap between nodes20, 24, 32, 40, 48
Padding inside boxes8, 12, 16
Border radius (M3)4 (xs), 8 (sm), 12 (md), 16 (lg)

Complexity budget (per diagram)

Max nodes: 9 (split into overview + detail if larger). Max arrows: 12. Max focal elements: 2.


8. Material Design 3 Summary Cards

<div class="card">
  <p class="eyebrow">COMPONENT OVERVIEW</p>
  <div class="card-header">
    <span class="card-dot blue"></span>
    <h3>Service Controller</h3>
  </div>
  <ul><li>Dispatches tasks to worker pool</li></ul>
</div>

Rules:

  • background: #ffffff
  • border: 1px solid var(--color-rule)
  • border-radius: 12px (M3 card radius)
  • padding: 1.25rem
  • Card dots: 8px, border-radius: 50% (blue, green, yellow, red, ink, muted)

9. Pre-Output Checklist (Taste Gate)

Run before producing any diagram:

  • Right visual type and semantic pattern?
  • Nodes use Material Design 3 rx="12" rounded geometry?
  • Google Sans / Roboto font stack used throughout?
  • Google Blue #0b57d0 / #a8c7fa used for primary focal accent?
  • Connectors use rounded right-angle elbows (r=8)? No diagonal lines?
  • Arrow labels masked with 6–10px gap above connector?
  • No connector overlaps; attach points fanned ≥12px apart?
  • Accessible SVG contract fulfilled (role="img", aria-labelledby, <title>, <desc>)?
  • 4px grid respected?

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.