mermaid-diagram

Generate Mermaid diagrams from requirements and validate syntax with Mermaid CLI.

1|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/Lingrongye/federated-learning --skill mermaid-diagram-lingrongye
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mermaid-diagram
Source: https://github.com/Lingrongye/federated-learning/tree/main/Auto-claude-code-research-in-sleep/skills/mermaid-diagram
Command: npx skills add https://github.com/Lingrongye/federated-learning --skill mermaid-diagram-lingrongye

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates turning user requirements into Mermaid diagram code, saving time and ensuring syntax correctness. It outputs both raw Mermaid source and a Markdown preview, and verifies syntax via the Mermaid CLI to deliver ready-to-render diagrams.

Core Features & Use Cases

  • Generate Mermaid diagrams from natural language requirements for multiple diagram types (flowchart, sequence, class, ER, Gantt, and more).
  • Output two artifacts per diagram: a raw Mermaid source file (.mmd) and a Markdown file (.md) with an embedded diagram, saved under figures/.
  • Validate syntax using Mermaid CLI (mmdc) and provide a rendered PNG for quick verification.

Quick Start

Describe your diagram requirement in plain language and I will produce both the Mermaid source (.mmd) and a Markdown preview (.md) in the figures/ directory.

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 natural language requirements?

You can generate Mermaid diagrams by describing your requirements in plain language. The tool parses your text to produce both raw Mermaid source (.mmd) and a Markdown preview (.md) saved under the figures/ directory.

What types of diagrams can I create using Mermaid syntax?

Using Mermaid syntax, you can create flowcharts, sequence diagrams, class diagrams, ER diagrams, and Gantt charts. You specify the diagram type from your requirements to generate the appropriate visual output.

Do I need Mermaid CLI installed to verify diagram syntax?

Yes, Mermaid CLI (mmdc) is required to verify diagram syntax. The tool validates generated .mmd files using mmdc, rendering a PNG for verification and iterating up to 3 times to fix syntax errors.

Can I use KaTeX for math rendering in Mermaid diagrams?

Yes, you can use KaTeX for math rendering in Mermaid diagrams. When your requirements include mathematical expressions, the tool supports rendering them via KaTeX within the generated diagram outputs.

Why does my Mermaid diagram fail to render and how can I fix syntax errors?

Mermaid diagrams fail to render due to syntax errors. The tool validates syntax using Mermaid CLI (mmdc) and automatically iterates up to 3 times to correct the generated .mmd source file for successful rendering.