Skip to content
mermaid-builder logo

Mermaid Builder

mermaid-builder

Expert guidance for creating syntactically correct Mermaid diagrams. Use when creating flowcharts, sequence diagrams, class diagrams, state diagrams, Gantt charts, ER diagrams, or data lineage visualizations.

SKILL.md

Full skill instructions

Mermaid Builder

Core Philosophy

  • Correctness: Follow Mermaid syntax rules strictly
  • Clarity: Diagrams communicate complex ideas simply
  • Simplicity: Avoid overloading with unnecessary detail
  • Modularity: Break complex diagrams into subgraphs

Critical: Label Quoting Rule

RULE: Wrap labels in double quotes if they contain spaces, special characters, or punctuation.

%% CORRECT - labels with spaces quoted
flowchart LR
    A["User Login"] --> B["Process Request"]
    C["Pay $100?"] --> D["Confirm (Yes/​No)"]

%% WRONG - will fail to render
flowchart LR
    A[User Login] --> B[Process Request]

Must quote: Spaces, special chars ($%&), punctuation (:,;), operators (()[]) Optional: Simple alphanumeric (Login, Process, Node1)

When in doubt, use quotes. It never hurts.

Quick Reference

Flowchart Shapes

SyntaxShape
["Text"]Rectangle
("Text")Rounded
{"Text"}Diamond (decision)
[("Text")]Cylinder (database)
(("Text"))Circle

Arrow Types

SyntaxType
-->Solid arrow
---Solid line
-.->Dotted arrow
==>Thick arrow
`-->Label

Diagram Types

TypeDeclarationUse Case
Flowchartflowchart TDProcesses, workflows, decisions
SequencesequenceDiagramComponent interactions, API flows
ClassclassDiagramOOP structure, models
StatestateDiagram-v2State transitions
GanttganttTimelines, scheduling
ERerDiagramDatabase schema
PiepieProportional data

Directions: TB/TD (top-down), BT (bottom-up), LR (left-right), RL (right-left)

See resources/​diagram-examples.md for complete examples of each diagram type.

Minimal Examples

Flowchart

flowchart TD
    Start["Start"] --> Check{Valid?}
    Check -->|Yes| Process["Process"]
    Check -->|No| Error["Error"]
    Process --> End["End"]

Sequence

sequenceDiagram
    Client->>Server: Request
    Server-->>Client: Response

ER Diagram

erDiagram
    USER ||--o{ ORDER : "places"
    USER { int id PK string email }
    ORDER { int id PK int user_id FK }

Subgraphs for Organization

flowchart TD
    subgraph "Frontend"
        A["UI"]
    end
    subgraph "Backend"
        B["API"]
        C[("DB")]
    end
    A --> B --> C

Styling

flowchart TD
    A["Success"] --> B["Error"]

    classDef successStyle fill:#C8E6C9,stroke:#388E3C
    classDef errorStyle fill:#FFCDD2,stroke:#D32F2F

    class A successStyle
    class B errorStyle

Common Errors to Avoid

ErrorWrongCorrect
Unquoted spacesA[User Login]A["User Login"]
Invalid arrowA -> BA --> B
Unquoted specialA[Cost: $100]A["Cost: $100"]
Missing bracketA["Node --> BA["Node"] --> B

Validation Checklist

  • Labels with spaces are quoted
  • Labels with special characters quoted
  • Brackets properly matched
  • Arrow syntax correct (--> not ->)
  • Node IDs unique and meaningful
  • Comments explain complex sections
  • Previewed without errors

Data Lineage Patterns

See resources/​data-lineage.md for:

  • ETL pipeline patterns
  • Multi-layer data architecture
  • Cross-system data flows
  • Database schema lineage
  • Streaming data lineage
  • Column-level lineage

Resources


Remember: The quoting rule is the #1 cause of Mermaid rendering failures. When in doubt, quote it.

More Productivity & Planning skills

brainstorming logo
Productivity & Planning

brainstorming

Structured design dialogue that validates ideas before implementation begins.

295.4K 385.7K
View
ui-ux-pro-max logo
Productivity & Planning

ui-ux-pro-max

Comprehensive design intelligence for web and mobile UI/UX across 10 technology stacks.

133.1K 383.9K
View
writing-plans logo
Productivity & Planning

writing-plans

Comprehensive implementation plans for multi-step tasks, breaking down specs into bite-sized, testable steps.

295.4K 268K
View
using-superpowers logo
Productivity & Planning

using-superpowers

Introduction to the obra skills system with mandatory skill invocation rules and best practices.

295.4K 259.8K
View
executing-plans logo
Productivity & Planning

executing-plans

Execute a written implementation plan with critical review and task checkpoints.

295.4K 229.1K
View
dispatching-parallel-agents logo
Productivity & Planning

dispatching-parallel-agents

Delegate independent tasks to specialized agents working concurrently with isolated context.

295.4K 206.3K
View
using-git-worktrees logo
Productivity & Planning

using-git-worktrees

Isolated git worktrees with smart directory selection and safety verification.

295.4K 205.2K
View
webapp-testing logo
Productivity & Planning

webapp-testing

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

179.7K 170.6K
View
content-strategy logo
Productivity & Planning

content-strategy

Plan searchable and shareable content that drives traffic, builds authority, and generates leads.

53.3K 150.9K
View
repo-intake-and-plan logo
Productivity & Planning

repo-intake-and-plan

README-first repository scanner that extracts commands and classifies reproduction candidates without executing them.

497 139.6K
View
marketing-ideas logo
Productivity & Planning

marketing-ideas

Brainstorm and prioritize marketing strategies tailored to your SaaS stage, budget, and goals.

53.3K 137.2K
View
site-architecture logo
Productivity & Planning

site-architecture

Plan and optimize your website's page hierarchy, navigation, URL structure, and internal linking.

53.3K 112.8K
View

Productivity AI tools

Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View
SaveDay logo
Productivity

SaveDay

Capture, organize, and utilize your knowledge effortlessly.

Free
View
Any Summary logo
Productivity

Any Summary

Instant Summaries of Audio & Video Interviews with AnySummary

Freemium
View
M
Productivity

Map This

Transform PDFs into engaging mind maps.

Freemium
View
ChatPDF logo
Productivity

ChatPDF

Chat with any PDF instantly

Free
View
I
Productivity

intellisay

Create an optimal daily plan using your voice

Paid
View
A
Productivity

Aurora AI

A productivity platform to centralize organizational knowledge and workflows with contextual AI assistance.

Paid
View
AskYourPDF logo
Productivity

AskYourPDF

AskYourPDF Pricing Plans: Tailored to Your Needs

Free
View