ai-tools/mermaid-diagramming/SKILL.md
Create, edit, and layout Mermaid diagrams (.mmd files) correctly in VS Code using the MermaidChart extension. Use when creating or modifying any Mermaid diagram — flowcharts, sequence diagrams, etc. Covers node shapes, edge types, line breaks in labels, subgraph layout rules (side-by-side vs stacked), and VS Code preview commands. Critical: subgraph direction TB is silently ignored when nodes link across subgraphs.
npx skillsauth add randyhaylor/enhanceclaude mermaid-diagrammingInstall 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.
Extension: MermaidChart.vscode-mermaid-chart
With a .mmd file open and focused:
Ctrl+Shift+P → "MermaidChart: Preview Diagram"Use <br/> — \n renders as literal text:
A["First line<br/>Second line"] %% correct
A["First line\nSecond line"] %% WRONG — shows \n literally
A["text"] %% rectangle (process)
A("text") %% rounded
A(["text"]) %% stadium / terminal
A{"text"} %% diamond / decision
A[("text")] %% cylinder / database
A(("text")) %% circle
A --> B %% arrow
A --- B %% open line
A -.-> B %% dotted arrow
A ==> B %% thick arrow
A -->|label| B %% labeled arrow
A ~~~ B %% invisible (forces layout without visible connection)
flowchart TD %% top-down
flowchart LR %% left-right
flowchart BT %% bottom-top
flowchart RL %% right-left
"If any node links externally between subgraphs,
direction TBinside the subgraph is ignored and the parent direction is inherited."
This means: if you use flowchart LR and connect nodes across subgraphs, all direction TB declarations inside subgraphs are silently ignored. Internal nodes flow LR.
| Goal | Method |
|------|--------|
| Side-by-side, internal flow top-down | flowchart LR + direction TB inside each subgraph + no node-to-node cross-subgraph links |
| Stacked vertically | flowchart TD + node-to-node cross-subgraph edge |
| Side-by-side, internal flow left-right | flowchart LR only |
Critical: Any node-to-node link crossing between subgraphs silently overrides direction TB — internal nodes inherit the outer direction instead.
%%{init: {
"flowchart": {
"nodeSpacing": 50,
"rankSpacing": 50,
"subGraphTitleMargin": {"top": 15, "bottom": 0},
"wrappingWidth": 200,
"curve": "basis"
},
"themeVariables": {
"clusterBkg": "#1a202c",
"clusterBorder": "#4a5568",
"edgeLabelBackground": "#2d3748",
"primaryColor": "#1a365d",
"primaryTextColor": "#bee3f8",
"fontFamily": "monospace",
"fontSize": "14px"
}
}}%%
Note: subGraphTitleMargin requires capital G. Hex colors only — color names not recognized.
classDef myStyle fill:#2d3748,stroke:#4a5568,color:#e2e8f0
class nodeA,nodeB myStyle
%% Inline:
style nodeA fill:#f9f,stroke:#333,stroke-width:2px
%% Edge styling (by index):
linkStyle 0 stroke:#ff0000,stroke-width:2px
subGraphTitleMargin often has no effect. Use an invisible spacer node instead:
subgraph FOO["Title"]
direction TB
PAD[ ]:::spacer ~~~ A["First real node"]
A --> B
end
classDef spacer fill:none,stroke:none,color:none
%% This is a comment
tools
# XState v5 Quick Reference ## How to Look Up API Details For complete function signatures, types, and interfaces, **grep `api-reference.md`** — do NOT read it in full (12k+ lines). Example: ``` Grep pattern="createActor" path="~/.claude/skills/xstate/api-reference.md" output_mode="content" -C 5 ``` Then use `Read` with `offset`/`limit` to get the full section. This is the primary way to get precise technical info when the quick reference below isn't enough. ## Design Workflow Recommended
tools
Workaround for agent teams in VS Code extension where TeamCreate teammates cannot execute tools. Uses an echo-back-and-resume pattern where agents return tool requests instead of executing them directly.
development
Format documentation, READMEs, and structured text using header hierarchy where each level stands alone. Use when creating docs, research notes, summaries, or when user requests 'scannable,' 'well-structured,' 'skimmable,' or 'readable at multiple depths' output. Applies to markdown, technical specs, and any hierarchical text formatting.
development
Enforce strict Test-Driven Development workflow: write one test, make it pass, verify, then proceed. Prevents over-implementation and ensures code matches requirements exactly. Use when implementing new features, adding settings, or building functionality incrementally.