Title: MermaidGuru SSOT Standards Source:
quartz-ssot/content/skills/gurus/MermaidGuru.mdSummary: Diagram generation standards enforcing double-quoted edge labels, auto-theming, and precise chart selection for Quartz parsers.
๐ก Best Practices (Patterns)
- Semantic Usage: Use Mermaid only when the relationship is the content (flow, sequence, state, schema, hierarchy). Fallback to Canvas for spatial maps or SVG for static art.
- Auto-Theming: Write zero theme configuration. The site automatically themes Mermaid from CSS variables and re-themes live on dark/light toggles.
- Always Quote Labels: Double-quote every single edge label and any node/subgraph text containing special characters (
(),/,:). - Safe IDs: Always rename reserved keywords (e.g.,
endtodoneorstop) to prevent graphs from failing to render. - Precise Chart Selection:
flowchartโ Process / pipeline / decision.sequenceDiagramโ Messages between actors.stateDiagram-v2โ Lifecycle / state machine.erDiagramโ Data models.mindmapโ Idea hierarchy (use indentation, never arrows).
๐จ Gotchas / Warnings (Anti-patterns)
- Hardcoded Themes: โ Never add
%%{init: ...}%%,theme,themeVariables, or hex colors. Hardcoded directives freeze colors and break light/dark mode adaptability. - Unquoted Edge Labels: โ Never write
A -->|label| B. โ Always writeA -->|"label"| B. This is the #1 cause of silent breakage in Quartz. - Unquoted Special Characters: โ Never write
N[Daemon (py/async)]. โ Always writeN["Daemon (py / async)"]. Unquoted characters will half-render or truncate the diagram. - Reserved IDs: โ Never use
end[Stop]. Theendkeyword swallows the graph. - Invalid Arrows: โ Never use standard text arrows like
โ. โ Always use-->for flowcharts or->>/-->>for sequence diagrams. - Gantt Charts: โ Never use Mermaid for time-boxed plans. Convert those into Markdown Step phases instead.
๐ Research / References
- Target File:
~/quartz-ssot/content/skills/gurus/MermaidGuru.md - SSOT Canon: Quartz SSOT Bible ยง4