mermaid-validation

Validate Mermaid diagram syntax in markdown files using a headless Node.js environment.

3|2|Updated May 12, 2026
One-click install
npx skills add https://github.com/kriscendobot/garden --skill mermaid-validation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mermaid-validation
Source: https://github.com/kriscendobot/garden/tree/main/skills/mermaid-validation
Command: npx skills add https://github.com/kriscendobot/garden --skill mermaid-validation

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires mermaid, jsdom.

What problem does it solve?

This skill prevents broken diagrams on GitHub by validating Mermaid syntax locally before you commit, avoiding the need for heavy browser-based rendering tools that often fail in containerized environments.

Core Features & Use Cases

  • Grammar Validation: Uses the official Mermaid parser to verify diagram syntax against the same rules GitHub uses.
  • Lightweight Execution: Operates using a headless Node.js environment with jsdom, avoiding the overhead and dependency issues of Chromium or Puppeteer.
  • Use Case: Before pushing a documentation update containing complex flowcharts or sequence diagrams, run this skill to ensure every diagram renders correctly and catch syntax errors early.

Quick Start

Run the mermaid-validation skill on the target markdown file to verify all embedded diagrams.

Frequently Asked Questions about mermaid-validation

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

FAQPage Schema
How do I validate Mermaid diagram syntax in markdown without a browser?

To validate Mermaid diagram syntax without a browser, use a headless Node.js environment with jsdom to parse markdown files and check diagrams against official grammar rules. This approach catches syntax errors locally before committing documentation updates.

Why do my Mermaid diagrams break when rendering on GitHub?

Mermaid diagrams break on GitHub due to invalid syntax that fails to parse against the platform's rendering rules. Validating diagram syntax locally using the official Mermaid parser before committing ensures diagrams render correctly and prevents broken documentation.

Can I check markdown files for Mermaid errors without using Puppeteer or Chromium?

Yes, you can check markdown files for Mermaid errors without Chromium or Puppeteer by using a lightweight headless Node.js environment with jsdom. This dependency-minimal approach uses the official parser to verify diagram syntax, avoiding heavy browser sandbox overhead.

What is the best way to automate flowchart validation for documentation workflows?

The best way to automate flowchart validation for documentation workflows is running a headless Node.js script to validate Mermaid syntax in markdown files. This ensures diagram integrity for GitHub rendering and catches complex sequence diagram errors early before pushing updates.

Does this lightweight Mermaid validation approach work in containerized environments?

Yes, this lightweight Mermaid validation approach works effectively in containerized environments. By operating through a headless Node.js environment with jsdom, it avoids the dependency issues and overhead of browser-based rendering tools that often fail within containers.