agentleFS
ddtcorexddtcorex/maestro-skills/skills/diagram-studio/SKILL.md

diagram-studio

Skill5 starsChanged 3 months agoMITView on GitHub

Use when creating architecture, sequence, class, ER, or state diagrams as Mermaid for GitHub docs or editorial HTML for client decks; includes verify and drift against codebase

  • Installs packages

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use when the reader learns more from a visual than from a paragraph or table.

    line 12
  2. Distinctive:

    Don't use for simple lists, single before/after comparisons, or a one-sentence relationship that a table can express — use a table instead.

    line 14
  3. Very specific:

    Add docs/diagrams/.gitkeep if the folder is otherwise empty.

    line 55
  4. Very specific:

    Every diagram has two audiences.

    line 59
  5. Very specific:

    When audience is ambiguous, default to Team (show everything collapsed) and add a 1-line note: "Hiding source/tokens for client — say …

    line 73
  6. Very specific:

    All 5 share tokens paper/ink/accent/muted/link (no shadow, rx:6, accent 1-2).

    line 87

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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 Studio

Hybrid Mermaid + editorial HTML for architecture, sequence, class, ER, and state diagrams.

When to Use

Use when the reader learns more from a visual than from a paragraph or table. Ideal for system architecture, message flows over time, entity relationships, class structures, and state transitions with guards.

Don't use for simple lists, single before/after comparisons, or a one-sentence relationship that a table can express — use a table instead.

Selection

Choose the Mermaid type by the semantic pattern, not by habit. See references/cheatsheet.md for minimal examples.

If showing…UseReference
Components + connectionsflowchartcheatsheet.md#flowchart
Messages over timesequenceDiagramcheatsheet.md#sequence
States + guardsstateDiagramcheatsheet.md#state
Entities + fieldserDiagramcheatsheet.md#er
Classes + opsclassDiagramcheatsheet.md#class

Full 52-ordinal editorial taxonomy from cathrynlavery/diagram-design v2.6.32 is mapped to these 5 Mermaid types in references/supported-cases.md (mapped or explicitly out of scope) — start with the table above before inventing a new form.

GitHub-compatible Mermaid style: use flowchart TB or flowchart LR (never legacy graph), add classDef tokens from references/style-guide.md, and use linkStyle/style sparingly for the focal path.

flowchart TB
  A["Client"] --> B["Cordis"]
  classDef focal fill:#eb6c36,stroke:#2d3142,color:#fff
  class A focal

Editorial Discipline (from diagram-design)

Extracted from cathrynlavery/diagram-design — see references/diagram-design-learnings.md:

  • Density 4/10 — generous whitespace, no wall of boxes. Every node must earn its place.
  • >9 nodes → split into overview + detail diagrams rather than cramming.
  • Accent 1-2 max — use classDef focal fill:#eb6c36,stroke:#2d3142 for the single hot path; all other nodes stay paper/muted. No shadows (shadow:false), rx:6 max, mono only for ports/URLs.
  • Confirm before drawing — state type, size preset (85%/100%), what will be cut due to budget and wait for redirect if the user is reachable. Never assume the diagram scope.

Where to Write

  • docs/ARCHITECTURE.md §1.1 — single source for the umbrella architecture (do not duplicate elsewhere).
  • docs/specs/*-design.md — for RFC/spec diagrams; each spec may embed one Mermaid block that lives with the design.
  • docs/diagrams/<slug>.html — for editorial export (optional, self-contained HTML+SVG for client decks). Link preview via ![Preview](diagrams/<slug>.html) in markdown when needed. Use spacing tokens from references/style-guide.md#deck-html-layout-tokens (header 16px, line-height 1.6) so deck text isn't cramped — verify with grep line-height.
  • docs/diagrams/maestro-harness-deck.html — 3-page A4 deck (cover + 2 diagrams). Must use deck layout tokens above; header flowchart TB and 10 plugins + meta must have 8px gap, not flowchart TB10.

Add docs/diagrams/.gitkeep if the folder is otherwise empty. The harness-* and maestro-harness-deck files named in this skill and in references/ are historical examples from the original harness repo; they are not shipped with this plugin.

Audience Rules (what to show for Team vs Client)

Every diagram has two audiences. The skill MUST decide on audience before writing docs/diagrams/<slug>.html (default is team when not specified — ask 1 line if unclear). Use this exact checklist:

| Element | Team / Internal (audience: team|internal|engineering|review or prompt has "cho team / keep source / để team xem") | Client / External (audience: client|pitch|deck|external or prompt has "cho khách / clean deck / bản đẹp cho khách") | |---|---|---| | Rendered diagram (inline SVG, self-contained, no JS) | Yes — always | Yes — always | | Mermaid source ```mermaid | Yes — inside <details><summary>Mermaid source</summary><pre class="mermaid">…</pre></details> collapsed by default (so the verifier can re-check, GitHub diff preserved) | No — remove <pre> and <details> entirely | | Editorial tokens card (paper/ink/accent swatches, hex) | Yes — keep the "Editorial tokens" card (so team knows palette to maintain) | No — remove the whole card (client only needs the diagram, not the design system) | | Technical footer (file path, verify {"ok":true}, drift missingInCode 0, generation note) | Yes — keep the "About this export" card with Source: docs/..., verify/drift line | No — remove or reduce to 1 line: Generated via diagram-studio — 2026-08-27 (no file paths, no verify/drift) | | Styling | Full tokens paper/ink/accent/muted/link as in references/style-guide.md | Same tokens (visual stays identical) — only the meta cards differ |

Rules for other locations (not audience-driven):

  • docs/ARCHITECTURE.md and docs/specs/*-design.md — always show source as ```mermaid block (GitHub renders it, diffable, single source of truth, verification checks it) — audience rule does not apply here.
  • docs/diagrams/*.pdf deck — always client rules (hide source, hide tokens card, hide technical footer, use PNG only) — PDF is for distribution.

When audience is ambiguous, default to Team (show everything collapsed) and add a 1-line note: "Hiding source/tokens for client — say 'clean for client' to hide."

Supported Cases (summary — details in references/supported-cases.md)

This skill covers 5 diagram types × 2 audiences × 3 outputs. Parse and strict checks run through the bundled CLI (scripts/verify-mermaid.mjs); drift against the codebase is checked by hand. See references/supported-cases.md for the full tables.

#Mermaid typeWhen to useAudience variantsOutput
1flowchart TB/LRComponents + connectionsTeam: harness-architecture.html 16K (svg+pre) → Client: ...-client.html 12K (svg only)docs/ARCHITECTURE.md §1.1 + HTML + PDF p1
2sequenceDiagramMessages over timeTeam: harness-turn-flow-sequence.html 31K → Client: ...-client.html 30Kdocs/specs/...-sequence.md + HTML + PDF p2
3classDiagramClasses + opsTeam/Client per Audience Rulescheatsheet.md#class
4erDiagramEntities + fieldsTeam/Clientcheatsheet.md#er
5stateDiagramStates + guardsTeam/Clientcheatsheet.md#state

All 5 share tokens paper/ink/accent/muted/link (no shadow, rx:6, accent 1-2). Verification: parse passes for all 5 types, --strict warns on shadow:true. Details and live case studies in references/supported-cases.md.

Verify & Drift

Always verify before commit: a diagram that fails parse must never ship. Run the bundled CLI, which extracts every mermaid block and checks each one on its own. It runs the real mermaid.parse() when mermaid and jsdom can be imported from the script (for example npm i --no-save mermaid jsdom in the repo checkout) and returns {ok, errors, warnings, validator} with validator: "mermaid". Without them it falls back to a heuristic (incomplete arrows, unterminated strings, unclosed flowchart brackets), reports validator: "heuristic" and a warning, and a heuristic ok is not a syntax guarantee: use --require-parser to refuse that mode (exit 2). It exits 0 on success and 1 on failure. Add --strict to report anti-patterns (e.g. shadow, legacy graph) as warnings.

node maestro-skills/skills/diagram-studio/scripts/verify-mermaid.mjs docs/ARCHITECTURE.md --strict
node scripts/verify-mermaid.mjs <file|-> --strict   # from this repo's root, or '-' for stdin

Drift is done by hand, with no tool behind it. Before a PR, compare the diagram against the codebase and flag missingInCode / staleEdges / missingInDiagram (inspired by diagram-drift): every node must map to a real package, file or service, and every real component in scope must appear. Fix drift by patching the doc or the code reference.

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.