Mermaid Diagrams
Create software diagrams using Mermaid syntax. Use when users need to create, visualize, or document software through diagrams including class diagrams, sequence diagrams, flowcharts, ERDs, C4 archite
Create software diagrams using Mermaid syntax. Use when users need to create, visualize, or document software through diagrams including class diagrams, sequence diagrams, flowcharts, ERDs, C4 archite
Real data. Real impact.
Emerging
Developers
Per week
Open source
Skills give you superpowers. Install in 30 seconds.
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.
npx clawhub@latest install mermaid-diagrams
All Mermaid diagrams follow this pattern:
diagramType definition content
Key principles:
classDiagram, sequenceDiagram, flowchart)%% for comments| Type | Use For | Reference |
|---|---|---|
| Class Diagrams | Domain modeling, OOP design, entity relationships | |
| Sequence Diagrams | API flows, auth flows, component interactions | |
| Flowcharts | Processes, algorithms, decision trees, user journeys | |
| ERD | Database schemas, table relationships, data modeling | |
| C4 Diagrams | System context, containers, components, architecture | |
| State Diagrams | State machines, lifecycle states | — |
| Git Graphs | Branching strategies | — |
| Gantt Charts | Project timelines, scheduling | — |
For styling, themes, and layout options: See
references/advanced-features.md
classDiagram Title -- Genre Title *-- Season Title *-- Review User --> Review : createsclass Title { +string name +int releaseYear +play() } class Genre { +string name +getTopTitles() }
sequenceDiagram participant User participant API participant DatabaseUser->>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 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
erDiagram USER ||--o{ ORDER : places ORDER ||--|{ LINE_ITEM : contains PRODUCT ||--o{ LINE_ITEM : includesUSER { int id PK string email UK string name datetime created_at } ORDER { int id PK int user_id FK decimal total datetime created_at }
%% comments to explain complex relationships.mmd files alongside code for easy updatesConfigure 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 layoutlayout: elk — advanced layout for complex diagramsLook options:
look: classic — traditional Mermaid stylelook: handDrawn — sketch-like appearanceNative support in:
Export options:
npm install -g @mermaid-js/mermaid-cli then mmdc -i input.mmd -o output.pngAlways diagram when:
Use diagrams to:
{} in comments; escape special charactersNo automatic installation available. Please visit the source repository for installation instructions.
View Installation Instructions1,500+ AI skills, agents & workflows. Install in 30 seconds. Part of the Torly.ai family.
© 2026 Torly.ai. All rights reserved.