Mermaid Diagrams
by jordanfbrown
Generate syntactically correct Mermaid diagrams. Use when creating flowcharts, sequence diagrams, state diagrams, ERDs, class diagrams, or any visual diagram in Mermaid format.
Skill Details
Repository Files
1 file in this skill directory
name: mermaid-diagrams description: Generate syntactically correct Mermaid diagrams. Use when creating flowcharts, sequence diagrams, state diagrams, ERDs, class diagrams, or any visual diagram in Mermaid format.
Mermaid Diagram Generation
When generating Mermaid diagrams, follow these rules to ensure valid syntax.
Universal Rules
- Avoid special characters in labels - Characters like
::,<,>,|,{,}often have special meaning - Quote labels with spaces - Use quotes around labels containing spaces:
A["My Label"] - No empty lines inside diagram blocks - Keep diagram content contiguous
stateDiagram-v2
Known Limitations
-
Do NOT use
::in transition labels - The::sequence is interpreted as special syntax%% BAD - will cause parse error stateDiagram-v2 [*] --> Created: Link::Created %% GOOD - use spaces or other separators stateDiagram-v2 [*] --> Created : Link Created [*] --> Created : Link/Created [*] --> Created : Link_Created -
State names must be simple identifiers - No special characters in state names
-
Use spaces around
:in transitions -A --> B : labelnotA --> B:label
flowchart / graph
Syntax Tips
flowchart TD
%% Node shapes
A[Rectangle]
B(Rounded)
C([Stadium])
D[[Subroutine]]
E[(Database)]
F((Circle))
G{Diamond}
H{{Hexagon}}
%% Labels with special chars need quotes
I["Label with (parens)"]
J["Label with [brackets]"]
Known Limitations
- Escape special characters in labels - Use quotes and HTML entities when needed
- Subgraph IDs must be unique - Don't reuse IDs across subgraphs
sequenceDiagram
Syntax Tips
sequenceDiagram
participant A as Alice
participant B as Bob
A->>B: Solid arrow
A-->>B: Dashed arrow
A-xB: Cross end
A--xB: Dashed cross
Note over A,B: Note spanning participants
alt Condition
A->>B: If true
else Other
A->>B: If false
end
loop Every minute
A->>B: Repeated
end
Known Limitations
- Participant names with spaces - Use
participant X as "Name With Spaces" - Messages cannot contain
-->- This is reserved syntax
erDiagram
Syntax Tips
erDiagram
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ LINE_ITEM : contains
PRODUCT ||--o{ LINE_ITEM : "is in"
Cardinality Symbols
| Symbol | Meaning |
|---|---|
|| |
Exactly one |
o| |
Zero or one |
}o |
Zero or many |
}| |
One or many |
Known Limitations
- Entity names must be single words - Use underscores:
LINE_ITEMnotLine Item - Relationship labels with spaces need quotes -
"is in"notis in
classDiagram
Syntax Tips
classDiagram
class Animal {
+String name
+int age
+makeSound() void
}
Animal <|-- Dog : extends
Dog *-- Tail : composition
Dog o-- Owner : aggregation
Known Limitations
- Generic types - Use
List~String~notList<String>(tildes instead of angle brackets) - Method signatures - Keep them simple, complex signatures may not parse
gantt
Syntax Tips
gantt
title Project Timeline
dateFormat YYYY-MM-DD
section Phase 1
Task 1 :a1, 2024-01-01, 30d
Task 2 :after a1, 20d
section Phase 2
Task 3 :2024-02-01, 15d
Known Limitations
- Task names cannot contain
:or,- These are delimiter characters - Section names cannot be empty - Must have at least one character
Viewing Diagrams
Use the mermaid_view tool to render diagrams in the browser:
~/wealthsimple/scripts/mermaid_view/mermaid_view.js "flowchart TD\n A --> B"
Troubleshooting
If a diagram fails to render:
- Check for reserved characters -
::,-->,|, etc. in labels - Validate quotes - Labels with special chars need proper quoting
- Simplify and rebuild - Start with minimal diagram, add complexity incrementally
- Check Mermaid version - Some syntax is version-specific
Related Skills
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.
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.
Market Sizing Analysis
This skill should be used when the user asks to "calculate TAM", "determine SAM", "estimate SOM", "size the market", "calculate market opportunity", "what's the total addressable market", or requests market sizing analysis for a startup or business opportunity.
Anndata
This skill should be used when working with annotated data matrices in Python, particularly for single-cell genomics analysis, managing experimental measurements with metadata, or handling large-scale biological datasets. Use when tasks involve AnnData objects, h5ad files, single-cell RNA-seq data, or integration with scanpy/scverse tools.
Geopandas
Python library for working with geospatial vector data including shapefiles, GeoJSON, and GeoPackage files. Use when working with geographic data for spatial analysis, geometric operations, coordinate transformations, spatial joins, overlay operations, choropleth mapping, or any task involving reading/writing/analyzing vector geographic data. Supports PostGIS databases, interactive maps, and integration with matplotlib/folium/cartopy. Use for tasks like buffer analysis, spatial joins between dat
Market Research Reports
Generate comprehensive market research reports (50+ pages) in the style of top consulting firms (McKinsey, BCG, Gartner). Features professional LaTeX formatting, extensive visual generation with scientific-schematics and generate-image, deep integration with research-lookup for data gathering, and multi-framework strategic analysis including Porter's Five Forces, PESTLE, SWOT, TAM/SAM/SOM, and BCG Matrix.
Plotly
Interactive scientific and statistical data visualization library for Python. Use when creating charts, plots, or visualizations including scatter plots, line charts, bar charts, heatmaps, 3D plots, geographic maps, statistical distributions, financial charts, and dashboards. Supports both quick visualizations (Plotly Express) and fine-grained customization (graph objects). Outputs interactive HTML or static images (PNG, PDF, SVG).
Excel Analysis
Analyze Excel spreadsheets, create pivot tables, generate charts, and perform data analysis. Use when analyzing Excel files, spreadsheets, tabular data, or .xlsx files.
Neurokit2
Comprehensive biosignal processing toolkit for analyzing physiological data including ECG, EEG, EDA, RSP, PPG, EMG, and EOG signals. Use this skill when processing cardiovascular signals, brain activity, electrodermal responses, respiratory patterns, muscle activity, or eye movements. Applicable for heart rate variability analysis, event-related potentials, complexity measures, autonomic nervous system assessment, psychophysiology research, and multi-modal physiological signal integration.
