mermaid-validator

v1.0.1

Validate Mermaid diagrams in markdown files using @probelabs/maid. Use when user asks to validate mermaid, check diagrams, or validate markdown documentation.

localskills install danhthanh418/mermaid-validator
6 downloads
Created Mar 26, 2026
SKILL.md

Mermaid Validator

Validate Mermaid diagrams in markdown files using @probelabs/maid for GitHub-compatible rendering.

When to Use

  • User asks to "validate mermaid", "check diagrams", or "validate markdown"
  • Before committing markdown files with mermaid diagrams
  • During code review of documentation changes

Workflow

1. Find & Validate

# Install if needed
npm ls @probelabs/maid || npm install -D @probelabs/maid

# Validate single file
npx @probelabs/maid <file>

# Validate all docs
find docs -name "*.md" | xargs -I{} npx @probelabs/maid "{}"

2. Common Fixes

IssueInvalidValid
Pipe in labelA[text|desc]A["text|desc"]
ParenthesesA[Name (X)]A["Name (X)"]
Leading slashA[/path]A["/path"]
Arrow syntaxA -> BA --> B
Arrow in labelA[text -> val]A["text to val"]
BracketsA[items[]]A["items[]"]

Rule: When in doubt, wrap labels in double quotes: A["any text here"]

3. Quick Fix All

# Auto-fix common issues
npx @probelabs/maid "docs/**/*.md" --fix

Exit Codes

  • 0 - All diagrams valid
  • 1 - Validation errors found

Integration

GitHub Actions

- run: npx @probelabs/maid "docs/**/*.md"

Lefthook

mermaid-check:
  glob: "docs/**/*.md"
  run: npx @probelabs/maid {staged_files}

Notes

  • @probelabs/maid is stricter than GitHub's renderer
  • Some warnings (e.g. sequence diagram activation) are acceptable
  • Always validate before committing markdown with diagrams