skills/writing/mermaid-graphing/SKILL.md
Create readable Mermaid diagrams inside Markdown files. Use for flowcharts and sequence diagrams that must render cleanly in common Markdown renderers (e.g., GitHub) without horizontal scrolling. Covers fenced mermaid blocks, init/theme styling, label wrapping with <br/>, and sequenceDiagram layout rules (short IDs, wrapped labels, don’t break identifiers).
npx skillsauth add igamenovoer/magic-context mermaid-graphingInstall 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.
.md docs/notes and want diagrams that render in-place via Mermaid.sequenceDiagram).mermaid info string (Mermaid does not render reliably as “inline” Markdown).<br/>) when needed. Mermaid does not support raw \n line breaks in labels.```mermaid
sequenceDiagram
participant A as Agent<br/>(Python)
participant S as Service<br/>(C++)
A->>S: do_work<br/>(arg1,arg2)
S-->>A: result
Notes:
- `sequenceDiagram` keyword must be lowercase.
- Keep one diagram per code block; do not mix Mermaid and non-Mermaid text inside the fence.
## Styling and Layout (Avoid Wide Diagrams)
Most “bad” Mermaid diagrams are too wide because participant labels and message labels are long. Fix width first by:
- Using short participant IDs, and putting the long readable label in `as ...`.
- Wrapping long labels with `<br/>` (wrap the label, not the ID).
- Shortening repeated prefixes by declaring an alias once (participant label), then using the short ID everywhere.
For sequence diagrams, use the dedicated guide: `references/sequence-diagram-styling.md`.
## Diagram Init/Theme (Optional)
If your renderer supports Mermaid init blocks, you can apply consistent styling per diagram:
```mermaid
%%{init: {'theme': 'base', 'themeVariables': {'fontFamily': 'ui-sans-serif', 'fontSize': '14px'}}}%%
sequenceDiagram
participant A as Agent<br/>(Python)
participant S as Service<br/>(C++)
A->>S: do_work<br/>(arg1,arg2)
S-->>A: result
If the init block does not render, remove it and fall back to label-wrapping and short IDs (these work everywhere).
<br/> for wrapping; no raw \n escapes.See troubleshoot.md for common Mermaid parse errors and fixes (especially flowchart node labels that include <br/> and parentheses).
development
Manual invocation only; use only when the user explicitly requests `make-program-tutorial` by exact name, OR when the user asks to use a skill to create an SDK/API/library tutorial. Create a clear, reproducible, step-by-step tutorial for a specific API/SDK/library (or a set of functions/classes), with runnable examples, expected outputs, and basic troubleshooting.
testing
Use when the user wants to create a self-hosted, offline-installable Conda channel (mirror) containing a specific subset of packages using Pixi.
tools
Guides the agent to setup a new or existing Pixi environment for compiling C++ and CUDA code. It ensures the correct compilers, toolkits, and CMake configurations are in place for a robust user-space build.
tools
Use when the user says "use pixi to install <some nvidia tool>" (or similar) and wants NVIDIA/CUDA/GPU packages installed via Pixi (no sudo/apt), e.g., CUDA toolkit pieces, cuDNN/NCCL, PyTorch CUDA builds, RAPIDS.