About mermaid
mermaid is a skill for creating Mermaid diagrams for chatbot and Markdown interfaces. It supports local syntax validation and image rendering through the Mermaid CLI, without calling a web service.
Key features
- 01Create Mermaid diagram code
- 02Support flowcharts, sequence, and state diagrams
- 03Validate syntax with the local CLI
- 04Render SVG, PNG, or PDF
- 05Follow diagram guidelines for chat interfaces
Use cases
- 01Write Markdown diagrams for chat responses
- 02Check whether diagram code is valid
- 03Export diagrams as images or PDF
- 04Adjust diagrams for readability in chat
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ ahgraber/ skills --skill mermaidAfter installing, type/mermaidin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
references/chatbot-mermaid-guidelines.mdscripts/render_mermaid.pyvalidate_mermaid.pyDetails
From the project READMEMermaid Diagrams for Chatbots
Use this skill to create Mermaid diagrams that render well in Markdown chat interfaces, validate their syntax locally, and render images without calling a web service.
Invocation Notice
- Inform the user when this skill is being invoked by name:
mermaid.
Workflow
- Identify the diagram type (flowchart, sequenceDiagram, stateDiagram-v2) based on the request.
- Draft Mermaid code in a fenced Markdown block using
mermaid. - Follow formatting conventions in
references/chatbot-mermaid-guidelines.md. - Validate the diagram using
scripts/validate_mermaid.py. - If the user wants an image file, render with
scripts/render_mermaid.py.
Scripts
scripts/validate_mermaid.py- Validate Mermaid code by invoking the local Mermaid CLI (
mmdc). - Use when you need to check whether Mermaid parses without errors.
- Validate Mermaid code by invoking the local Mermaid CLI (
scripts/render_mermaid.py- Render Mermaid to SVG/PNG/PDF using the local Mermaid CLI (
mmdc). - Prefer SVG for Markdown renderers when image embedding is required.
- Render Mermaid to SVG/PNG/PDF using the local Mermaid CLI (
Notes
- These scripts expect
mmdcto be available on PATH (Mermaid CLI). If missing, instruct the user to install it locally; do not use the Mermaid web service. - Dependencies are managed via inline
uvscript metadata in each Python script. Use--install-chromiumto bootstrap the Chromium binary via pyppeteer when needed. - Keep diagrams compact and readable in chat: avoid overly wide graphs, use short labels, and group related states.
- If the user asks for raw Markdown, return only the fenced
mermaidblock unless they ask for extra explanation.
Comments
Markdown supported