mermaid

Write and validate Mermaid diagrams that render on GitLab, GitHub, and Linear.

15|1|Updated Jan 3, 2026
One-click install
npx skills add https://github.com/fprochazka/claude-code-plugins --skill mermaid-fprochazka
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mermaid
Source: https://github.com/fprochazka/claude-code-plugins/tree/main/plugins/diagrams/skills/mermaid
Command: npx skills add https://github.com/fprochazka/claude-code-plugins --skill mermaid-fprochazka

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @mermaid-js/mermaid-cli, and includes references (resource) components.

What problem does it solve? Mermaid diagrams in plans, MR descriptions, and review comments often fail to render, break in dark mode, or exceed host size budgets, leaving readers with parse errors or hidden content. This Skill provides authoring rules, per-type guidance, and a render-and-look validation loop so diagrams survive both GitLab and GitHub renderers. ## Core Features & Use Cases - Diagram selection guidance: Decides whether a diagram is worth drawing at all and picks the right type (flowchart, sequenceDiagram, stateDiagram-v2, erDiagram) for the content. - Cross-renderer authoring rules: Enforces syntax that works on both GitLab and GitHub, including quoting labels, avoiding pinned themes, and respecting GitLab's 2000-character page budget. - Validation loop: Renders each diagram with mermaid-cli through a validator subagent that reports render status and clarity before the diagram ships. - Use Case: When writing an MR description that explains a retry race between services, use this Skill to draft a sequence diagram, validate it renders correctly, and inline it in the description. ## Quick Start Ask the AI to create a Mermaid sequence diagram showing the checkout flow and validate it renders before adding it to the MR description.

Frequently Asked Questions about mermaid

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

FAQPage Schema
How do I write a Mermaid diagram that renders on both GitLab and GitHub?▼

Quote any label containing punctuation, use the flowchart keyword instead of graph, write <br> rather than <br/>, and never pin a theme in the config block. Both hosts run mermaid 11.16.1, so these rules keep output consistent across renderers.

Which Mermaid diagram type should I use for my documentation?▼

Use flowchart for request paths and branching decisions, sequenceDiagram for time-ordered interactions between two to six participants, stateDiagram-v2 for one entity's lifecycle, and erDiagram for table cardinality in schema changes.

Why does my Mermaid diagram show a performance warning on GitLab?▼

GitLab auto-renders at most 2000 characters of mermaid per page across all fences, and at most 50 blocks. Over budget the diagram is replaced by a warning with a Display button, so keep each diagram under about 700 characters and at most three per page.

Why does my Mermaid diagram look wrong in dark mode?▼

A pinned theme in the diagram's config block overrides the host's reader-based theme, producing a light diagram on a dark page with low-contrast titles and message labels. Remove the theme line entirely and let GitLab or GitHub pick the theme.

How do I install mmdc to validate Mermaid diagrams locally?▼

Install it globally with npm install -g @mermaid-js/mermaid-cli, then verify with command -v mmdc and mmdc --version. Do not rely on npx cache, and use a puppeteer config with --no-sandbox if Chromium fails to launch in containers or as root.

When should I avoid using a Mermaid diagram?▼

Write text instead when the relationship is linear, there are fewer than three nodes, the content is a data structure, or the reader needs exact values like timeouts. Also avoid beta types like architecture-beta and block-beta, which render non-deterministically or have open regressions.