Skip to content
Agentmart
Submit a tool

validate-mermaid

Validate Mermaid diagrams in Markdown, MDX, HTML, and standalone Mermaid files using Mermaid's own parser.

Skill by RoyalBis

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/royalbis-validate-mermaid

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Validate Mermaid diagrams in Markdown, MDX, HTML, and standalone Mermaid files using Mermaid's own parser. Use when an agent creates or edits Mermaid diagrams, when a browser reports "Syntax error in text", or before publishing generated docs and reports.

Use cases: documents, frontend, agent-building

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Python package

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/validate-mermaid

What's inside

Skill name
validate-mermaid
Description
Validate Mermaid diagrams in Markdown, MDX, HTML, and standalone Mermaid files using Mermaid's own parser. Use when an agent creates or edits Mermaid diagrams, when a browser reports "Syntax error in text", or before publishing generated docs and reports.
License
MIT
Instructions
37 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Files (5)

  • SKILL.md
  • openai.yaml · agents/
  • validate.mjs · scripts/
  • validate.py · scripts/
  • test_validate_mermaid.py · tests/

SKILL.md (first lines)

# Validate Mermaid

Run Mermaid's parser over diagrams before treating their source as complete. This catches grammar errors with the same parser family used by the browser instead of relying on visual inspection or a Markdown parser that does not understand Mermaid.

## Validate

From this skill's directory, run:

```bash
python3 scripts/validate.py <file-or-directory>
```

Add `--recursive` when a directory tree should be scanned:

```bash
python3 scripts/validate.py --recursive <directory>
```

The command reads Mermaid fences in `.md`, `.markdown`, and `.mdx`; elements with the `mermaid` class in `.html` and `.htm`; and complete diagrams in `.mmd` and `.mermaid` files. Recursive scans skip `.git`, other version-control metadata, virtual environments, and `node_modules`.

Use the Mermaid version that will render the document. Exact versions in HTML imports are detected automatically. For another renderer, pass its exact version explicitly:

```bash
python3 scripts/validate.py --mermaid-version 11.16.1 <path>
```

Files without a detectable renderer version use Mermaid 11.16.1. The first run for a version installs Mermaid and JSDOM into `~/.cache/validate-mermaid`; it does not add packages to the user's repository.

## Handle results

The validator prints each diagram's file and starting line. It exits non-zero when a diagram is invalid, a requested path cannot be read, no supported documents are found, or the scanned documents contain no Mermaid diagrams.

When diagram changes are part of the current task, fix every reported syntax error and rerun the same command until it succeeds. When the user asked only for validation, report the errors without changing their files.

Report the command, Mermaid version, number of diagrams, and whether validation passed. Do not claim that syntax validation proves browser rendering: CDN loading, fonts, sizing, theme behaviour, and layout still require a browser check.

From RoyalBis/mattpocock-skills, MIT.

More from RoyalBis/mattpocock-skills

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Aug 19, 2026 (2 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from RoyalBis

Cite this page

validate-mermaid skill. Agent Mart. https://agentmart.dev/skills/royalbis-validate-mermaid (last updated 2026-10-24)