mermaid-validate

Renders Mermaid .mmd files with mmdc and reports diagram correctness and clarity.

15|1|Updated Jan 3, 2026
One-click install
npx skills add https://github.com/fprochazka/claude-code-plugins --skill mermaid-validate-fprochazka
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mermaid-validate
Source: https://github.com/fprochazka/claude-code-plugins/tree/main/plugins/diagrams/skills/mermaid-validate
Command: npx skills add https://github.com/fprochazka/claude-code-plugins --skill mermaid-validate-fprochazka

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires mermaid-cli.

What problem does it solve? Mermaid diagrams often contain syntax errors, unreadable labels, or text that vanishes on dark backgrounds, and authors cannot reliably judge their own output. This Skill renders a .mmd file to PNG on both light and dark backgrounds, inspects the images, and reports concrete problems without ever editing the source. ## Core Features & Use Cases - Syntax lint via render: Runs mmdc against the .mmd file so a parse error fails the render, and reports the verbatim error with the offending source line. - Dual-background visual check: Renders light and dark PNGs to catch text (titles, sequence labels, loop guards) that disappears on dark pages, usually caused by a pinned theme. - Clarity verdict: Checks for overlapping labels, reversed arrows, orphaned nodes, misplaced subgraph members, and whether a reader with no context could state what the diagram claims. - Use Case: A validator subagent spawned by the diagrams:mermaid workflow renders 'auth-flow.mmd', finds the title invisible on dark mode due to a pinned theme, and reports the fix to the authoring agent. ## Quick Start Ask the validator subagent to render and check the diagram in 'docs/architecture.mmd' and report whether it is correct and clear.

Frequently Asked Questions about mermaid-validate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate a Mermaid diagram file from the command line?▼

Run mmdc -q -i file.mmd -o out.png -s 2 to render the diagram; a syntax error makes mmdc exit 1 with the parse error on stderr and no output file. A successful render doubles as the lint check.

How to render Mermaid diagrams larger with mermaid-cli?▼

Use the -s scale flag, which is the only reliable size control: -s 2 produces 1568 px wide output and -s 3 produces 2352 px from the default 800 px viewport. Avoid -w, which on mermaid-cli 11.17.0 makes -s a no-op and only ever shrinks diagrams.

Why does Mermaid text disappear on dark backgrounds?▼

Titles, sequence-diagram message labels, and loop guards are painted onto the page background with no fill, so they vanish on dark pages. The usual cause is a pinned theme: line in the source, which overrides the host's light/dark choice.

Why does mmdc fail with 'No usable sandbox' error?▼

This Chromium launch failure happens under kernel user-namespace restrictions, not because of the diagram. Write {"args": ["--no-sandbox", "--disable-dev-shm-usage"]} to a pptr.json file and retry with mmdc -p pptr.json.

Can the mermaid validator fix diagram syntax errors automatically?▼

No, the validator never edits the .mmd file. It reports the verbatim error and offending line, and the authoring agent that spawned it owns the source and decides what to change.