MCPInstall

mermaid

Generates Mermaid diagrams from codebases, topics, files, conversations, or specs. Supports flowcharts, sequence diagrams, class diagrams, state diagrams, ER diagrams, C4 architecture, mindmaps, Gantt charts, timelines, user journeys, gitGraphs, pie charts, quadrant charts, requirement diagrams, and beta types (xychart, sankey, block, architecture). Use when asked to create a Mermaid diagram, visualize a process or system, draw a flowchart, sequence diagram, class diagram, state machine, ERD, architecture diagram, mind map, timeline, Gantt chart, user journey, git branching graph, or any "diagram this" request.

Installs
60
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/mblode/agent-skills --skill mermaid
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads mermaid automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Mermaid

Produce a valid, well-structured Mermaid diagram from the user's source material and intent. Pick the right diagram type, keep it readable, and emit it in a fenced mermaid code block.

Reference Files

FileRead When
references/diagram-selection.mdDefault: choosing the right diagram type; one-line samples for each
references/common-diagrams.mdGenerating flowchart, sequence, class, state, ER, or C4 diagrams
references/specialized-diagrams.mdGenerating mindmap, gantt, timeline, journey, gitGraph, pie, quadrant, requirement, xychart, sankey, block, or architecture diagrams
references/generation-guidelines.mdAny diagram: label limits, structure rules, source-type strategies, anti-patterns
references/styling-and-output.mdTheming, classDef styling, frontmatter config, export, rendering targets

Workflow

Copy this checklist to track progress:

Mermaid progress:
- [ ] Step 1: Pick diagram type
- [ ] Step 2: Gather source material
- [ ] Step 3: Draft structure
- [ ] Step 4: Generate Mermaid syntax
- [ ] Step 5: Validate
- [ ] Step 6: Present output

Step 1: Pick diagram type

If the user named a type (e.g. "sequence diagram"), use it. Otherwise load references/diagram-selection.md and pick from its matrix. Common defaults:

ContentDiagram
Process with decisions, branching logicflowchart
Messages between actors/systems over timesequenceDiagram
States and transitions (order lifecycle, workflow)stateDiagram-v2
Database / domain entities with relationshipserDiagram
System architecture by levelC4Context / C4Container / C4Component
Concept hierarchy, brainstorm, overviewmindmap

Ask the user to confirm only if two types fit equally well.

Step 2: Gather source material

For topics or specs, ask one clarifying question if scope is ambiguous (e.g., "overview or detailed breakdown?"), then commit. For codebases, files, or conversations, pull only what's needed to name the nodes and relationships — don't scan more than needed.

Step 3: Draft structure

Sketch the diagram's bones before writing syntax:

  • List the nodes/entities/steps.
  • List the relationships/messages/transitions.
  • For flowchart, sequence, state: identify start and end. For ER, class: identify multiplicity. For C4: pick the right level.
  • Apply the size and label rules in references/generation-guidelines.md — typically 5-20 nodes for readability.

Step 4: Generate Mermaid syntax

Open the relevant reference file for the chosen type and write the diagram inside a fenced mermaid code block. Keep syntax minimal; add styling only when requested (see references/styling-and-output.md).

Step 5: Validate

Run the common checks below, plus type-specific checks from the corresponding reference file. Revise and re-check if any fail.

Common checks:

  • First line declares the correct diagram type (e.g. flowchart TD, sequenceDiagram)
  • No unescaped ()[]{} or stray colons inside plain text labels
  • No blank lines inside the diagram block (breaks some renderers)
  • Every referenced node / participant / entity is defined before use where required
  • Direction and flow are consistent (top-down or left-right, not both)
  • Label text is short enough to render (aim for under 6 words; see per-type rules)
  • Total size is within the readable limit for the type (15-20 for flowchart/class; up to 40 for mindmap)

Step 6: Present output

Output the diagram in a fenced mermaid code block. Note where it renders: GitHub/GitLab markdown, Mermaid Live Editor (mermaid.live), Notion, Obsidian, VS Code with a Mermaid preview extension.

If the user requests a file, write to a .md file containing the fenced block. For image export, point them to Mermaid Live Editor or @mermaid-js/mermaid-cli (see references/styling-and-output.md).

Translation examples

How to turn typical source material into a diagram. Pattern: identify the type first, then extract nouns (nodes) and verbs (edges / transitions).

Prose → sequenceDiagram

Source: "User hits Checkout. Server validates the cart, reserves stock, and charges Stripe. On success, the order is saved and a confirmation email is queued."

sequenceDiagram
    actor User
    participant Server
    participant Stripe
    participant Email
    User->>+Server: POST /checkout
    Server->>Server: Validate cart
    Server->>Server: Reserve stock
    Server->>+Stripe: Charge
    Stripe-->>-Server: Success
    Server->>Server: Save order
    Server->>+Email: Queue confirmation
    Email-->>-Server: Queued
    Server-->>-User: 200 Order confirmed

Spec → stateDiagram

Source: "Orders start as Pending. Payment success moves to Paid; failure moves to Cancelled. Paid orders ship, then complete. Cancelled orders are terminal."

stateDiagram-v2
    [*] --> Pending
    Pending --> Paid : payment success
    Pending --> Cancelled : payment failed
    Paid --> Shipped : ship
    Shipped --> Completed : deliver
    Completed --> [*]
    Cancelled --> [*]

Scoring matrix → quadrantChart

Source: "Rate campaigns on reach (low/high) and engagement (low/high). A is high-reach, mid-engagement. B is low-reach, low-engagement. C is high-reach, high-engagement."

quadrantChart
    title Campaign reach vs engagement
    x-axis Low Reach --> High Reach
    y-axis Low Engagement --> High Engagement
    quadrant-1 Expand
    quadrant-2 Promote
    quadrant-3 Re-evaluate
    quadrant-4 Improve
    A: [0.8, 0.5]
    B: [0.2, 0.2]
    C: [0.8, 0.8]

Anti-patterns

  • Forcing everything into one diagram — split into multiple focused diagrams instead.
  • Sentences as labels — extract keywords or move detail into child nodes / notes.
  • Mixing two diagram types in one fenced block (not supported).
  • Icons or Font Awesome references when the rendering target doesn't support them.
  • Over-styling before the structure is validated.
  • Guessing syntax — load the reference file for the chosen type.

Related skills

  • presentation-creator for slide decks that include diagrams
  • define-architecture for detailed architecture decisions beyond visual diagrams
  • docs-writing for embedding diagrams into technical documentation

FAQ

What does the mermaid skill do?

Generates Mermaid diagrams from codebases, topics, files, conversations, or specs. Supports flowcharts, sequence diagrams, class diagrams, state diagrams, ER diagrams, C4 architecture, mindmaps, Gantt charts, timelines, user journeys, gitGraphs, pie charts, quadrant charts, requirement diagrams, and beta types (xychart, sankey, block, architecture). Use when asked to create a Mermaid diagram, visualize a process or system, draw a flowchart, sequence diagram, class diagram, state machine, ERD, architecture diagram, mind map, timeline, Gantt chart, user journey, git branching graph, or any "diagram this" request.

How do I install mermaid?

Run npx skills add https://github.com/mblode/agent-skills --skill mermaid in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/mermaid/ (personal) or .claude/skills/mermaid/ (project).

Which AI agents can use mermaid?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is mermaid safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains mermaid?

It is published by mblode in mblode/agent-skills. It has 60 recorded installs.

More from mblode/agent-skills

View all →

ui-animation

mblode/agent-skills

Builds, reviews, and measures UI motion, including springs, gestures, scroll effects, curve fitting from recordings, and sparse interface sound. Use when asked to "add animation", "match this easing", "reverse engineer this motion", "add a click sound", or find animation opportunities.

Frontend & Design10.5K installs

multi-tenant-architecture

mblode/agent-skills

Designs tenant isolation, hostname routing, custom-domain lifecycle, and plan limits on Cloudflare or Vercel. Use when asked to "isolate tenant data", "support custom domains", "build a white-label platform", or assess PSL registration. For general module structure use codebase-architecture; for SEO content use seo.

ui-design

mblode/agent-skills

Designs and builds React/Next/Tailwind UI, audits visual and interaction defects, and stress-tests components with worst-case data. Use when asked to "build a landing page", "extract our design system", "add dark mode", "make this responsive", "remove UI slop", "audit this component", "stress-test this component", "break this UI", or "show me the worst case".

Frontend & Design1.4K installs

typography-audit

mblode/agent-skills

Audits font loading, type scales, measure, spacing, OpenType, and rendered punctuation with 78 scoped rules. Use when asked to "audit typography", "fix the fonts", or "review my type system". For a new visual direction use ui-design Direction; for general UI defects use ui-design Audit.

agent-skills-creator

mblode/agent-skills

Creates and improves portable Agent Skills with a validator, routing scenarios, and evidence-based keep, cut, merge, or retire decisions. Use when asked to "write a skill", "update all skills", "audit my SKILL.md", "remove redundant instructions", or fix skill triggering.

AI & Agents965 installs

docs-writing

mblode/agent-skills

Writes and audits technical docs with Diataxis type gating, runnable examples, and 51 documentation rules. Use when asked to "review my docs", "write an API reference", or improve a documentation page. For a whole README use readme-creator; for agent instructions use agents-md.

Docs & Writing948 installs

Popular docs & writing skills

View category →

grill-with-docs

mattpocock/skills

A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.

Docs & Writing1.2M installs

lark-markdown

open.feishu.cn

飞书 Markdown:查看、创建、上传、编辑和比较飞书中的原生 Markdown 文件。当用户要操作飞书 Markdown 文件,或比较其远端版本及本地草稿时使用。纯本地 Markdown 文件操作不触发本 skill。不负责将 Markdown 导入为飞书在线文档,也不负责文件搜索、权限、评论、移动、删除等云空间管理操作。

Docs & Writing778.7K installs

writing-beats

mattpocock/skills

Writing, exploit; assemble raw material into a journey of beats, grounding each term before a beat leans on it.

Docs & Writing490.7K installs

writing-shape

mattpocock/skills

Writing, exploit: shape raw material into an article, paragraph by paragraph.

Docs & Writing490.2K installs

writing-fragments

mattpocock/skills

Writing, explore: mine raw fragments, no structure yet.

Docs & Writing489.6K installs

writing-for-agents

mattpocock/skills

Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.

Docs & Writing479.3K installs