Validate Mermaid diagrams in markdown files using @probelabs/maid. Use when user asks to validate mermaid, check diagrams, or validate markdown documentation.
Validate Mermaid diagrams in markdown files using @probelabs/maid for GitHub-compatible rendering.
# 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 "{}"
| Issue | Invalid | Valid |
|---|---|---|
| Pipe in label | A[text|desc] | A["text|desc"] |
| Parentheses | A[Name (X)] | A["Name (X)"] |
| Leading slash | A[/path] | A["/path"] |
| Arrow syntax | A -> B | A --> B |
| Arrow in label | A[text -> val] | A["text to val"] |
| Brackets | A[items[]] | A["items[]"] |
Rule: When in doubt, wrap labels in double quotes: A["any text here"]
# Auto-fix common issues
npx @probelabs/maid "docs/**/*.md" --fix
0 - All diagrams valid1 - Validation errors found- run: npx @probelabs/maid "docs/**/*.md"
mermaid-check:
glob: "docs/**/*.md"
run: npx @probelabs/maid {staged_files}