mermaid-diagram-fixer

Fix Mermaid syntax errors, validate diagrams, and apply pastel color themes.

Updated Aug 15, 2026
One-click install
npx skills add https://github.com/jacksonlee-tw/mystock-vue --skill mermaid-diagram-fixer-jacksonlee-tw
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mermaid-diagram-fixer
Source: https://github.com/jacksonlee-tw/mystock-vue/tree/main/mystock-analysis/.github/skills/mermaid-diagram-fixer
Command: npx skills add https://github.com/jacksonlee-tw/mystock-vue --skill mermaid-diagram-fixer-jacksonlee-tw

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Mermaid diagrams frequently fail to render due to syntax errors like multiple nodes on one line, unquoted labels, invalid node IDs, or missing end keywords, and default styling often looks inconsistent. This Skill systematically repairs broken Mermaid code, validates it with built-in tools, and applies a standardized pastel color scheme. ## Core Features & Use Cases - Syntax Error Repair: Fixes 11 common error patterns including multi-node lines, \n newlines (converted to <br/>), unquoted subgraph titles and edge labels, deprecated graph keyword, invalid node IDs, missing end, and wrong arrow syntax. - Mandatory Validation Workflow: Requires calling mermaid-diagram-validator after every fix, with up to 3 repair-revalidate rounds, plus optional mermaid-diagram-preview for visual confirmation. - Pastel Theme Standardization: Applies a semantic pastel color palette via style declarations for small diagrams (≤8 nodes) or classDef/class batch styling for larger ones, including subgraph borders. - Multi-Diagram Support: Covers flowchart, sequenceDiagram, erDiagram, and stateDiagram-v2 with Mermaid v11 compatibility notes. - Use Case: A user pastes a flowchart that shows "Syntax error in text" in their documentation. The Skill splits same-line nodes, quotes all labels, replaces graph TD with flowchart TD, applies pastel styling, validates the result, and outputs the corrected diagram with a fix summary. ## Quick Start Fix this Mermaid diagram that shows a syntax error and apply the pastel color theme to it.

Frequently Asked Questions about mermaid-diagram-fixer

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

FAQPage Schema
How do I fix a Mermaid syntax error in text?▼

Check for the most common causes: multiple nodes declared on one line, unquoted subgraph titles or edge labels, and node IDs containing hyphens or colons. Split each node onto its own line, wrap labels containing spaces or Chinese characters in double quotes, and rename IDs using camelCase or underscores.

How to add line breaks in Mermaid node labels?▼

Use <br/> for line breaks in Mermaid labels, never \n. The \n sequence is not supported in Mermaid v11 and renders as a literal string, so NODE["line1<br/>line2"] is the only correct form.

Does Mermaid v11 still support the graph keyword?▼

Mermaid v11 still parses graph TD/LR as legacy syntax, but flowchart is the recommended replacement. Migrating from graph to flowchart avoids deprecation warnings and ensures compatibility with newer diagram features.

Why does my Mermaid subgraph cause a parse error?▼

Subgraph parse errors usually come from unquoted titles containing spaces or colons, or a missing end keyword. Write subgraph G["My Title"] with double quotes and ensure every subgraph block is closed with end.

When should I use classDef instead of style in Mermaid?▼

Use individual style declarations when a diagram has 8 or fewer nodes, and switch to classDef with class assignments for larger diagrams. Batch classDef styling keeps large flowcharts maintainable and ensures consistent pastel coloring across many nodes.