dot_config/ai_templates/skills/diagram/mermaid/SKILL.md
Use when the task asks for a Mermaid diagram such as a flowchart, sequence diagram, ERD, class diagram, state machine, git graph, gantt chart, pie chart, or architecture diagram.
npx skillsauth add pascalandy/dotfiles mermaidInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Text-based diagrams that render in Markdown, GitHub, Obsidian, and most documentation platforms.
All Mermaid diagrams follow this pattern:
diagramType
definition content
flowchart, sequenceDiagram, classDiagram, ...)%% for commentsA["Node (with parens)"]api, db, userSvc not applicationProgrammingInterfaceREQUIRED SUB-SKILL: Use color-palette-frappe for complete color palette reference.
| Purpose | Color | Hex |
|---------|-------|-----|
| Primary/Default | Blue | #8caaee |
| Success/Start | Green | #a6d189 |
| Error/Stop | Red | #e78284 |
| Warning | Yellow | #e5c890 |
| Info/Highlight | Teal | #81c8be |
| Accent | Peach | #ef9f76 |
| Text (on dark) | Text | #c6d0f5 |
| Background | Base | #303446 |
| Border/Stroke | Surface 1 | #51576d |
| Need to show | Use | Reference |
|--------------|-----|-----------|
| Process, algorithm, decision tree | Flowchart | references/flowcharts.md |
| API flow, temporal interaction | Sequence | references/sequence-diagrams.md |
| Domain model, OOP design | Class | references/class-diagrams.md |
| Database schema, tables | ERD | references/erd-diagrams.md |
| System architecture (multi-level) | C4 | references/c4-diagrams.md |
| Cloud services, infra, CI/CD | Architecture (beta) | references/architecture-diagrams.md |
| Styling, themes, config | Advanced | references/advanced-features.md |
Also available (inline, no dedicated reference): state diagrams (stateDiagram-v2), git graphs (gitGraph), gantt charts (gantt), pie charts (pie). See Mermaid docs for syntax.
flowchart TD
Start([User visits]) --> Auth{Authenticated?}
Auth -->|No| Login[Show login]
Auth -->|Yes| Dashboard[Show dashboard]
Login --> Auth
style Start fill:#a6d189,stroke:#81c8be,color:#303446
style Dashboard fill:#8caaee,stroke:#51576d,color:#c6d0f5
classDef decision fill:#e5c890,stroke:#ef9f76,color:#303446
class Auth decision
Directions: TD (top-down), LR (left-right), BT, RL
Node shapes:
[text] rectangle([text]) stadium/pill{text} diamond (decision)[(text)] cylinder (database)[[text]] subroutinesequenceDiagram
autonumber
participant User
participant API
participant DB
User->>+API: POST /login
API->>+DB: Query user
DB-->>-API: User data
alt Valid credentials
API-->>User: 200 + JWT
else Invalid
API-->>-User: 401
end
Arrows: ->> sync, -->> response, -) async
Blocks: alt/else/end, opt/end, par/and/end, loop/end
classDiagram
Customer "1" --> "0..*" Order : places
Order "1" *-- "1..*" LineItem : contains
class Customer {
+String email
+placeOrder(cart)
}
class Order {
+Decimal total
+ship()
}
Relationships:
-- association*-- composition (child dies with parent)o-- aggregation (child can exist alone)<|-- inheritance<|.. implementationVisibility: + public, - private, # protected
erDiagram
USER ||--o{ ORDER : places
ORDER ||--|{ LINE_ITEM : contains
PRODUCT ||--o{ LINE_ITEM : includes
USER {
uuid id PK
string email UK
string name
}
ORDER {
uuid id PK
uuid user_id FK
decimal total
}
Cardinality: || exactly one, |o zero or one, }| one or many, }o zero or many
C4Context
title System Context
Person(user, "User", "Uses the app")
System(app, "Application", "Main system")
System_Ext(email, "Email Service", "Sends notifications")
Rel(user, app, "Uses", "HTTPS")
Rel(app, email, "Sends via", "SMTP")
Elements: Person, System, System_Ext, Container, ContainerDb, Component
flowchart LR
A[Success]:::success
B[Warning]:::warning
C[Error]:::error
D[Info]:::info
A --> B --> C --> D
classDef success fill:#a6d189,stroke:#81c8be,color:#303446
classDef warning fill:#e5c890,stroke:#ef9f76,color:#303446
classDef error fill:#e78284,stroke:#ea999c,color:#303446
classDef info fill:#8caaee,stroke:#85c1dc,color:#303446
flowchart LR
A[Normal]
B[Highlighted]
A --> B
style B fill:#a6d189,stroke:#81c8be,color:#303446
---
config:
theme: base
themeVariables:
primaryColor: "#8caaee"
primaryTextColor: "#c6d0f5"
primaryBorderColor: "#51576d"
lineColor: "#838ba7"
secondaryColor: "#a6d189"
tertiaryColor: "#e5c890"
background: "#303446"
---
flowchart LR
A --> B
Themes: default, forest, dark, neutral, base
Look: classic (default), handDrawn (sketch style)
| Wrong | Correct |
|-------|---------|
| A[Node (test)] | A["Node (test)"] |
| A --> B + C | A --> B then A --> C |
| Unquoted label with {} | Quote it: "label {data}" |
| Random hex colors | Use Frappe palette colors |
%% — explain non-obvious relationships and styling choices.mmd files alongside the systems they describe.md filesnpm i -g @mermaid-js/mermaid-cli then mmdc -i diagram.mmd -o output.pngdocker run --rm -v $(pwd):/data minlag/mermaid-cli -i /data/input.mmd -o /data/output.pngdevelopment
Explicitly triggered when the user mentions `wiki-map`. It ingests, queries, lints, or compiles a markdown wiki.
testing
Explicitly triggered when the user mentions `single-skill-creator`. It scaffolds a new `SKILL.md`.
testing
Explicitly triggered when the user mentions `qmd`. It searches local markdown or QMD collections.
development
Explicitly triggered when the user mentions `ontology-map`. It builds, refreshes, or checks an ontology.