<< All versions
Skill v1.0.0
currentAutomated scan100/100hoodini/ai-agents-skills/mermaid-diagrams
──Details
PublishedJuly 20, 2026 at 07:45 AM
Content Hashsha256:6912d333164ad986...
Git SHAf7a43d8f8525
──Files
Files (1 file, 7.4 KB)
SKILL.md7.4 KBactive
SKILL.md · 375 lines · 7.4 KB
version: "1.0.0" name: mermaid-diagrams description: Create diagrams and visualizations using Mermaid syntax. Use when generating flowcharts, sequence diagrams, class diagrams, entity-relationship diagrams, Gantt charts, or any visual documentation. Triggers on Mermaid, flowchart, sequence diagram, class diagram, ER diagram, Gantt chart, diagram, visualization.
Mermaid Diagrams
Create diagrams and visualizations using Mermaid markdown syntax.
Quick Reference
Mermaid diagrams are written in markdown code blocks with mermaid as the language identifier.
Flowchart
mermaid
flowchart TDA[Start] --> B{Is it valid?}B -->|Yes| C[Process data]B -->|No| D[Show error]C --> E[Save to database]D --> F[Return to input]E --> G[End]F --> A
Flowchart Syntax
flowchart TD %% TD = top-down, LR = left-right, RL, BTA[Rectangle] %% Square brackets = rectangleB(Rounded) %% Parentheses = rounded rectangleC{Diamond} %% Curly braces = diamond/decisionD[[Subroutine]] %% Double brackets = subroutineE[(Database)] %% Cylinder shapeF((Circle)) %% Double parentheses = circleG>Asymmetric] %% Flag shapeA --> B %% ArrowB --- C %% Line without arrowC -.-> D %% Dotted arrowD ==> E %% Thick arrowE --text--> F %% Arrow with labelF -->|label| G %% Alternative label syntax
Subgraphs
mermaid
flowchart TBsubgraph FrontendA[React App] --> B[Components]B --> C[Hooks]endsubgraph BackendD[API Server] --> E[Database]endA -->|HTTP| D
Sequence Diagram
mermaid
sequenceDiagramparticipant U as Userparticipant C as Clientparticipant S as Serverparticipant D as DatabaseU->>C: Click submitC->>S: POST /api/dataactivate SS->>D: INSERT queryD-->>S: SuccessS-->>C: 200 OKdeactivate SC-->>U: Show success message
Sequence Diagram Syntax
sequenceDiagramparticipant A as Aliceparticipant B as BobA->>B: Solid line with arrowA-->>B: Dotted line with arrowA-)B: Solid line with open arrowA--)B: Dotted line with open arrowactivate B %% Activation boxB->>A: Responsedeactivate BNote over A,B: This is a noteNote right of A: Note on rightalt Condition trueA->>B: Do thiselse Condition falseA->>B: Do thatendloop Every minuteA->>B: Pingendopt Optional actionA->>B: Maybe do thisend
Class Diagram
mermaid
classDiagramclass User {+String id+String name+String email+login()+logout()}class Order {+String id+Date createdAt+calculateTotal()}class Product {+String id+String name+Number price}User "1" --> "*" Order : placesOrder "*" --> "*" Product : contains
Class Diagram Syntax
classDiagramclass ClassName {+publicField-privateField#protectedField~packageField+publicMethod()-privateMethod()}ClassA <|-- ClassB : InheritanceClassC *-- ClassD : CompositionClassE o-- ClassF : AggregationClassG --> ClassH : AssociationClassI ..> ClassJ : DependencyClassK ..|> ClassL : Realization
Entity Relationship Diagram
mermaid
erDiagramUSER ||--o{ ORDER : placesORDER ||--|{ LINE_ITEM : containsPRODUCT ||--o{ LINE_ITEM : "is in"USER {string id PKstring email UKstring namedatetime created_at}ORDER {string id PKstring user_id FKdatetime created_atstring status}PRODUCT {string id PKstring namedecimal price}LINE_ITEM {string id PKstring order_id FKstring product_id FKint quantity}
ER Diagram Cardinality
||--|| One to one||--o{ One to zero or more||--|{ One to one or more}o--o{ Zero or more to zero or more
Gantt Chart
mermaid
gantttitle Project TimelinedateFormat YYYY-MM-DDsection PlanningRequirements :a1, 2024-01-01, 7dDesign :a2, after a1, 14dsection DevelopmentBackend API :b1, after a2, 21dFrontend :b2, after a2, 28dIntegration :b3, after b1, 7dsection TestingQA Testing :c1, after b3, 14dBug Fixes :c2, after c1, 7dsection LaunchDeployment :milestone, after c2, 0d
State Diagram
mermaid
stateDiagram-v2[*] --> IdleIdle --> Processing: SubmitProcessing --> Success: ValidProcessing --> Error: InvalidSuccess --> Idle: ResetError --> Idle: RetrySuccess --> [*]
Pie Chart
mermaid
pie title Browser Market Share"Chrome" : 65"Safari" : 19"Firefox" : 10"Edge" : 4"Other" : 2
Git Graph
mermaid
gitGraphcommitcommitbranch featurecheckout featurecommitcommitcheckout mainmerge featurecommitbranch hotfixcheckout hotfixcommitcheckout mainmerge hotfix
User Journey
mermaid
journeytitle User Checkout Experiencesection BrowseView products: 5: UserAdd to cart: 4: Usersection CheckoutEnter shipping: 3: UserEnter payment: 2: UserConfirm order: 5: Usersection Post-PurchaseReceive confirmation: 5: User, SystemTrack shipment: 4: User
Mindmap
mermaid
mindmaproot((Project))FrontendReactTypeScriptTailwindBackendNode.jsPostgreSQLRedisDevOpsDockerKubernetesCI/CD
Styling
mermaid
flowchart LRA[Start]:::green --> B[Process]:::blue --> C[End]:::redclassDef green fill:#22c55e,color:#fffclassDef blue fill:#3b82f6,color:#fffclassDef red fill:#ef4444,color:#fff
React Component
tsx
import mermaid from 'mermaid';import { useEffect, useRef } from 'react';mermaid.initialize({startOnLoad: true,theme: 'neutral', // default, dark, forest, neutralsecurityLevel: 'loose',});interface MermaidProps {chart: string;id?: string;}export function Mermaid({ chart, id = 'mermaid-diagram' }: MermaidProps) {const ref = useRef<HTMLDivElement>(null);useEffect(() => {if (ref.current) {mermaid.render(id, chart).then(({ svg }) => {if (ref.current) {ref.current.innerHTML = svg;}});}}, [chart, id]);return <div ref={ref} className="mermaid-container" />;}// Usage<Mermaidchart={`flowchart LRA --> B --> C`}/>
Tips
- Direction: Use
TD(top-down),LR(left-right),BT(bottom-top),RL(right-left) - Comments: Use
%%for comments - Quotes: Use quotes for labels with special characters:
A["Label with (parentheses)"] - Line breaks: Use
<br/>for multi-line labels
Resources
- Mermaid Docs: https://mermaid.js.org/
- Live Editor: https://mermaid.live
- GitHub Support: Mermaid works natively in GitHub markdown