Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
bighardperson avatar

Mermaid Diagrams

  • 8 installs
  • 33 repo stars
  • Updated April 26, 2026
  • bighardperson/computer-science-skills-collection

mermaid-diagrams is a Claude skill that creates software diagrams (class, sequence, flowchart, ERD, C4, state, git, Gantt) from Mermaid text syntax.

About

mermaid-diagrams creates software diagrams using Mermaid's text-based syntax. It covers class diagrams, sequence diagrams, flowcharts, ERDs, C4 architecture diagrams, state diagrams, git graphs, and Gantt charts, with reference files and quick-start examples for each. A developer uses it to diagram, visualize, or model a system so the output stays version-controllable alongside code. It includes best practices such as keeping any single diagram under 15 nodes.

  • Creates software diagrams using Mermaid's text-based syntax
  • Covers class, sequence, flowchart, ERD, C4, state, git-graph, and Gantt diagrams
  • Text definitions are version-controllable and render natively in GitHub, GitLab, Notion, and Obsidian

Mermaid Diagrams by the numbers

  • 8 all-time installs (skills.sh)
  • Ranked #1,167 of 1,879 Documentation skills by installs in the Skillselion catalog
  • Data as of Jul 30, 2026 (Skillselion catalog sync)
At a glance

mermaid-diagrams capabilities & compatibility

Free; Mermaid syntax renders in common tools, optional mermaid-cli for export.

Capabilities
sequence diagram · flowchart · erd · c4 diagram · class diagram
Works with
github · gitlab · notion · obsidian
Use cases
documentation · web design
IDEs
vscode
Pricing
Free
From the docs

What mermaid-diagrams says it does

Create software diagrams using Mermaid syntax.
SKILL.md
class diagrams, sequence diagrams, flowcharts, ERDs, C4 architecture diagrams, state diagrams, git graphs, and other diagram types.
SKILL.md
**NEVER create diagrams with more than 15 nodes**
SKILL.md
npx skills add https://github.com/bighardperson/computer-science-skills-collection --skill mermaid-diagrams

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs8
repo stars33
Last updatedApril 26, 2026
Repositorybighardperson/computer-science-skills-collection

What it does

Create version-controllable software diagrams (class, sequence, flowchart, ERD, C4) using Mermaid text syntax.

Who is it for?

Developers documenting architecture, flows, and schemas as version-controllable diagrams.

Skip if: Pixel-perfect hand-drawn illustrations or non-technical infographics.

When should I use this skill?

You need to diagram, visualize, model, or map out the flow of a system.

What you get

You get a text-defined Mermaid diagram that renders in GitHub, Notion, and more.

  • Mermaid diagram definitions
  • class/sequence/flowchart/ERD diagrams

By the numbers

  • 8 diagram types in the selection table
  • max 15 nodes per diagram guideline

Files

SKILL.mdMarkdownGitHub ↗

Mermaid Diagrams

Create professional software diagrams using Mermaid's text-based syntax. Mermaid renders diagrams from simple text definitions, making diagrams version-controllable, easy to update, and maintainable alongside code.

Installation

OpenClaw / Moltbot / Clawbot

npx clawhub@latest install mermaid-diagrams

Core Syntax

All Mermaid diagrams follow this pattern:

diagramType
  definition content

Key principles:

  • First line declares diagram type (e.g., classDiagram, sequenceDiagram, flowchart)
  • Use %% for comments
  • Line breaks and indentation improve readability but aren't required
  • Unknown words break diagrams; invalid parameters fail silently

Diagram Type Selection

TypeUse ForReference
Class DiagramsDomain modeling, OOP design, entity relationshipsreferences/class-diagrams.md
Sequence DiagramsAPI flows, auth flows, component interactionsreferences/sequence-diagrams.md
FlowchartsProcesses, algorithms, decision trees, user journeysreferences/flowcharts.md
ERDDatabase schemas, table relationships, data modelingreferences/erd-diagrams.md
C4 DiagramsSystem context, containers, components, architecturereferences/c4-diagrams.md
State DiagramsState machines, lifecycle states
Git GraphsBranching strategies
Gantt ChartsProject timelines, scheduling

For styling, themes, and layout options: See references/advanced-features.md

Quick Start Examples

Class Diagram (Domain Model)

classDiagram
    Title -- Genre
    Title *-- Season
    Title *-- Review
    User --> Review : creates

    class Title {
        +string name
        +int releaseYear
        +play()
    }

    class Genre {
        +string name
        +getTopTitles()
    }

Sequence Diagram (API Flow)

sequenceDiagram
    participant User
    participant API
    participant Database

    User->>API: POST /login
    API->>Database: Query credentials
    Database-->>API: Return user data
    alt Valid credentials
        API-->>User: 200 OK + JWT token
    else Invalid credentials
        API-->>User: 401 Unauthorized
    end

Flowchart (User Journey)

flowchart TD
    Start([User visits site]) --> Auth{Authenticated?}
    Auth -->|No| Login[Show login page]
    Auth -->|Yes| Dashboard[Show dashboard]
    Login --> Creds[Enter credentials]
    Creds --> Validate{Valid?}
    Validate -->|Yes| Dashboard
    Validate -->|No| Error[Show error]
    Error --> Login

ERD (Database Schema)

erDiagram
    USER ||--o{ ORDER : places
    ORDER ||--|{ LINE_ITEM : contains
    PRODUCT ||--o{ LINE_ITEM : includes

    USER {
        int id PK
        string email UK
        string name
        datetime created_at
    }

    ORDER {
        int id PK
        int user_id FK
        decimal total
        datetime created_at
    }

Best Practices

1. Start simple — begin with core entities/components, add details incrementally 2. Use meaningful names — clear labels make diagrams self-documenting 3. Comment extensively — use %% comments to explain complex relationships 4. Keep focused — one diagram per concept; split large diagrams into multiple views 5. Version control — store .mmd files alongside code for easy updates 6. Add context — include titles and notes to explain diagram purpose 7. Iterate — refine diagrams as understanding evolves

Configuration and Theming

Configure diagrams using frontmatter:

---
config:
  theme: base
  themeVariables:
    primaryColor: "#ff6b6b"
---
flowchart LR
    A --> B

Available themes: default, forest, dark, neutral, base

Layout options:

  • layout: dagre (default) — classic balanced layout
  • layout: elk — advanced layout for complex diagrams

Look options:

  • look: classic — traditional Mermaid style
  • look: handDrawn — sketch-like appearance

Rendering and Export

Native support in:

  • GitHub/GitLab — automatically renders in Markdown
  • VS Code — with Markdown Mermaid extension
  • Notion, Obsidian, Confluence — built-in support

Export options:

  • Mermaid Live Editor — online editor with PNG/SVG export
  • Mermaid CLI — npm install -g @mermaid-js/mermaid-cli then mmdc -i input.mmd -o output.png

When to Create Diagrams

Always diagram when:

  • Starting new projects or features
  • Documenting complex systems
  • Explaining architecture decisions
  • Designing database schemas
  • Planning refactoring efforts
  • Onboarding new team members

Use diagrams to:

  • Align stakeholders on technical decisions
  • Document domain models collaboratively
  • Visualize data flows and system interactions
  • Plan before coding
  • Create living documentation that evolves with code

Common Pitfalls

  • Breaking characters — avoid {} in comments; escape special characters
  • Syntax errors — misspellings break diagrams; validate in Mermaid Live
  • Overcomplexity — split complex diagrams into multiple focused views
  • Missing relationships — document all important connections between entities
  • Stale diagrams — a wrong diagram is worse than no diagram; update when systems change

NEVER Do

1. NEVER create diagrams with more than 15 nodes — they become unreadable; split into multiple focused diagrams 2. NEVER leave arrows unlabeled — every connection should explain the relationship or data flow 3. NEVER create diagrams without a title or caption — context-free diagrams are useless outside the author's head 4. NEVER use diagrams as the sole documentation — pair diagrams with prose that explains the "why" 5. NEVER let diagrams go stale — update diagrams when architecture changes; stale diagrams mislead 6. NEVER use Mermaid for data visualization — Mermaid is for architecture and flow diagrams, not charts of business data

Related skills

FAQ

Which diagram types are supported?

Class, sequence, flowchart, ERD, C4, state, git graph, and Gantt diagrams.

Where do Mermaid diagrams render?

Natively in GitHub, GitLab, VS Code, Notion, Obsidian, and Confluence, with PNG/SVG export via the Mermaid Live Editor or CLI.

Is there a node limit guidance?

Yes; the skill says never create diagrams with more than 15 nodes because they become unreadable.

Documentationdocsbackend

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.