/ramtoshiya:mermaid-checkfrom ramtoshiya
Run the real Mermaid parser over every Mermaid diagram before delivering it, instead of trusting a read-through. Use whenever you write or edit Mermaid anywhere: a `.mmd` file, a ```mermaid fenced block in a `.md` / README / docs page, or a diagram drafted in chat that will land in a file — even when the user only asked for "a diagram" and never mentioned validation. Also use when a user reports a Mermaid diagram that will not render, or when you are about to say a diagram "looks right". Covers `.mmd` files, whole Markdown documents with several blocks, and stdin; prints the parse error without the stack trace.
Ships in ramtoshiya. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Confirmed with @mermaid-js/[email protected] (npm 11.19.0) on 2026-10-15. When bumping the pin, update the
script and this line together, and re-run a passing and a failing diagram.
An agent reading its own Mermaid sees what it meant, not what the parser will read, and a diagram that "looks fine" then renders as a red error box. The parser's verdict is the only one that counts, in both directions: don't ship what it rejects, and don't "fix" what it accepts.
Finish the diagram in its real location: the .mmd file, or the ```mermaid block inside the Markdown
file.
Run the bundled checker on that file. <skill-dir> is the directory holding this SKILL.md:
sh <skill-dir>/scripts/mermaid-check.sh path/to/diagram.mmd # one diagram
sh <skill-dir>/scripts/mermaid-check.sh docs/architecture.md # every mermaid block in the file
printf '%s\n' "$diagram" | sh <skill-dir>/scripts/mermaid-check.sh - # diagram drafted in chat
A .md / .markdown / .mdx path is checked block by block (```mermaid, ~~~mermaid, :::mermaid
fences). Any other path is one diagram. Render output goes to a temp dir that is removed afterwards, so
nothing appears next to the source.
Read the exit code. 0 with an ok: line: every diagram parsed. 1: at least one failed and its parse
error is printed. 2: usage error, or a Markdown file with no mermaid block (check the fence spelling).
On failure, fix the diagram at its source and re-run until exit 0. A failing Markdown block is labelled
file:LINE, the file line of the block's first diagram line. Locate the fault by the printed snippet and
^ caret. Mermaid's own line N is where the parser stopped: the real line for a bad token, but a line
past the end for an unfinished construct such as an edge with no target, because the parser reads to the
end of input before it can tell.
npx --min-release-age=3 @mermaid-js/[email protected] <mmdc args>.
Use it directly only when the script is unavailable, keeping the flag before the package name: after
it, npx forwards the flag to mmdc, which exits 1 with unknown option. -i - reads stdin.
-o - -e svg writes to stdout and needs the explicit format. Exit 0 = parsed, 1 = parse error.
Bare npx @mermaid-js/mermaid-cli and npx -p ... mmdc are denied by the package guard hook, which requires an exact version for one-shot packages.mmdc -i doc.md -o out.md renders every block in one browser launch but stops
at the first block that fails and does not say which one. It also extracts only ``` and ::: fences, so a
fence. When the pass fails, or the file has one, it checks each extracted block alone, so every broken
block is reported with its file line.
mmdc call launches headless Chromium, about 6 s once cached: one call for a
clean Markdown file, one per block when something fails or a ~~~ fence is used. The very first call on a
machine downloads Chromium and can take more than two minutes, longer than a typical tool-call timeout. If
the check dies with neither a parse error nor an ok: line, re-run with a longer timeout rather than
concluding the diagram is broken.A -- oops then
B --> C) is a multi-line label, while B--> at line end followed by C-->D is the chain B --> C --> D.
Syntax is all the parser judges. Layout and whether the diagram matches the surrounding text are still
yours to check.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub ramtoshiya/skills --plugin ramtoshiya14 skills in this plugin
/excalidraw-boardUse when a user asks agents to read, draw, or export selected objects as PNG from a shared excalidraw.com room, or a collaborator references a room id, revision, and element ids. Uses separately installed excalidraw-board and, for PNG export, excalidraw-web-export commands./figma-restUse when reading anything out of a Figma design file — design tokens, colors, type/spacing scales, node structure, or rendered node images — and when a Figma MCP tool returns a rate-limit or "nothing selected" error. Prefer the REST API over the Figma MCP server, which is capped per seat./github-actions-authoringUse before creating or editing .github/workflows/*.yml, .github/workflows/*.yaml, action.yml, or action.yaml anywhere in a repository, even for a small non-version change. Verify every remote uses dependency against its official GitHub releases, enforce a 72-hour release cooldown, inspect compatibility and security, and pin original-repository commit SHAs. Never choose action versions from model memory.