Generate Mermaid Diagram
Overview
Analyze the provided code, architecture, or concept and generate a clear, well-structured Mermaid diagram that visualizes the relationships, flow, or structure.
Instructions
Analyze the input - Understand what the user wants to visualize (code flow, architecture, data relationships, state machines, sequences, etc).
Choose the appropriate diagram type:
flowchart - For process flows, decision trees, algorithms
sequenceDiagram - For API calls, message passing, request/response flows
classDiagram - For class structures, inheritance, interfaces
erDiagram - For database schemas, entity relationships
stateDiagram-v2 - For state machines, lifecycle flows
graph TD/LR - For dependency graphs, module relationships
gitgraph - For git branching strategies
journey - For user journeys
gantt - For timelines and schedules
Generate the diagram with these qualities:
- Clear, descriptive node labels
- Logical grouping with subgraphs where appropriate
- Consistent styling and direction
- Meaningful relationship labels on edges
- Not overly complex - split into multiple diagrams if needed
Output format: Always wrap the diagram in a mermaid code block:
[diagram code here]
Diagram Style Guidelines
- Use descriptive IDs:
userService not a1
- Add labels to relationships when they add clarity
- Use subgraphs to group related components
- Keep diagrams readable - max ~15-20 nodes per diagram
- Use appropriate arrow styles:
--> solid arrow (main flow)
-.-> dotted arrow (optional/async)
==> thick arrow (important path)
o--> circle end (aggregation)
*--> diamond end (composition)
Examples
Flowchart
flowchart TD
A[Start] --> B{Is valid?}
B -->|Yes| C[Process]
B -->|No| D[Error]
C --> E[End]
D --> E
Sequence Diagram
sequenceDiagram
participant C as Client
participant S as Server
participant DB as Database
C->>S: Request
S->>DB: Query
DB-->>S: Results
S-->>C: Response
Class Diagram
classDiagram
class Animal {
String name
makeSound()
}
class Dog {
bark()
}
Animal <|-- Dog
ER Diagram
erDiagram
USER ||--o{ ORDER : places
ORDER ||--|{ LINE_ITEM : contains
PRODUCT ||--o{ LINE_ITEM : "ordered in"
After generating
- Explain what the diagram shows
- Offer to refine or expand specific sections
- Suggest alternative diagram types if applicable
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: gologo13-agent-skills-diagrams3description: Generate Mermaid Diagram4---56# Generate Mermaid Diagram78## Overview910Analyze the provided code, architecture, or concept and generate a clear, well-structured Mermaid diagram that visualizes the relationships, flow, or structure.1112## Instructions13141. **Analyze the input** - Understand what the user wants to visualize (code flow, architecture, data relationships, state machines, sequences, etc).15162. **Choose the appropriate diagram type**:1718 - `flowchart` - For process flows, decision trees, algorithms19 - `sequenceDiagram` - For API calls, message passing, request/response flows20 - `classDiagram` - For class structures, inheritance, interfaces21 - `erDiagram` - For database schemas, entity relationships22 - `stateDiagram-v2` - For state machines, lifecycle flows23 - `graph TD/LR` - For dependency graphs, module relationships24 - `gitgraph` - For git branching strategies25 - `journey` - For user journeys26 - `gantt` - For timelines and schedules27283. **Generate the diagram** with these qualities:2930 - Clear, descriptive node labels31 - Logical grouping with subgraphs where appropriate32 - Consistent styling and direction33 - Meaningful relationship labels on edges34 - Not overly complex - split into multiple diagrams if needed35364. **Output format**: Always wrap the diagram in a mermaid code block:3738 ```mermaid39 [diagram code here]40 ```4142## Diagram Style Guidelines4344- Use descriptive IDs: `userService` not `a1`45- Add labels to relationships when they add clarity46- Use subgraphs to group related components47- Keep diagrams readable - max ~15-20 nodes per diagram48- Use appropriate arrow styles:49- `-->` solid arrow (main flow)50- `-.->` dotted arrow (optional/async)51- `==>` thick arrow (important path)52- `o-->` circle end (aggregation)53- `*-->` diamond end (composition)5455## Examples5657### Flowchart5859```mermaid60flowchart TD61 A[Start] --> B{Is valid?}62 B -->|Yes| C[Process]63 B -->|No| D[Error]64 C --> E[End]65 D --> E66```6768### Sequence Diagram6970```mermaid71sequenceDiagram72 participant C as Client73 participant S as Server74 participant DB as Database7576 C->>S: Request77 S->>DB: Query78 DB-->>S: Results79 S-->>C: Response80```8182### Class Diagram8384```mermaid85classDiagram86 class Animal {87 String name88 makeSound()89 }90 class Dog {91 bark()92 }93 Animal <|-- Dog94```9596### ER Diagram9798```mermaid99erDiagram100 USER ||--o{ ORDER : places101 ORDER ||--|{ LINE_ITEM : contains102 PRODUCT ||--o{ LINE_ITEM : "ordered in"103```104105## After generating106107- Explain what the diagram shows108- Offer to refine or expand specific sections109- Suggest alternative diagram types if applicable110111---112> Converted and distributed by [TomeVault](https://tomevault.io/claim/gologo13) — claim your Tome and manage your conversions.113<!-- tomevault:4.0:skill_md:2026-04-14 -->