cw/skills/mermaid/SKILL.md
Rules and validation for Mermaid diagrams. Use when creating or editing Mermaid diagrams in documentation.
npx skillsauth add haowjy/creative-writing-skills mermaidInstall 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.
Use this skill when writing or editing fenced mermaid blocks. Keep diagrams readable in source and validate syntax before handing work back.
A["Config (optional)"].A -->|"uses (runtime)"| B.<br/> for line breaks in labels, not \n.end as a node label. Use End or quote the label.o or x after an edge, add a space so Mermaid does not parse it as a circle or cross edge: A--- oNode.flowchart LR
A["Turn 1<br/>user message"] -->|"creates (draft)"| B["Draft artifact"]
B --> C["Review"]
Validate changed Markdown or .mmd files with the bundled helper:
uv run scripts/check_mermaid.py path/to/file.md
If uv is not available but Python is, run python3 scripts/check_mermaid.py path/to/file.md.
If only Node/npm is available, extract the Mermaid block to a temporary .mmd file and validate it directly with npx:
npx --yes @mermaid-js/mermaid-cli -q -i diagram.mmd -o diagram.svg
Use direct npx for standalone .mmd files or copied blocks. The Python helper is still preferred for Markdown files because it extracts fenced mermaid blocks and reports source line numbers.
The helper uses Mermaid CLI and returns a real pass/fail exit code. If Node.js/npm is not available, it prints a first-run notice and installs a private Node runtime under the user's cache directory. It prefers uv to create a venv for nodeenv, then falls back to python -m venv plus pip. This does not modify the repo or system Node installation. Set MERMAID_VALIDATOR_NO_BOOTSTRAP=1 to disable automatic setup.
If the script cannot run because the machine has no usable Python, uv, mise, or Node/npm, do not improvise a system install silently. Tell the user Mermaid validation needs one of those tools and ask whether they want you to install one. Prefer uv or mise when available in the user's environment; otherwise direct installers for Python or Node are acceptable.
data-ai
Use before acting on the author's instructions — separate what they said from what they meant.
testing
Use when challenging a plan — grills the author against documented decisions and sharpens terminology.
testing
Creative-writing session lead and entry point. Activate this to get a creative partner that brainstorms, drafts, critiques, revises, and maintains your story's knowledge base. Built for Claude.ai, where there are no subagents: it runs every mode of the work in one conversation. Load alongside the craft skills (writing-principles, prose-writing, scene-construction, prose-critique). Use at the start of any story session.
testing
Shared vocabulary for creative writing projects. Load when establishing canonical story terms, resolving ambiguous names, checking term consistency, or deciding where vocabulary belongs in kb/.