mermaid-skill
Skill1 starsChanged 3 months agoMITView on GitHub
Mermaid diagram authoring patterns that actually render across GitHub, Mermaid Live, mermaid-js in IDEs, and embedded renderers. Load this skill whenever the user asks to create, modify, or debug a mermaid diagram of any kind (sequence, flowchart, class, state, gantt, ER, gitGraph), whether the diagram lives inside a markdown file as a fenced mermaid code block or as a standalone .mmd file. Trigger generously on mentions of mermaid, sequence diagram, flowchart, architecture diagram, system diagram, state diagram, class diagram, or any diagram-as-code request even when the user does not say the word "mermaid" by name.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Yassimba/loomtheir own version, first seen Aug 30, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- Yassimba/loom★ 9same name
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 repository18 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- clickhouseSkill
- distributed-systemsSkill
- flink-javaSkill
- flink-pythonSkill
- flink-sqlSkill
- gitSkill
- grokSkill
- java-prod-skillSkill
- javaSkill
- openapi_docSkill
- postgresSkill
- python-numericsSkill
- pythonSkill
- pytorchSkill
- reactSkill
- rustSkill
- sqlSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 4 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
When a feature outside the conservative subset is tempting, probe the engine first: render a fenced mermaid block containing only
- Very specific: line 33
Standalone
.mmd/.mermaidfile: no fence — the file starts directly with the diagram type. - Distinctive: line 37
Every rule below applies to both.
- Very specific: line 80
Use commas or - instead. If a literal semicolon is required in the text, use the entity escape #59;.
- Very specific: line 95
Default to - or / as a separator, or split into two participants.
- Very specific: line 193
Arrows: search the block for →, ⇄, ↔, ⇒, ←.
- Very specific: line 195
Sequence arrows: search for --), -), -(, --(.
- Very specific: line 197
Semicolons: search for ; in Note lines and in message text (after a :).
- Very specific: line 199
<br/>in sequence participants: search for participant .* as .*<br/>. - Distinctive: line 202
Reserved ids: search for participant / node ids matching (case-insensitive in sequence diagrams.
- Very specific: line 210
Unquoted special chars in labels: search for [ ... ( ... ] patterns and [ ...
- Distinctive: line 214
If any check fails, fix before emitting the block.
≈ “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.
Files
Authoring Mermaid diagrams that actually render
Mermaid's parser is strict, line-oriented, and not standardized across
renderers — GitHub, Mermaid Live, and the mermaid-js versions embedded in
various IDEs all differ. The rules below are the conservative subset that
renders everywhere. Follow them by default; only deviate when you've verified
the target renderer supports a feature.
Verifying the target renderer
When a feature outside the conservative subset is tempting, probe the engine first: render a fenced mermaid block containing only
infoIt prints the engine's mermaid version (works on GitHub and Mermaid Live).
Interactive features (click links / callbacks) never run in static or
sandboxed renderers such as GitHub, regardless of version.
Where the diagram lives
Two wrappers, identical syntax inside:
- Inside markdown (READMEs, ADRs — the common case): a triple-backtick
fence tagged
mermaid. - Standalone
.mmd/.mermaidfile: no fence — the file starts directly with the diagram type. Use when the diagram deserves its own file or you'll render it to SVG/PNG via themmdcCLI and embed it as an image.
Every rule below applies to both.
Hard rules — apply unconditionally
R1. Use only ASCII arrows. Never put unicode arrows in messages or labels.
Some renderers tokenize →, ⇄, ↔, ⇒, ← as arrow operators even
inside message text or node labels, which corrupts parsing of the
surrounding line.
| ❌ Bad | ✅ Good |
A->>B: speech → STT → transcript | A->>B: speech to STT to transcript |
Note over X,Y: aiortc ⇄ browser | Note over X,Y: aiortc to/from browser |
participant P as STT → LLM → TTS | participant P as STT - LLM - TTS |
R2. In sequenceDiagram, use only these arrow forms.
| Form | Meaning |
->> | solid arrow (sync call) |
-->> | dashed arrow (reply / async return) |
-x / --x | with cross (lost message) |
-> / --> | plain line (rarely needed) |
Avoid by default --), -), -(, --(. These "async open-arrow" forms
are rejected only by renderers embedding mermaid <= 8.x (2020-era), with
errors like Expecting 'SOLID_OPEN_ARROW'...; all mainstream 2026 renderers
(GitHub, Mermaid Live, current IDEs) accept them. When targeting unknown or
legacy embedded renderers, replace every --) with -->> (same semantics:
dashed async reply).
R3. Never put ; in message text or Note text.
In sequence diagrams, semicolon ends the statement. Everything after it is
parsed as a new statement and explodes with Expecting <signal type> or ID,
got ';' or Expecting NEWLINE.
| ❌ Bad | ✅ Good |
Note over A,B: WebRTC up; greeting; bot-ready | Note over A,B: WebRTC up, greeting, bot-ready |
A->>B: trickle ICE; redundant; non-fatal | A->>B: trickle ICE, redundant, non-fatal |
Use commas or - instead. If a literal semicolon is required in the text,
use the entity escape #59;.
R4. Default to - separators in participant ... as aliases; use <br/> only on verified renderers.
Current mermaid (11.x) supports <br/> line breaks in participant aliases —
the official docs document participant Alice as Alice<br/>Johnson as the
line-break mechanism for actor names, and it renders as a real two-line
label. But some older embedded renderers abort alias parsing on it, and the
next token (often a comma in a later Note over A,B) becomes "unexpected."
| Conservative (renders everywhere) | Mermaid 11.x, verified renderer only |
participant HND as offer.py (ours) - Handler (kit) | participant HND as offer.py (ours)<br/>Handler (kit) |
Default to - or / as a separator, or split into two participants;
use <br/> only after confirming the target renderer (see the info probe
above). <br/> in flowchart / graph node labels
(A[Line 1<br/>Line 2]) is safe everywhere.
R5. Avoid reserved / ambiguous identifiers for participants and nodes.
Mermaid reserves keywords used by its own syntax. The biggest landmine in
sequence diagrams: off (used by autonumber off). Sequence-diagram
lexing is case-insensitive, so OFF, End, and Box all collide there.
Flowcharts are the opposite — ids are case-SENSITIVE: End renders fine
while lowercase end is a parse error, and capitalizing end is mermaid's
own documented workaround for the flowchart end-keyword collision.
| ❌ Bad | ✅ Good |
participant OFF as ... | participant OFFER as ... |
participant END as ... | participant FINISH as ... |
participant LINK as ... (some renderers) | participant CONN as ... |
Other words to avoid as IDs: end, class, click, link, note, loop,
alt, else, opt, par, and, rect, activate, deactivate,
participant, actor, as, over, on, off, default, direction,
subgraph, box, critical, break, create, destroy, links,
properties, details.
Flowchart edge-decoration gotcha: a node id starting with lowercase o or
x directly after an edge is parsed as a circle/cross edge decoration —
A---oB silently becomes an o-decorated edge to B. Capitalize or add a
space: A---OB or A--- oB.
R6. Style subgraphs with a class statement or style — never the inline ::: shorthand.
class subgraphId styleName works in current mermaid (the class lands on the
subgraph's cluster element), and style subgraphId fill:#... works
everywhere. The inline shorthand on a subgraph declaration —
subgraph id:::styleName — is a parse error. Old embedded renderers
(mermaid <= 8.7, bug mermaid-js#1726, fixed Oct 2020) rendered fine but
silently dropped the class on subgraphs, so style subgraphId ... remains
the safest cross-renderer choice.
| ❌ Bad | ✅ Good |
subgraph core:::rust | class core rust or style core fill:#f8d7a0 |
R7. Quote node labels that contain special characters.
In flowchart / graph, wrap labels in double quotes whenever the label
contains (, ), {, }, :, ,, /, &, |, <, >, #, or pipe
characters.
GOOD: API["Chat SSE: POST /api/v1/chat/{conv_id}"]
BAD: API[Chat SSE: POST /api/v1/chat/{conv_id}]R8. Edge labels with special characters must be quoted.
GOOD: A -->|"HTTP chat SSE"| B
BAD: A -->|HTTP chat (SSE)| BR9. Don't mix link styles into one chain you also try to label individually.
A --> B --> C is fine, but if any link needs a label, write the labeled
link on its own line:
A --> B
B -->|"with label"| CSoft rules — apply by default, relax only when needed
S1. Prefer ASCII punctuation in message text.
Em dashes (—) and curly quotes usually render, but some embedded
renderers strip or misinterpret them. When in doubt, use - and straight
quotes.
S2. Keep one statement per line. No trailing semicolons.
Even where Mermaid allows ; as a separator, omitting it removes a whole
class of bugs.
S3. Keep participant / node ids short and ALL_CAPS or PascalCase.
Short ids are less likely to collide with reserved words and keep diffs
readable. Put the long human-readable name in the as alias.
S4. For sequence diagrams, declare every participant explicitly with participant.
Auto-declaration (first appearance) sometimes orders participants unexpectedly and makes reserved-word collisions harder to diagnose.
Pre-flight checklist (run mentally before emitting any Mermaid block)
- Arrows: search the block for
→,⇄,↔,⇒,←. Replace with ASCII (to,to/from, etc.). - Sequence arrows: search for
--),-),-(,--(. Replace--)with-->>. - Semicolons: search for
;inNotelines and in message text (after a:). Replace with,or-. <br/>in sequence participants: search forparticipant .* as .*<br/>. Replace with-unless the target renderer is verified mermaid 11.x (R4).- Reserved ids: search for participant / node ids matching
(case-insensitive in sequence diagrams; flowchart ids are case-sensitive)
off|end|class|note|loop|link|on|as|over|alt|else|opt|par|and|rect|activate|deactivate|default|direction|subgraph|box|critical|break|create|destroy|links|properties|details. Rename. Also in flowcharts: search for edges directly followed by an id starting with lowercaseo/x(e.g.---oB); capitalize or add a space. - Subgraph styling: in
flowchart/graph, no inline:::on asubgraphdeclaration — useclass subgraphId nameon its own line, orstyle subgraphId fill:#...(safest cross-renderer). - Unquoted special chars in labels: search for
[...(...]patterns and[...:...]. Quote those labels:X["..."]. - Edge labels with special chars: quote
-->|"..."|.
If any check fails, fix before emitting the block.
Error message → fix table (for debugging an existing diagram)
| Renderer error | Most likely cause | Fix |
<signal type> or ID expected, got ',' | Older embedded renderer choked on <br/> in a participant ... as alias upstream | Replace <br/> with - (mermaid 11.x supports it; legacy renderers do not) |
Expecting '+', '-', 'ACTOR', got 'off' (or another lowercase word) | Participant id is a reserved word (OFF, END, ...) | Rename id |
Expecting 'SOLID_OPEN_ARROW', 'DOTTED_OPEN_ARROW', ..., got ',' or got 'NEWLINE' | A previous line had ; in a Note / message and the parser is mid-statement on the next line | Replace ; with , |
Expecting 'SOLID_OPEN_ARROW', 'DOTTED_OPEN_ARROW', ... after a line with --) | Renderer embeds mermaid <= 8.x and rejects --) async arrows | Replace --) with -->> |
Parse error on a subgraph line containing ::: | Inline :::styleName shorthand applied to a subgraph declaration | Use class subgraphId name on its own line, or style subgraphId ... |
Parse error ... got 'PS' / got 'PE' in a flowchart | Unquoted parentheses inside a node label | Quote the label: X["..."] |
Canonical safe templates
Drop one of these in and edit; they all pass the pre-flight checklist by construction.
Sequence diagram
sequenceDiagram
autonumber
participant UI as Browser UI
participant SRV as Server
participant DB as Database
UI->>SRV: POST /login (credentials)
SRV->>DB: SELECT user
DB-->>SRV: row
SRV-->>UI: 200 OK, JWT
Note over UI,SRV: session established, JWT in cookieFlowchart with subgraphs + styling
flowchart TB
subgraph client["Client"]
UI["Browser UI"]
end
subgraph server["Server (Rust)"]
API["POST /api/v1/x"]
SVC["Service layer"]
end
UI -->|"HTTPS"| API
API --> SVC
classDef rust fill:#f8d7a0,stroke:#c47f17
class API,SVC rust
style server fill:#fff7e6,stroke:#c47f17State diagram
stateDiagram-v2
[*] --> Idle
Idle --> Active: start
Active --> Idle: end_turn
Active --> Cancelling: barge_in
Cancelling --> Idle: drained
Active --> PermissionPending: tool needs auth
PermissionPending --> Active: decidedClass diagram
classDiagram
class Order {
+UUID id
+Money total
+place()
+cancel()
}
class Item {
+UUID sku
+int quantity
}
Order "1" *-- "many" ItemA note on other diagram types
Mermaid also supports erDiagram, gantt, gitGraph, journey, pie,
mindmap, timeline, quadrantChart, sankey, xychart,
architecture-beta, block, kanban, packet, radar, and treemap. The
rules above (no unicode arrows, no ; in text, quote special-char labels,
avoid reserved ids) apply uniformly. For type-specific syntax see the
Mermaid docs.
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.

