Agent skill

Mermaid Diagrams

by veelenga in veelenga/claude-mermaid

Creating and refining Mermaid diagrams with live reload. An agent skill from veelenga/claude-mermaid.

MITAuto-check passedDevelopment

Install Mermaid Diagrams

skills CLI
$ npx skills add veelenga/claude-mermaid --skill mermaid-diagrams -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install veelenga/claude-mermaid mermaid-diagrams --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/veelenga/claude-mermaid.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/mermaid-diagrams .claude/skills/mermaid-diagrams && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
mermaid-diagrams
GitHub stars
216
Token cost
~1.3k tokens
SKILL.md length
415 words
Files
1
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Creating and refining Mermaid diagrams with live reload. An agent skill from veelenga/claude-mermaid.

  • Works in 3 steps: Create Initial Diagram: Use… → Iterative Refinement: Make improvements… → Save Final Version: Use mermaid_save…
  • Users want flowcharts
  • SKILL.md covers Core Workflow, Tool Usage, Diagram Types and Best Practices, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Mermaid Diagrams is an agent skill from veelenga/claude-mermaid. Creating and refining Mermaid diagrams with live reload. Use when users want flowcharts, sequence diagrams, class diagrams, ER diagrams, state diagrams, or any other Mermaid visualization. Provides best practices for syntax, styling, and the iterative workflow using mermaidpreview and mermaidsave tools.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Diagrams. It works with Mermaid and Model Context Protocol. The repository describes itself as: MCP Server to previewing mermaid diagrams with live reload. The licence is MIT.

When your agent uses it

  • Users want flowcharts
  • Sequence diagrams
  • Any other Mermaid visualization

Example prompts

  • “/mermaid-diagrams”

Requirements

  • Pre-approved tools (allowed-tools): mcp__mermaid__mermaid_preview, mcp__mermaid__mermaid_save

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Create Initial Diagram: Use mermaid_preview to render and open the diagram with live reload
  2. Iterative Refinement: Make improvements - the browser will auto-refresh
  3. Save Final Version: Use mermaid_save when satisfied

What it can do on your machine

Read from SKILL.md and the folder at commit d4f8a89. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • mcp__mermaid__mermaid_preview
    • mcp__mermaid__mermaid_save

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are mermaid).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Mermaid Diagrams loads about 1.3k tokens when it runs. Until then it costs about 81 tokens; SKILL.md has 415 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~81
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from veelenga/claude-mermaid at commit d4f8a89, republished under its MIT licence (© veelenga). 415 words, ~1,274 tokens.

Download SKILL.mdSave it as .claude/skills/mermaid-diagrams/SKILL.md (or your agent's skills folder).
name
mermaid-diagrams
description
Creating and refining Mermaid diagrams with live reload. Use when users want flowcharts, sequence diagrams, class diagrams, ER diagrams, state diagrams, or any other Mermaid visualization. Provides best practices for syntax, styling, and the iterative workflow using mermaid_preview and mermaid_save tools.
allowed-tools
mcp__mermaid__mermaid_preview, mcp__mermaid__mermaid_save

Mermaid Diagram Expert

You are an expert at creating, refining, and optimizing Mermaid diagrams using the MCP server tools.

Core Workflow

  1. Create Initial Diagram: Use mermaid_preview to render and open the diagram with live reload
  2. Iterative Refinement: Make improvements - the browser will auto-refresh
  3. Save Final Version: Use mermaid_save when satisfied

Tool Usage

mermaid_preview

Always use this when creating or updating diagrams:

  • diagram: The Mermaid code
  • preview_id: Descriptive kebab-case ID (e.g., auth-flow, architecture)
  • format: Use svg for live reload (default)
  • theme: default, forest, dark, or neutral
  • background: white, transparent, or hex colors
  • width, height, scale: Adjust for quality/size

Key Points:

  • Reuse the same preview_id for refinements to update the same browser tab
  • Use different IDs for multiple simultaneous diagrams
  • Live reload only works with SVG format
mermaid_save

Use after the diagram is finalized:

  • save_path: Where to save (e.g., ./docs/diagram.svg)
  • preview_id: Must match the preview ID used earlier
  • format: Must match format from preview

Diagram Types

Flowcharts (graph or flowchart)

Direction: LR, TB, RL, BT

mermaid
graph LR
    A[Start] --> B{Decision}
    B -->|Yes| C[Action]
    B -->|No| D[End]

    style A fill:#e1f5ff
    style C fill:#d4edda
Sequence Diagrams (sequenceDiagram)

⚠️ Do NOT use style statements - not supported

mermaid
sequenceDiagram
    participant User
    participant App
    participant API

    User->>App: Login
    App->>API: Authenticate
    API-->>App: Token
    App-->>User: Success
Class Diagrams (classDiagram)
mermaid
classDiagram
    class User {
        +String name
        +String email
        +login()
    }
    class Order {
        +int id
        +Date created
    }
    User "1" --> "*" Order
Entity Relationship (erDiagram)
mermaid
erDiagram
    USER ||--o{ ORDER : places
    ORDER ||--|{ LINE_ITEM : contains

    USER {
        int id PK
        string email
        string name
    }
State Diagrams (stateDiagram-v2)
mermaid
stateDiagram-v2
    [*] --> Idle
    Idle --> Processing : start
    Processing --> Complete : finish
    Complete --> [*]
Gantt Charts (gantt)
mermaid
gantt
    title Project Timeline
    section Phase 1
    Task 1 :a1, 2024-01-01, 30d
    Task 2 :after a1, 20d

Best Practices

Preview IDs
  • Use descriptive names: architecture, auth-flow, data-model
  • Keep the same ID during refinements
  • Use different IDs for concurrent diagrams
Themes & Styling
  • default: Clean, professional
  • forest: Green tones
  • dark: Dark background
  • neutral: Grayscale

Use transparent background for docs, white for standalone

Common Patterns

System Architecture:

mermaid
graph TB
    Client[Web App]
    API[API Gateway]
    DB[(Database)]

    Client --> API --> DB

Authentication Flow:

mermaid
sequenceDiagram
    User->>App: Login Request
    App->>Auth: Validate
    Auth-->>App: JWT Token
    App-->>User: Access Granted
Show full SKILL.md (178 more words)Show less

User Interaction

When a user requests a diagram:

  1. Clarify if needed: What type? What level of detail?
  2. Choose diagram type:
    • Process/workflow → Flowchart
    • System interactions → Sequence
    • Code structure → Class
    • Database → ER
    • Timeline → Gantt
  3. Create with preview: Use descriptive preview_id, start with good defaults
  4. Iterate: Keep same preview_id, explain changes
  5. Save: Ask where/what format, use mermaid_save

Proactive Behavior

  • Always preview diagrams, don't just generate code
  • Use sensible defaults without asking
  • Reuse preview_id for refinements
  • Suggest improvements when you see opportunities
  • Explain your diagram type choice briefly

Common Issues

Syntax errors: Check quotes, arrow syntax, keywords Layout issues: Try different directions (LR vs TB) Text overlap: Increase dimensions or shorten labels Colors not working: Verify CSS color format; remember sequence diagrams don't support styles

Example Interaction

User: "Create an auth flow diagram"

You: "I'll create a sequence diagram showing the authentication flow." [Use mermaid_preview with preview_id="auth-flow"]

User: "Add database and error handling"

You: "I'll add database interaction and error paths." [Use mermaid_preview with same preview_id - browser auto-refreshes]

User: "Save it"

You: "Saving to ./docs/auth-flow.svg" [Use mermaid_save]

© veelenga, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/mermaid-diagrams of veelenga/claude-mermaid.

Open the folder on GitHubat commit d4f8a89

Compare with similar skills

Mermaid Diagrams next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Mermaid Diagrams compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Mermaid Diagrams this skillveelenga/claude-mermaid216—~1.3kAutomated safety check: PassMIT
Excalidraw Skillyctimlin/mcp_excalidraw2.5k—~4.6kAutomated safety check: PassMIT
GitDiagram Repository Overviewahmedkhaleel2004/gitdiagram18k—~427Automated safety check: PassMIT
Drawiobahayonghang/drawio-skills287—~4.1kAutomated safety check: NotesMIT
Excalidraw Canvas Toolkitlingzhi227/agent-research-skills390—~3.8kAutomated safety check: PassNone
Excalidraw Diagram DesignBV-Venky/excalidraw-architect-mcp158—~1.6kAutomated safety check: PassMIT

Similar skills

  • Excalidraw Skill

    yctimlin/mcp_excalidraw

    Excalidraw canvas toolkit for creating, editing, and refining diagrams on a live canvas.

    2.5k GitHub stars~4.6k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • GitDiagram Repository Overview

    ahmedkhaleel2004/gitdiagram

    Explains the architecture of a public GitHub repository through GitDiagram: how the code is organized, the main components with paths, and a Mermaid diagram.

    18k GitHub stars~427 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Drawio

    bahayonghang/drawio-skills

    Create, edit, replicate, import, and export draw.io diagrams with an offline YAML-first workflow: architecture, network topologies, flowcharts, UML/ER, org charts, Mermaid/CSV conversion, existing…

    287 GitHub stars~4.1k tokensUpdated 1 mo ago
    DevelopmentAuto-check: notes
  • Excalidraw Canvas Toolkit

    lingzhi227/agent-research-skills

    Draws and refines Excalidraw diagrams on a live canvas through MCP tools or a REST API, with screenshots, file import and export, snapshots and Mermaid conversion.

    390 GitHub stars~3.8k tokensUpdated 7 mo ago
    DevelopmentAuto-check passed
  • Excalidraw Diagram Design

    BV-Venky/excalidraw-architect-mcp

    Guide for structuring graph input (nodes and edges) for the Excalidraw Architect MCP tool to produce clean, readable diagrams.

    158 GitHub stars~1.6k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Uml Diagrams

    antoinebou12/uml-mcp

    Create and validate diagrams with the uml-mcp MCP server (generateuml, generateumlimage, validateuml, listdiagramtypes, generateumlbatch).

    105 GitHub stars~1.3k tokensUpdated today
    DevelopmentAuto-check passed

Categories

Questions about Mermaid Diagrams

What does Mermaid Diagrams do?

Creating and refining Mermaid diagrams with live reload. An agent skill from veelenga/claude-mermaid. Mermaid Diagrams is an agent skill from veelenga/claude-mermaid. Creating and refining Mermaid diagrams with live reload.

When should I use Mermaid Diagrams?

Mermaid Diagrams fits situations like: users want flowcharts; sequence diagrams; any other Mermaid visualization.

How do I install Mermaid Diagrams in Claude Code?

Run `npx skills add veelenga/claude-mermaid --skill mermaid-diagrams -a claude-code`. Or copy the skill folder (skills/mermaid-diagrams in veelenga/claude-mermaid) into .claude/skills/mermaid-diagrams in your project. Claude Code loads it when a task matches its description.

How do I install Mermaid Diagrams in Codex?

Run `npx skills add veelenga/claude-mermaid --skill mermaid-diagrams -a codex`. Or copy the skill folder (skills/mermaid-diagrams in veelenga/claude-mermaid) into .agents/skills/mermaid-diagrams in your project. Codex loads it when a task matches its description.

Can I use Mermaid Diagrams in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add veelenga/claude-mermaid --skill mermaid-diagrams -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mermaid-diagrams, .gemini/skills/mermaid-diagrams, .github/skills/mermaid-diagrams and .opencode/skills/mermaid-diagrams in your project.

What does Mermaid Diagrams need to run?

SKILL.md names no scripts, command-line tools or credentials: Mermaid Diagrams is instructions for the agent only. Its frontmatter pre-approves these tools: mcp__mermaid__mermaid_preview, mcp__mermaid__mermaid_save.

Does Mermaid Diagrams access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Mermaid Diagrams safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Mermaid Diagrams use?

Mermaid Diagrams is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Mermaid Diagrams use?

About 1.3k tokens (SKILL.md is roughly 5.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Mermaid Diagrams?

Skills that share tags, products or a category with Mermaid Diagrams: Excalidraw Skill (yctimlin/mcp_excalidraw, 2.5k stars), GitDiagram Repository Overview (ahmedkhaleel2004/gitdiagram, 18k stars), Drawio (bahayonghang/drawio-skills, 287 stars) and Excalidraw Canvas Toolkit (lingzhi227/agent-research-skills, 390 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Mermaid Diagrams?

veelenga (a GitHub user) maintains it in veelenga/claude-mermaid, which has 216 GitHub stars. The repository was last updated on October 7, 2026.

Source: veelenga/claude-mermaid on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.