mermaid

mermaid is a skill for Claude Code, Codex from fmind/dot. It costs 44 tokens per session (876 once invoked), scanned A, original, MIT.

A guide to creating Mermaid diagrams, which are editable diagrams written as text and rendered in tools such as GitHub and documentation sites.

In plain words
What is it for?
Use it to choose a diagram type, write compatible Mermaid source, apply themes, validate it, and embed it in documentation or presentations.
Why use it?
It keeps diagrams portable, reviewable, and close to the prose they explain while avoiding visuals that add little value.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/fmind/dot/mermaid
Any agent
npx skills add fmind/dot --skill mermaid
Clone the repo
git clone --depth 1 https://github.com/fmind/dot

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mermaid

README.md
[![agentmods](https://agentmods.dev/badge/skills/fmind/dot/mermaid.svg)](https://agentmods.dev/skills/fmind/dot/mermaid)
Your own site
<a href="https://agentmods.dev/skills/fmind/dot/mermaid"><img src="https://agentmods.dev/badge/skills/fmind/dot/mermaid.svg" alt="Measured on agentmods" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 876 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00044 $0.00876
Opus 5 $0.00022 $0.00438
Sonnet 5 $0.00009 $0.00175
Haiku 4.5 $0.00004 $0.00088

Measured yesterday against content hash 51d5eba3cd29, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mermaid scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/mermaid/SKILL.md · 44 lines

How it starts

The opening of the file, as written. The whole thing — 44 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Mermaid Diagram Standard

Mermaid is the default diagram format because the same editable text renders in GitHub Markdown, Hugo sites (Hextra bundles it), and Slidev decks. Keep the source portable, reviewable, and close to the prose it explains; the choice between Mermaid, D2, LikeC4, or no diagram lives in fmind-visuals.

Workflow

  1. State the thesis: one visual claim and the reader decision it supports; omit the diagram when prose, code, a list, or a table is more direct.

  2. Pick a stable type: prefer flowchart, sequenceDiagram, stateDiagram-v2, classDiagram, and erDiagram; avoid a newly released type until every target renderer's Mermaid version supports it (GitHub reports its version from a block containing info).

  3. Write portable source: a fenced mermaid block when the diagram belongs to one Markdown document, a .mmd file when it is reused or rendered independently; keep labels short, direction intentional, and the node count readable without zooming.

  4. Configure in frontmatter: put configuration in Mermaid frontmatter, never in %%{init: ...}%% directives or renderer-specific fence options; apply the Fmind theme from fmind-theme when the work represents Médéric or www.fmind.dev.

  5. Validate and render:

    mmdc -i diagram.mmd -o diagram.svg -b transparent
    
  6. Inspect the render: clipping, line crossings, contrast, spelling, label density, and mobile or slide readability.

  7. Ship the source: keep the Mermaid text; add SVG only when the target cannot render Mermaid and PNG only when a platform requires raster output, and add accTitle and accDescr or surrounding prose so the conclusion survives without the image.

Gotchas

  • No browser found: mmdc fails with Could not find chrome-headless-shell when the Puppeteer download is absent; point it at system Chrome: PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome mmdc -i diagram.mmd -o diagram.svg.
  • Clipped labels: set one renderer-stable font stack through root-level config.fontFamily; late-loading web fonts change label measurements after layout and clip inside fixed bounds.
  • Deprecated option: flowchart.htmlLabels is deprecated; do not add it to new diagrams.
  • Non-portable features: keep remote images, custom JavaScript, click callbacks, and renderer plugins out of shared source.
  • Dense diagrams: split into views instead of shrinking labels; left-to-right for slide-sized processes, top-to-bottom for document hierarchies.
  • Invented structure: preserve source terminology; never add metrics, components, trust boundaries, or causal links the evidence does not show.

Read the full file on GitHub · 44 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 44 lines · 44 tokens per session scan A 51d5eba3cd29

Subscribe to this mod's changes

mermaid is a skill published in the GitHub repository fmind/dot (4 stars, last pushed today), licensed MIT. It adds 44 tokens to every session and 876 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.