# Mermaid — card for AI agents

Markdown-like syntax for creating flowcharts, diagrams, and visualizations programmatically.

Category: Charts and data visualisation · npm package `mermaid` · latest version 12.2.0 (checked 2026-11-01)
Install: `npm install mermaid`
License: MIT (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (paste into AGENTS.md or CLAUDE.md)

## Mermaid
- Start every diagram with its type declaration, for example `flowchart LR` or `sequenceDiagram`.
- Never use lowercase `end` as a flowchart node ID or label; write `End` or `END`.
- If an edge label starts with `o` or `x`, add a leading space or capitalize it (`-->| ok|` or `-->|Ok|`) so it is not read as a circle or cross edge.
- Wrap node labels that contain parentheses, commas or semicolons in quotes: `A["This label has (parentheses)"]`.
- Define a node's label once and reference it by ID everywhere else.
- When upgrading, check the release notes for layout changes: with ELK, set `elk.orientFeedbackEdges: false` to keep the previous routing.

## Agent Skills for it
- mermaid-diagram from wanshuiyin/Auto-claude-code-research-in-sleep: `npx skills add wanshuiyin/Auto-claude-code-research-in-sleep --skill mermaid-diagram`
- mermaid-to-proverif from trailofbits/skills: `npx skills add trailofbits/skills --skill mermaid-to-proverif`
- mermaid-studio from tech-leads-club/agent-skills: `npx skills add tech-leads-club/agent-skills --skill mermaid-studio`
- mermaid-visualizer from breferrari/obsidian-mind: `npx skills add breferrari/obsidian-mind --skill mermaid-visualizer`
- mermaid-visualizer from axtonliu/axton-obsidian-visual-skills: `npx skills add axtonliu/axton-obsidian-visual-skills --skill mermaid-visualizer`
- mermaid-syntax from tractorjuice/arc-kit: `npx skills add tractorjuice/arc-kit --skill mermaid-syntax`

## Docs written for agents
- [llms.txt (index of the docs)](https://mermaid.ai/llms.txt)

## What it is
- Mermaid is a JavaScript library that renders text definitions as diagrams. The GitHub repository describes it as "generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown". It was created on 2014-11-01 and is MIT licensed. The README lists more than 20 diagram types, from flowcharts and sequence diagrams to Gantt, Git graph, mindmap and Sankey.
- You write a definition that starts with the diagram type, such as `flowchart LR`, and Mermaid lays it out and draws it. The README states the goal plainly: "to help documentation catch up with development". Because the source is plain text, it fits in version control. The README also says Mermaid code blocks render directly in Markdown on GitHub, and that Mermaid can be made part of production scripts.
- The name now covers two things. Mermaid.js is the free open-source library. Mermaid at mermaid.ai is a commercial product from Mermaid Chart Inc., built on top of it, with a visual editor, AI generation and team features. The llms.txt index says the core syntax is free and needs no paid plan. The free Mermaid Live Editor is aimed at anyone who wants to write and preview diagrams in a browser, including non-programmers.

## Caveats
- Lowercase `end` breaks flowcharts: The docs warn that `end` in all lowercase as a node ID or label breaks the flowchart parser. Use `End`, `END` or another word.
- Edge labels starting with o or x misparse: A label like `-->|ok|` is read as a circle or cross edge. The docs say to add a leading space or capitalize it. Labels with commas, semicolons or parentheses also need quotes.
- Minor releases can move your layout: A recent minor release added `elk.orientFeedbackEdges`, enabled by default, which changes how some existing ELK diagrams are routed. To keep the old routing you have to set the option to `false`.
- One name, two products: Official pages mix the MIT library with a commercial platform from Mermaid Chart Inc. Plan limits in the mermaid.ai docs, such as 3 diagrams on Basic, apply to that platform, not to the npm package.

## Numbers (AgentGid data)
- Gid Score: 81.4 (#77 of all tools, 3 of 95 in its category)
- Used in 74 public projects set up for AI coding agents (1.2%)
- Downloads last week: 28,707,819 (as of 2026-11-24), +51.3% over 4 weeks
- GitHub stars: 91,220 (as of 2026-11-24)
- Last push: 2026-11-23

## Often used with
remark-gfm 40.5%, jsdom 39.2%, React 68.9%, react-markdown 35.1%, Testing Library 36.5%, clsx 50.0%

## Checked alternatives (same job)
- Recharts: https://agentgid.com/tools/recharts/agent.md
- D3.js: https://agentgid.com/tools/d3/agent.md

## Links
- AgentGid page: https://agentgid.com/tools/mermaid/
- Homepage: https://github.com/mermaid-js/mermaid#readme
- Repository: https://github.com/mermaid-js/mermaid
- Source: https://github.com/mermaid-js/mermaid#readme
- Source: https://github.com/mermaid-js/mermaid
- Source: https://github.com/mermaid-js/mermaid/releases
- Source: https://mermaid.ai/llms.txt
- Source: https://mermaid.ai/docs/getting-started/create-first-diagram

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
