mermaid-diagram-generator
Creates Mermaid diagrams for flowcharts, sequence diagrams, ERDs, and architecture visualizations in markdown. Use when users request "Mermaid diagram", "flowchart", "sequence diagram", "ERD diagram", or "architecture diagram".
Best use case
mermaid-diagram-generator is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Creates Mermaid diagrams for flowcharts, sequence diagrams, ERDs, and architecture visualizations in markdown. Use when users request "Mermaid diagram", "flowchart", "sequence diagram", "ERD diagram", or "architecture diagram".
Teams using mermaid-diagram-generator should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/mermaid-diagram-generator/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How mermaid-diagram-generator Compares
| Feature / Agent | mermaid-diagram-generator | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Creates Mermaid diagrams for flowcharts, sequence diagrams, ERDs, and architecture visualizations in markdown. Use when users request "Mermaid diagram", "flowchart", "sequence diagram", "ERD diagram", or "architecture diagram".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Mermaid Diagram Generator
Create clear, maintainable diagrams using Mermaid syntax in markdown.
## Core Workflow
1. **Identify diagram type**: Flow, sequence, ERD, etc.
2. **Define elements**: Nodes, connections, labels
3. **Apply styling**: Colors, shapes, directions
4. **Add interactions**: Click handlers (optional)
5. **Embed in docs**: Markdown integration
## Flowchart Diagrams
### Basic Flowchart
```mermaid
flowchart TD
A[Start] --> B{Is user logged in?}
B -->|Yes| C[Show Dashboard]
B -->|No| D[Show Login Page]
D --> E[Enter Credentials]
E --> F{Valid credentials?}
F -->|Yes| C
F -->|No| G[Show Error]
G --> D
C --> H[End]
```
### Node Shapes
```mermaid
flowchart LR
A[Rectangle] --> B(Rounded)
B --> C([Stadium])
C --> D[[Subroutine]]
D --> E[(Database)]
E --> F((Circle))
F --> G>Asymmetric]
G --> H{Diamond}
H --> I{{Hexagon}}
I --> J[/Parallelogram/]
J --> K[\Parallelogram Alt\]
K --> L[/Trapezoid\]
L --> M[\Trapezoid Alt/]
```
### Subgraphs
```mermaid
flowchart TB
subgraph Frontend
A[React App] --> B[Redux Store]
B --> C[Components]
end
subgraph Backend
D[API Gateway] --> E[Auth Service]
D --> F[User Service]
D --> G[Order Service]
end
subgraph Database
H[(PostgreSQL)]
I[(Redis Cache)]
end
C --> D
E --> H
F --> H
G --> H
E --> I
```
### Styled Flowchart
```mermaid
flowchart TD
A[Request] --> B{Rate Limited?}
B -->|Yes| C[429 Too Many Requests]
B -->|No| D{Authenticated?}
D -->|No| E[401 Unauthorized]
D -->|Yes| F{Authorized?}
F -->|No| G[403 Forbidden]
F -->|Yes| H[Process Request]
H --> I[200 OK]
style A fill:#e1f5fe
style I fill:#c8e6c9
style C fill:#ffcdd2
style E fill:#ffcdd2
style G fill:#ffcdd2
classDef error fill:#ffcdd2,stroke:#c62828
classDef success fill:#c8e6c9,stroke:#2e7d32
class C,E,G error
class I success
```
## Sequence Diagrams
### API Request Flow
```mermaid
sequenceDiagram
autonumber
actor User
participant Client
participant API
participant Auth
participant DB
User->>Client: Click Login
Client->>API: POST /auth/login
API->>Auth: Validate credentials
Auth->>DB: Query user
DB-->>Auth: User data
Auth-->>API: JWT token
API-->>Client: 200 OK + token
Client->>Client: Store token
Client-->>User: Show dashboard
```
### With Loops and Conditions
```mermaid
sequenceDiagram
participant C as Client
participant S as Server
participant Q as Queue
participant W as Worker
C->>S: Submit job
S->>Q: Enqueue job
S-->>C: Job ID
loop Poll status
C->>S: GET /jobs/{id}
S-->>C: Status: processing
end
W->>Q: Dequeue job
W->>W: Process job
alt Success
W->>S: Job completed
S-->>C: Status: completed
else Failure
W->>S: Job failed
S-->>C: Status: failed
end
```
### With Notes and Activations
```mermaid
sequenceDiagram
participant U as User
participant F as Frontend
participant B as Backend
participant D as Database
Note over U,D: User Registration Flow
U->>+F: Fill registration form
F->>F: Validate input
F->>+B: POST /api/users
activate B
B->>B: Hash password
B->>+D: INSERT user
D-->>-B: User created
B->>B: Generate verification email
deactivate B
B-->>-F: 201 Created
F-->>-U: Success message
Note right of B: Email sent async
```
## Entity Relationship Diagrams
### Database Schema
```mermaid
erDiagram
USERS ||--o{ ORDERS : places
USERS ||--o{ REVIEWS : writes
USERS {
uuid id PK
string email UK
string password_hash
string name
timestamp created_at
timestamp updated_at
}
ORDERS ||--|{ ORDER_ITEMS : contains
ORDERS {
uuid id PK
uuid user_id FK
decimal total
string status
timestamp created_at
}
PRODUCTS ||--o{ ORDER_ITEMS : "ordered in"
PRODUCTS ||--o{ REVIEWS : "reviewed in"
PRODUCTS {
uuid id PK
string name
text description
decimal price
int stock
uuid category_id FK
}
ORDER_ITEMS {
uuid id PK
uuid order_id FK
uuid product_id FK
int quantity
decimal price
}
CATEGORIES ||--o{ PRODUCTS : contains
CATEGORIES {
uuid id PK
string name
uuid parent_id FK
}
REVIEWS {
uuid id PK
uuid user_id FK
uuid product_id FK
int rating
text content
timestamp created_at
}
```
## State Diagrams
### Order State Machine
```mermaid
stateDiagram-v2
[*] --> Pending: Order created
Pending --> Processing: Payment received
Pending --> Cancelled: User cancels
Processing --> Shipped: Items dispatched
Processing --> Cancelled: Out of stock
Shipped --> Delivered: Package delivered
Shipped --> Returned: Return requested
Delivered --> Returned: Return requested
Delivered --> [*]: Complete
Returned --> Refunded: Refund processed
Refunded --> [*]
Cancelled --> [*]
note right of Processing
Inventory checked
and reserved
end note
```
### With Composite States
```mermaid
stateDiagram-v2
[*] --> Idle
state Active {
[*] --> Running
Running --> Paused: pause
Paused --> Running: resume
Running --> [*]: complete
}
Idle --> Active: start
Active --> Idle: stop
Active --> Error: error
Error --> Idle: reset
```
## Class Diagrams
### TypeScript Classes
```mermaid
classDiagram
class User {
+string id
+string email
+string name
-string passwordHash
+login(password: string) boolean
+updateProfile(data: ProfileData) void
+getOrders() Order[]
}
class Order {
+string id
+string userId
+OrderItem[] items
+OrderStatus status
+decimal total
+addItem(product: Product, qty: number) void
+removeItem(itemId: string) void
+checkout() boolean
}
class OrderItem {
+string id
+string productId
+number quantity
+decimal price
}
class Product {
+string id
+string name
+decimal price
+number stock
+reserve(qty: number) boolean
+release(qty: number) void
}
User "1" --> "*" Order: places
Order "1" --> "*" OrderItem: contains
OrderItem "*" --> "1" Product: references
class OrderStatus {
<<enumeration>>
PENDING
PROCESSING
SHIPPED
DELIVERED
CANCELLED
}
```
## Architecture Diagrams
### C4 Context Diagram
```mermaid
flowchart TB
subgraph boundary[System Boundary]
system[E-commerce Platform]
end
user[fa:fa-user Customer]
admin[fa:fa-user-cog Admin]
payment[fa:fa-credit-card Payment Provider]
shipping[fa:fa-truck Shipping API]
email[fa:fa-envelope Email Service]
user --> system
admin --> system
system --> payment
system --> shipping
system --> email
style system fill:#438dd5,color:#fff
style user fill:#08427b,color:#fff
style admin fill:#08427b,color:#fff
style payment fill:#999,color:#fff
style shipping fill:#999,color:#fff
style email fill:#999,color:#fff
```
### Microservices Architecture
```mermaid
flowchart TB
subgraph Client Layer
web[Web App]
mobile[Mobile App]
end
subgraph API Layer
gateway[API Gateway]
auth[Auth Service]
end
subgraph Services
users[User Service]
orders[Order Service]
products[Product Service]
payments[Payment Service]
notifications[Notification Service]
end
subgraph Data Layer
pg1[(Users DB)]
pg2[(Orders DB)]
pg3[(Products DB)]
redis[(Redis Cache)]
kafka[Kafka]
end
web --> gateway
mobile --> gateway
gateway --> auth
gateway --> users
gateway --> orders
gateway --> products
users --> pg1
orders --> pg2
products --> pg3
users --> redis
products --> redis
orders --> kafka
payments --> kafka
notifications --> kafka
kafka --> payments
kafka --> notifications
```
## Git Graph
```mermaid
gitGraph
commit id: "Initial commit"
branch develop
checkout develop
commit id: "Setup project"
commit id: "Add components"
branch feature/auth
checkout feature/auth
commit id: "Add login"
commit id: "Add signup"
checkout develop
merge feature/auth id: "Merge auth"
branch feature/dashboard
checkout feature/dashboard
commit id: "Add dashboard"
checkout develop
merge feature/dashboard id: "Merge dashboard"
checkout main
merge develop id: "Release v1.0" tag: "v1.0.0"
```
## Pie Charts
```mermaid
pie showData
title Technology Stack Distribution
"TypeScript" : 45
"React" : 25
"Node.js" : 15
"PostgreSQL" : 10
"Other" : 5
```
## Timeline
```mermaid
timeline
title Project Roadmap 2024
section Q1
January : Project Kickoff
: Team Setup
February : MVP Development
March : Alpha Release
section Q2
April : Beta Testing
May : Bug Fixes
June : Public Launch
section Q3
July : Feature Expansion
August : Performance Optimization
September : Mobile App
section Q4
October : Enterprise Features
November : International Expansion
December : Year Review
```
## Mindmap
```mermaid
mindmap
root((Project))
Frontend
React
Next.js
Tailwind CSS
Backend
Node.js
Express
GraphQL
Database
PostgreSQL
Redis
MongoDB
DevOps
Docker
Kubernetes
CI/CD
Testing
Jest
Cypress
Playwright
```
## Best Practices
1. **Keep it simple**: Avoid overcrowded diagrams
2. **Use subgraphs**: Group related elements
3. **Consistent styling**: Define class styles
4. **Direction matters**: LR for processes, TD for hierarchies
5. **Add notes**: Clarify complex parts
6. **Use icons**: Font Awesome integration
7. **Version control**: Diagrams are code
8. **Document purpose**: Add titles and descriptions
## Output Checklist
Every Mermaid diagram should include:
- [ ] Appropriate diagram type
- [ ] Clear node labels
- [ ] Logical flow direction
- [ ] Subgraphs for grouping
- [ ] Consistent styling
- [ ] Meaningful connections
- [ ] Notes where needed
- [ ] Title or description
- [ ] Proper syntax validation
- [ ] Readable at expected sizeRelated Skills
mermaid-expert
Create Mermaid diagrams for flowcharts, sequences, ERDs, and architectures. Masters syntax for all diagram types and styling. Use PROACTIVELY for visual documentation, system diagrams, or process flows.
generator
Générateur de Skill - Crée de nouveaux fichiers SKILL.md depuis les définitions YAML d'agents
EchoKit Config Generator
Generate config.toml for EchoKit servers with interactive setup for ASR, TTS, LLM services, MCP servers, API key entry, and server launch
bigconfig-generator
Use this skill when creating or updating Bigeye monitoring configurations (bigconfig.yml files) for BigQuery tables. Works with metadata-manager skill.
beautiful-mermaid
Render Mermaid diagrams as pure ASCII text (default) or themed SVGs using the beautiful-mermaid renderer. Use when the user asks for a Mermaid diagram (flowchart, sequence, class, state, or ER), wants a diagram file generated, or needs terminal-friendly ASCII output.
beautiful-mermaid-renderer
Render Mermaid diagrams using beautiful-mermaid as Unicode/ASCII (terminal/chat) or SVG (rich UI). Use when you need a quick, good-looking diagram preview in plain text or want to generate an SVG from Mermaid source (Bun preferred).
beautiful-mermaid-diagrams
Create beautiful diagrams using Mermaid syntax including flowcharts, sequence diagrams, class diagrams, ER diagrams, and state diagrams. Use when users ask to diagram, visualize, model, map out, or show the flow of systems, processes, architectures, or interactions.
ai-image-generator
使用 ModelScope 等平台生成 AI 图像。当用户需要生成图像、设计图标、创建角色立绘,或需要帮助编写 AI 绘画提示词时使用此技能。支持直接生成图像和仅优化提示词两种模式。
acc-mermaid-template
Generates Mermaid diagrams for technical documentation. Provides templates for flowcharts, sequence diagrams, class diagrams, ER diagrams, and C4 models.
acc-diagram-knowledge
Diagram knowledge base. Provides Mermaid syntax, C4 model, diagram types, and best practices for technical diagrams.
thumbnail-generator
Generate prompts for dev.to blog thumbnail/cover images in hand-drawn infographic style. Use when creating cover images, thumbnails, or featured images for blog posts. Recommended size 1000x420 pixels.
seedream-image-generator
Generate images using the Doubao SeeDream API based on text prompts. Use this skill when users request AI-generated images, artwork, illustrations, or visual content creation. The skill handles API calls, downloads generated images to the project's /pic folder, and supports batch generation of up to 4 sequential images.