Skill
Community

creating-mermaid-diagrams

Install
1
Install the plugin
$
npx claudepluginhub nilpath/nilpath-marketplace --plugin claude-code-tools

Want just this skill?

Then install: npx claudepluginhub u/[userId]/[slug]

Description

Creates, edits, and validates Mermaid diagrams including flowcharts, sequence diagrams, class diagrams, state diagrams, ERDs, Gantt charts, and more. Use when working with Mermaid syntax, creating diagrams from descriptions, visualizing architecture, documenting workflows, or when user mentions mermaid, flowchart, sequence diagram, UML, or visualization.

Tool Access

This skill is limited to using the following tools:

ReadWriteEditBash(npx:*)
Supporting Assets
View in Repository
references/class-diagram-syntax.md
references/common-patterns.md
references/entity-relationship-syntax.md
references/flowchart-syntax.md
references/gantt-chart-syntax.md
references/gitgraph-syntax.md
references/mindmap-syntax.md
references/pie-chart-syntax.md
references/sequence-diagram-syntax.md
references/state-diagram-syntax.md
references/styling-and-themes.md
references/timeline-syntax.md
scripts/validate-mermaid.sh
templates/architecture-diagram.md
templates/class-diagram.md
templates/er-diagram.md
templates/flowchart.md
templates/sequence-diagram.md
workflows/create-diagram.md
workflows/edit-diagram.md
Skill Content

Creating Mermaid Diagrams

Expert guidance for creating, editing, and validating Mermaid diagrams.

Supported Diagram Types

TypeUse CaseReference
FlowchartProcess flows, decision trees, algorithmsflowchart-syntax.md
SequenceAPI calls, service interactions, protocolssequence-diagram-syntax.md
ClassOOP design, type hierarchies, interfacesclass-diagram-syntax.md
StateState machines, lifecycle, FSMsstate-diagram-syntax.md
ERDatabase schema, data modelsentity-relationship-syntax.md
GanttProject timelines, schedulesgantt-chart-syntax.md
PieProportions, distributionspie-chart-syntax.md
MindmapBrainstorming, hierarchiesmindmap-syntax.md
TimelineHistorical events, milestonestimeline-syntax.md
Git GraphBranch visualizationgitgraph-syntax.md

Quick Start

Flowchart

flowchart TD
    A[Start] --> B{Decision?}
    B -->|Yes| C[Action 1]
    B -->|No| D[Action 2]
    C --> E[End]
    D --> E

Sequence Diagram

sequenceDiagram
    participant U as User
    participant S as Server
    participant D as Database

    U->>S: Request
    S->>D: Query
    D-->>S: Results
    S-->>U: Response

Class Diagram

classDiagram
    class Animal {
        +String name
        +makeSound()
    }
    class Dog {
        +fetch()
    }
    Animal <|-- Dog

What Would You Like To Do?

  1. Create a new diagram - See workflows/create-diagram.md
  2. Edit an existing diagram - See workflows/edit-diagram.md
  3. Validate syntax - See workflows/validate-diagram.md
  4. Learn diagram syntax - See reference files above

Diagram Selection Guide

Visualizing processes or decisions?

  • Use Flowchart (TD for top-down, LR for left-right)

Showing interactions between systems?

  • Use Sequence Diagram for temporal flow

Modeling data or objects?

  • Use Class Diagram for code/type relationships
  • Use ER Diagram for database schema

Tracking state changes?

  • Use State Diagram for state machines

Planning timelines?

  • Use Gantt Chart for project schedules
  • Use Timeline for historical events

Showing proportions?

  • Use Pie Chart for distributions

Organizing ideas?

  • Use Mindmap for hierarchical brainstorming

Quick Validation

Validate with mermaid-cli:

# Using the skill's validation script
./scripts/validate-mermaid.sh diagram.md

# Or use npx directly
npx -y @mermaid-js/mermaid-cli -i diagram.mmd -o output.svg

Manual verification: Paste at mermaid.live

Common Patterns

See references/common-patterns.md for:

  • Subgraphs for grouping related nodes
  • Styling nodes and edges
  • Multi-diagram markdown documents
  • Integration patterns

Styling and Themes

See references/styling-and-themes.md for:

  • Built-in themes: default, dark, forest, neutral
  • Custom CSS styling
  • Node and edge styling with classDef

Anti-Patterns to Avoid

Anti-PatternProblemSolution
Missing quotes on special charsSyntax errorsWrap text with [](){} in quotes
Too many nodesUnreadableSplit into subgraphs or multiple diagrams
No labels on edgesUnclear meaningAdd descriptive labels
Wrong diagram typeConfusingMatch diagram type to information
Inconsistent arrow syntaxHard to readUse consistent --> or -.->

Templates

Ready-to-use starter templates:

Requirements

For validation, one of:

  • npx (Node.js) - runs @mermaid-js/mermaid-cli on demand
  • GitHub/GitLab - renders Mermaid in markdown files
  • VS Code - with Mermaid preview extension

Guidelines

  • Always validate diagrams before finalizing
  • Prefer simple diagrams over complex ones
  • Use subgraphs when diagrams exceed ~15 nodes
  • Include labels on all decision branches
  • Match diagram type to information being visualized
  • Link to official Mermaid docs for advanced syntax not covered in quick references

Success Criteria

A well-crafted diagram:

  • Uses the correct diagram type for the information
  • Has clear, descriptive labels
  • Uses consistent styling
  • Validates without errors
  • Is readable at a reasonable size
  • Includes only necessary complexity

References

Stats
Stars0
Forks0
Last CommitFeb 2, 2026

Similar Skills