Mermaid Builder
by majesticlabs-dev
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 Details
Repository Files
3 files in this skill directory
name: mermaid-builder description: 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. allowed-tools: Read, Write, Edit, MultiEdit, Grep, Glob, Bash, WebSearch, WebFetch
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
| Syntax | Shape |
|---|---|
["Text"] |
Rectangle |
("Text") |
Rounded |
{"Text"} |
Diamond (decision) |
[("Text")] |
Cylinder (database) |
(("Text")) |
Circle |
Arrow Types
| Syntax | Type |
|---|---|
--> |
Solid arrow |
--- |
Solid line |
-.-> |
Dotted arrow |
==> |
Thick arrow |
| `--> | Label |
Diagram Types
| Type | Declaration | Use Case |
|---|---|---|
| Flowchart | flowchart TD |
Processes, workflows, decisions |
| Sequence | sequenceDiagram |
Component interactions, API flows |
| Class | classDiagram |
OOP structure, models |
| State | stateDiagram-v2 |
State transitions |
| Gantt | gantt |
Timelines, scheduling |
| ER | erDiagram |
Database schema |
| Pie | pie |
Proportional 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
| Error | Wrong | Correct |
|---|---|---|
| Unquoted spaces | A[User Login] |
A["User Login"] |
| Invalid arrow | A -> B |
A --> B |
| Unquoted special | A[Cost: $100] |
A["Cost: $100"] |
| Missing bracket | A["Node --> B |
A["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.
Related Skills
Xlsx
Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas
Clickhouse Io
ClickHouse database patterns, query optimization, analytics, and data engineering best practices for high-performance analytical workloads.
Clickhouse Io
ClickHouse database patterns, query optimization, analytics, and data engineering best practices for high-performance analytical workloads.
Analyzing Financial Statements
This skill calculates key financial ratios and metrics from financial statement data for investment analysis
Data Storytelling
Transform data into compelling narratives using visualization, context, and persuasive structure. Use when presenting analytics to stakeholders, creating data reports, or building executive presentations.
Team Composition Analysis
This skill should be used when the user asks to "plan team structure", "determine hiring needs", "design org chart", "calculate compensation", "plan equity allocation", or requests organizational design and headcount planning for a startup.
Startup Financial Modeling
This skill should be used when the user asks to "create financial projections", "build a financial model", "forecast revenue", "calculate burn rate", "estimate runway", "model cash flow", or requests 3-5 year financial planning for a startup.
Kpi Dashboard Design
Design effective KPI dashboards with metrics selection, visualization best practices, and real-time monitoring patterns. Use when building business dashboards, selecting metrics, or designing data visualization layouts.
Dbt Transformation Patterns
Master dbt (data build tool) for analytics engineering with model organization, testing, documentation, and incremental strategies. Use when building data transformations, creating data models, or implementing analytics engineering best practices.
Startup Metrics Framework
This skill should be used when the user asks about "key startup metrics", "SaaS metrics", "CAC and LTV", "unit economics", "burn multiple", "rule of 40", "marketplace metrics", or requests guidance on tracking and optimizing business performance metrics.
