mermaid
Skill4 starsChanged 8 days agoMITView on GitHub
Side-route utility skill for generating Mermaid diagram code from a description. Use when the user wants a flowchart, sequence diagram, class diagram, ER diagram, state machine, Gantt chart, mindmap, C4 architecture, user journey, or any of 23 supported Mermaid diagram types — often during /shape, /research, /write-a-prd, or /prd-to-issues when a visual would clarify scope, flow, or structure. Not for free-form ASCII sketches, hand-drawn whiteboards (use /excalidraw-diagram for that), or rendering diagrams to images.
44 other projects use a version of this, 6 of them edited.
Adopted by
Most recently taken up by
- lulufoo/lulu-boardtheir own version, first seen Nov 8, 2026
- puncsky/system-design-and-architecturetheir own version, first seen Nov 2, 2026
- lulufoo/lulu-drawertheir own version, first seen Nov 1, 2026
- Voronenko/ai-filestheir own version, first seen Nov 1, 2026
- bex-co/bextheir own version, first seen Oct 28, 2026
- yanickfischer/zhaw-bsc-latex-claude-skeletttheir own version, first seen Oct 15, 2026
Used with
Projects with it also use ansible, plantuml and 6 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.
julweberSkillansible
Ansible automation reference for playbooks, roles, inventory, variables, and modules. Includes Proxmox VE and Docker integration via community.general and community.docker collections. Use when writing playbooks, troubleshooting Ansible runs, or designing automation workflows. Triggers: ansible, playbook, inventory, role, task, handler, vars, jinja2, galaxy, proxmox_kvm, proxmox_lxc, docker_container, docker_compose.
Also in 3 projects that use this
xenodiumSkillplantuml
This skill should be used when the user invokes "/plantuml" to create a diagram from the current context using PlantUML and output the resulting image path.
Also in 3 projects that use this
ihiteshguptaSkillterraform
Expert in Infrastructure as Code with Terraform. Use for creating, managing, and versioning infrastructure across cloud providers.
Also in 3 projects that use this
PostHogSkillkarpathy-guidelines
Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid overcomplication, make surgical changes, surface assumptions, and define verifiable success criteria. Based on https://github.com/multica-ai/andrej-karpathy-skills.
Also in 3 projects that use this
AWSSkillship
Finalize dev work on an issue branch — update docs, push, and open a PR.
Also in 4 projects that use this
SentrySkillcommit
Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits with Sentry-specific issue references.
Also in 4 projects that use this
Other versions44 projects use a version of this.
Word for word · 1
- chrislacey89/content-to-skill★ 1100% same
Edited · 6
- WH-2099/mermaid-skill★ 26834% same
- Kripu77/software-factory★ 734% same
- blas1n/claude-skills★ 219% same
- MovGP0/Skills★ 134% same
- willlee1995/skills★ 134% same
- IsaacBell/ai-marketing-toolkit★ 034% same
Wrote their own version · 37
- puncsky/system-design-and-architecture★ 3.6ksame name
- alibaba/loongcollector★ 2.2ksame name
- chujianyun/skills★ 751same name
- bex-co/bex★ 576same name
- xenodium/emacs-skills★ 142same name
- mgifford/accessibility-skills★ 48same name
- nilecui/SkillsBase★ 27same name
- greedychipmunk/agent-skills★ 24same name
- ulises-jeremias/agent-toolkit★ 19same name
- soujava/agent-skills★ 10same name
27 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 repository36 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- api-design-reviewSkill
- closeoutSkill
- compoundSkill
- correct-courseSkill
- create-milestoneSkill
- design-an-interfaceSkill
- excavateSkill
- executeSkill
- fix-findingsSkill
- git-guardrails-claude-codeSkill
- hackathonSkill
- handoffSkill
- helpSkill
- improve-codebase-architectureSkill
- improve-pipelineSkill
- init-pipelineSkill
- lfgSkill
- prd-to-issuesSkill
- pre-mergeSkill
- prototypeSkill
- qaSkill
- re-pitchSkill
- request-refactor-planSkill
- researchSkill
- respond-to-reviewSkill
- setup-pre-commitSkill
- setup-ralph-loopSkill
- shapeSkill
- tddSkill
- triage-issueSkill
- ts-auditSkill
- ubiquitous-languageSkill
- visual-recapSkill
- walk-commitsSkill
- write-a-prdSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 5 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 40 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
Do not invoke when:
- Distinctive: line 77
Use syntax that renders without modification in standard Mermaid viewers (confirmed via Verification).
- Distinctive: line 78
Use semantic, human-readable node IDs and labels.
- Distinctive: line 80
Use styling only when it materially improves clarity.
- Very specific: line 100
Run from any shell. No install needed.
- Distinctive: line 118
If you generated a single diagram inline (no file yet), pipe it directly:
- Very specific: line 137
Quoting rule of thumb: if a node label contains *any* of (), [], <, >, :, =, ,, ;, &, or unbalanced quotes, wrap the whole label in double …
“Common” is measured: kept by at least 6 in 10 of the 40 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
Mermaid Diagram Generator
Adapted from WH-2099/mermaid-skill on 2026-05-15. Reference syntax docs are bundled under
references/and originate from the upstream Mermaid project. The## Verificationsection incorporates the render-check recipe and parse-pitfalls table from WH-2099/mermaid-skill#5 by @rajatarya.
Generate Mermaid diagram source that renders directly in GitHub, VS Code, Notion, and other Mermaid-aware viewers.
Invocation Position
Side-route utility. Mermaid is most useful inside other pipeline artifacts — a sequence diagram inside a PRD, a flowchart inside a research note, an ER diagram inside an issue body, a C4 diagram inside an architecture proposal. Invoke it directly when:
- The user explicitly asks for a Mermaid diagram, flowchart, sequence diagram, ER diagram, state machine, Gantt chart, etc.
- A pipeline skill (
/shape,/research,/write-a-prd,/prd-to-issues,/improve-codebase-architecture,/request-refactor-plan) would benefit from an embedded diagram and the user wants one.
Do not invoke when:
- The user wants a rough whiteboard sketch — use
/excalidraw-diagraminstead. - The user wants a rendered image file — Mermaid here produces source code, not PNGs.
- The diagram type is unsupported by Mermaid (e.g. arbitrary 2D illustrations).
This skill does not produce a GitHub artifact on its own and does not advance the pipeline. After producing the diagram, control returns to whichever skill or conversation invoked it.
Workflow
- Identify the diagram type. Map the user's description to one of the 23 supported types (see the table below). If the description is ambiguous (e.g. "show the flow"), ask one clarifying question — flow of what, between whom? Do not guess between flowchart vs. sequence vs. state diagram when the choice changes the diagram meaningfully.
- Read the matching reference file. Each diagram type has a syntax reference under
references/. Read it before generating code — Mermaid syntax is strict and version-sensitive, and the references are the source of truth. - Generate the code. Wrap output in a fenced ```mermaid block. Use semantic node IDs (
UserLogin, notA), readable labels, and direction/layout hints that match the diagram's purpose (flowchart TDfor top-down decision trees,flowchart LRfor pipelines, etc.). - Apply theming or directives only when they add clarity. See
references/config-theming.mdandreferences/config-directives.md. Defaults are usually fine; skip styling unless the user asked for it or the diagram is unreadable without it. - Verify rendering. Render every diagram with
mmdcbefore declaring the work complete — see Verification below. Mermaid syntax errors are silent in markdown viewers, so eyeballing is not enough.
Diagram Type Reference
| Type | Reference | Typical use |
| Flowchart | flowchart.md | Processes, decisions, pipelines |
| Sequence Diagram | sequenceDiagram.md | API calls, message flows, interactions |
| Class Diagram | classDiagram.md | Class structure, inheritance, associations |
| State Diagram | stateDiagram.md | State machines, transitions |
| ER Diagram | entityRelationshipDiagram.md | Database schema, entity relationships |
| Gantt Chart | gantt.md | Project timelines, scheduling |
| Pie Chart | pie.md | Proportions, distributions |
| Mindmap | mindmap.md | Hierarchical brainstorming |
| Timeline | timeline.md | Historical events, milestones |
| Git Graph | gitgraph.md | Branching, merges |
| Quadrant Chart | quadrantChart.md | 2×2 trade-off analysis |
| Requirement Diagram | requirementDiagram.md | Requirements traceability |
| C4 Diagram | c4.md | System architecture (C4 model) |
| Sankey Diagram | sankey.md | Flow volumes, conversions |
| XY Chart | xyChart.md | Line and bar charts |
| Block Diagram | block.md | System components, modules |
| Packet Diagram | packet.md | Network protocols, byte layouts |
| Kanban | kanban.md | Task boards |
| Architecture Diagram | architecture.md | Cloud / service architecture |
| Radar Chart | radar.md | Multi-dimensional comparison |
| Treemap | treemap.md | Hierarchical proportions |
| User Journey | userJourney.md | UX flows with sentiment |
| ZenUML | zenuml.md | Code-style sequence diagrams |
Configuration & Theming
- Theming — colors, fonts, custom themes
- Directives — per-diagram configuration
- Layouts — direction and spacing
- Configuration — global settings
- Math — LaTeX math support
- Tidy Tree — tidy-tree layout tuning
- Examples — curated examples across types
Output Specification
Generated Mermaid code must:
- Be wrapped in a ```mermaid fenced block.
- Use syntax that renders without modification in standard Mermaid viewers (confirmed via Verification).
- Use semantic, human-readable node IDs and labels.
- Be indented and line-broken for readability.
- Use styling only when it materially improves clarity.
- For sequence, state, and entity-relationship diagrams destined for a theme-aware viewer (GitHub, Notion, etc.), prepend the contrast-safe
%%{init: ...}%%directive fromreferences/contrast-for-github.md. Flowcharts and other diagram types do not need this — their default rendering reads correctly in both light and dark mode.
Example
flowchart TD
Start([User submits login]) --> Validate{Credentials valid?}
Validate -->|Yes| Session[Create session]
Validate -->|No| Reject[Return 401]
Session --> Home[Redirect to /home]
Reject --> StartVerification
Always render every diagram before declaring the work done. Mermaid produces syntax errors that markdown viewers swallow silently — verification is the only way to catch them.
Recipe
Run from any shell. No install needed; npx fetches mmdc (mermaid-cli) on first use.
# 1. Extract every ```mermaid fenced block from the target file into its own .mmd
awk '/^```mermaid$/{flag=1; n++; outfile=sprintf("/tmp/mmd-check-%d.mmd",n); next}
/^```$/ && flag{flag=0; next}
flag{print > outfile}' <PATH_TO_MARKDOWN_FILE>
# 2. Render each. Any parse error in the output means the diagram won't render.
for f in /tmp/mmd-check-*.mmd; do
echo "=== $f ==="
npx --yes -p @mermaid-js/mermaid-cli mmdc -i "$f" -o "${f%.mmd}.svg" 2>&1 \
| grep -E "Generating|Error|expecting|got " | head -5
doneA clean run prints Generating single mermaid chart for each block and writes an SVG. A broken block prints Error: Parse error on line N: Expecting ..., got ... — fix that block and re-run before moving on.
If you generated a single diagram inline (no file yet), pipe it directly:
echo 'graph TD
A --> B' | npx --yes -p @mermaid-js/mermaid-cli mmdc -i /dev/stdin -o /tmp/check.svgCommon parse pitfalls
| Symptom | Cause | Fix |
Parse error in participant X as ... alias | A + or - in the display name is parsed as activation/deactivation syntax | Spell out: replace + with and, drop - |
| Diamond/decision node won't render | Unquoted <= / >= / < / > in {...} — parser sees an HTML tag | Quote ({"end ≤ size"}) or use HTML entities |
Flowchart node label with (...) cuts off | Unquoted () inside [label] — parser ambiguity | Always quote: ["foo (bar)"] |
&& or stray & mangles the diagram | & is the HTML-entity start character | Use and, or escape as && |
Sequence-diagram message starting with { | Curly braces near : look like control structures | Replace with [...] or rewrite the message |
Nested unbalanced brackets in an arrow message (e.g. [a=[b]]) | Parser bails on the inner [ | Flatten to comma-separated text |
| Markdown links / wikilinks inside a node label | Not interpreted; renders as raw [[...]] | Move the link out of the diagram, or use plain text |
Quoting rule of thumb: if a node label contains any of (), [], <, >, :, =, ,, ;, &, or unbalanced quotes, wrap the whole label in double quotes (["..."] for rectangles, {"..."} for diamonds).
Contrast fast-check (theme-aware viewers only)
If the diagram type is sequence, state, or entity-relationship and the destination is a theme-aware viewer (GitHub, Notion, etc.), scan the fenced block for the contrast-safe %%{init: ...}%% directive described in references/contrast-for-github.md. 5-second visual check — no re-render required. mmdc's default theme matches the agent's local environment, not the reader's, so a clean parse does not imply readable text on a dark-mode page. See the reference for the per-diagram templates and an optional dark-render SVG inspection if you want belt-and-braces.
Handoff
- Expected input: A description of what the user wants to visualize, or an invoking skill that needs an embedded diagram.
- Produces: Mermaid source code in a fenced block, optionally followed by a one-line explanation of what the diagram shows.
- Comes next by default: Control returns to the invoking skill or conversation. If invoked standalone, the diagram is the final output unless the user asks for revisions.
- May redirect: Suggest
/excalidraw-diagramif the user really wants a free-form sketch rather than a structured Mermaid diagram.
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.

