mermaid-diagram

Generate Mermaid diagram code from user requirements and verify syntax with mmdc.

Updated May 20, 2026
One-click install
npx skills add https://github.com/lightrain-a/medtrace-aris --skill mermaid-diagram-lightrain-a
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mermaid-diagram
Source: https://github.com/lightrain-a/medtrace-aris/tree/main/.vendor/aris/skills/mermaid-diagram
Command: npx skills add https://github.com/lightrain-a/medtrace-aris --skill mermaid-diagram-lightrain-a

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps you quickly convert diagram requirements into correct, ready-to-render Mermaid syntax, reducing the time spent manually writing and debugging diagrams.

Core Features & Use Cases

  • Diagram-type selection from requirements: Automatically chooses among common Mermaid diagram types (flowcharts, sequence, class, ER, Gantt, and more) based on what you describe.
  • Generates both preview and raw sources: Saves Mermaid code as both figures/<diagram-name>.mmd (raw Mermaid) and figures/<diagram-name>.md (Markdown with an embedded mermaid block).
  • Mandatory syntax verification loop: Renders with the Mermaid CLI (mmdc) and iteratively fixes errors up to three refinement rounds.
  • Math-aware labels: Applies KaTeX $$...$$ rules when your diagram content includes formulas, Greek letters, subscripts/superscripts, matrices, and related notation.

Quick Start

Generate a validated Mermaid diagram for the following system behavior and save it under figures: a flowchart that shows how a patient’s lab results move from acquisition to storage and reporting, including decision points and error handling.

Frequently Asked Questions about mermaid-diagram

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

FAQPage Schema
How do I generate Mermaid diagrams from text requirements automatically?

Generating Mermaid diagrams from text involves providing a description of your system behavior or structure, which the tool converts into raw Mermaid code. It automatically selects diagram types like flowcharts or ER diagrams and saves the output as ready-to-render files.

Can I use KaTeX math formulas in Mermaid diagram labels?

Yes, you can use KaTeX math formulas in Mermaid diagram labels by applying $$...$$ syntax rules. The generation process supports math-aware labels for notations including Greek letters, subscripts, superscripts, and matrices within your diagrams.

How do I fix Mermaid syntax errors when rendering diagrams with mmdc?

To fix Mermaid syntax errors when rendering with mmdc, the tool runs a mandatory syntax verification loop that iteratively corrects rendering failures. It performs up to three refinement rounds to ensure the final diagram output is valid.

What is the best way to create architecture diagrams from requirements?

The best way to create architecture diagrams from requirements is using a Mermaid generator that converts your structural descriptions into validated code. It supports various formats like class diagrams and ER diagrams, saving raw sources and Markdown previews for visualizing system architecture.

Do I need to manually choose between flowcharts and sequence diagrams when describing a flow?

No, you do not need to manually choose between flowcharts and sequence diagrams when describing a flow. The tool automatically selects the appropriate Mermaid diagram type based on the requirements you provide, handling interactions, structures, and timelines automatically.