mermaid-diagram

Generate Mermaid diagram code from requirements and verify syntax with Mermaid CLI.

Updated May 25, 2026
One-click install
npx skills add https://github.com/duypham2801/ThS_LLM --skill mermaid-diagram-duypham2801
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mermaid-diagram
Source: https://github.com/duypham2801/ThS_LLM/tree/main/.claude/skills/mermaid-diagram
Command: npx skills add https://github.com/duypham2801/ThS_LLM --skill mermaid-diagram-duypham2801

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the trial-and-error of writing Mermaid diagrams by generating correct diagram syntax from requirements and verifying it renders successfully.

Core Features & Use Cases

  • Mermaid code generation: Produces high-quality Mermaid diagram source from your diagram description, choosing an appropriate diagram type (flowchart, sequence, ER, class, Gantt, and more).
  • Dual-file output for preview and editing: Saves both a raw Mermaid file and a GitHub/Markdown preview file with embedded Mermaid code.
  • Automated syntax verification: Renders the Mermaid file via Mermaid CLI (mmdc, with an npx fallback), then performs a strict visual review and iteratively fixes errors up to three attempts.
  • Use Case: Describe your system behavior (e.g., a data pipeline, training process, or architecture interaction), then automatically generate publication-ready diagrams with consistent structure.

Quick Start

Use the mermaid-diagram skill to generate a verified diagram for your requirements and save the .mmd, .md, and .png outputs to 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 a Mermaid sequence diagram from text requirements for documentation?

To generate a Mermaid sequence diagram from requirements, provide a text description of the system behavior. The tool automatically selects the appropriate diagram type and produces paired .mmd and .md files for direct use in documentation.

Why does my Mermaid diagram syntax fail to render in markdown?

Mermaid diagram syntax often fails to render due to structural errors. This tool validates syntax by rendering with the Mermaid CLI and iteratively fixes errors up to three attempts, ensuring the final output renders successfully.

What is the best way to create an architecture diagram without manually writing Mermaid code?

The best way to create an architecture diagram without manual coding is to describe your system interactions. The generator translates requirements into the correct Mermaid syntax, automatically choosing the optimal diagram type for publication-ready visualization.

Does generating Mermaid diagrams with syntax verification require installing the Mermaid CLI locally?

No, local installation is not strictly required. The syntax verification process renders the Mermaid file via the Mermaid CLI but includes an npx fallback, allowing it to validate and refine diagrams without a permanent local setup.

Can I automatically validate and fix Mermaid flowchart syntax errors?

Yes, you can automatically validate and fix Mermaid flowchart syntax. The tool performs a strict visual review after rendering, iteratively fixing errors through up to three refinement iterations to ensure correct output.

How to output both raw Mermaid code and a markdown preview file for a flowchart?

To output both raw Mermaid code and a markdown preview, generate the diagram and save the outputs to the figures directory. This produces a .mmd file with the source code and a .md file with embedded code for GitHub previewing.