MermaidGuard is a comprehensive linting, validation, and accessibility tool for Mermaid diagrams embedded within Markdown documentation. It allows engineering teams to enforce syntax correctness and accessibility standards (WCAG) across their documentation base, ensuring that diagrams are both valid and inclusive.
- Syntax Validation: Validates Mermaid diagram syntax using the official Mermaid parser.
- Accessibility (A11y): Enforces WCAG compliance (e.g., required titles and descriptions) for diagrams.
- Autofix: Automatically repairs common issues (e.g., injecting missing accessibility tags) with
--fix. - Configurable: Flexible configuration via
.mermaidguardrcorpackage.json. - CI/CD Ready: Strict mode and exit codes designed for pipeline integration.
# Install via pnpm (recommended)
pnpm add -D @mermaidguard/cli
# Or run directly with npx
npx mermaidguard "**/*.md"Run the linter on all Markdown files in your project:
npx mermaidguardFix accessibility issues automatically:
npx mermaidguard --fixFull documentation is available in the docs/ directory:
- Installation - Requirements and installation steps.
- Setup & Configuration - Environment variables and config files.
- First Run - "Golden path" for your first execution.
- Functionality - Detailed breakdown of rules and autofix.
- CLI & API - Command reference and programmatic usage.
- Architecture & Implementation - System design and module boundaries.
- Testing & Coverage - Running tests and checking coverage.
- Runtime: Node.js v20+
- Language: TypeScript
- Package Manager: pnpm (Monorepo)
- Testing: Vitest
- Linting: ESLint + Prettier
- Core Dependencies:
mermaid,unified,commander,zod
We welcome contributions! Please see CONTRIBUTING.md for details on our development workflow, submitting PRs, and coding standards.
Copyright (c) 2026. All rights reserved. (See Action Items).