/SKILL.md
Render Mermaid diagrams as SVG or ASCII art using the beautiful-mermaid library. Ultra-fast rendering with 15 built-in themes and Shiki VS Code theme support. Use when: (1) Creating diagrams from Mermaid syntax, (2) Rendering flowcharts, state, sequence, class, or ER diagrams, (3) Generating ASCII diagrams for terminal/markdown output, (4) Theming diagrams to match VS Code color schemes, (5) Embedding diagrams in documentation or web UIs. Supports SVG output with live theme switching and ASCII/Unicode output for plain text contexts.
npx skillsauth add alexmikhalev/beautiful-mermaid beautiful-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.
Render Mermaid diagrams as SVG (for UIs) or ASCII/Unicode (for terminals and markdown).
npm install beautiful-mermaid
Or run the setup script:
bash scripts/setup.sh
import { renderMermaid } from 'beautiful-mermaid'
const svg = await renderMermaid(`
graph LR
A[Start] --> B{Decision}
B -->|Yes| C[Action]
B -->|No| D[End]
`)
import { renderMermaidAscii } from 'beautiful-mermaid'
const ascii = renderMermaidAscii(`graph LR; A --> B --> C`)
// Output:
// +---+ +---+ +---+
// | A |---->| B |---->| C |
// +---+ +---+ +---+
renderMermaid(text, options?): Promise<string>Returns SVG string. Options:
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| bg | string | "#FFFFFF" | Background color |
| fg | string | "#27272A" | Foreground color |
| font | string | "Inter" | Font family |
| transparent | boolean | false | Transparent background |
| line | string | auto | Edge/connector color |
| accent | string | auto | Arrow heads, highlights |
| muted | string | auto | Secondary text, labels |
| surface | string | auto | Node fill tint |
| border | string | auto | Node stroke |
renderMermaidAscii(text, options?): stringReturns ASCII/Unicode string. Synchronous. Options:
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| useAscii | boolean | false | Use ASCII chars instead of Unicode |
| paddingX | number | 5 | Horizontal node spacing |
| paddingY | number | 5 | Vertical node spacing |
| boxBorderPadding | number | 1 | Inner box padding |
Provide only bg and fg. All other colors are derived automatically:
const svg = await renderMermaid(diagram, {
bg: '#1a1b26',
fg: '#a9b1d6'
})
import { renderMermaid, THEMES } from 'beautiful-mermaid'
const svg = await renderMermaid(diagram, THEMES['tokyo-night'])
Available themes: zinc-light, zinc-dark, tokyo-night, tokyo-night-storm, tokyo-night-light, catppuccin-mocha, catppuccin-latte, nord, nord-light, dracula, github-light, github-dark, solarized-light, solarized-dark, one-dark.
import { getSingletonHighlighter } from 'shiki'
import { renderMermaid, fromShikiTheme } from 'beautiful-mermaid'
const highlighter = await getSingletonHighlighter({
themes: ['vitesse-dark']
})
const colors = fromShikiTheme(highlighter.getTheme('vitesse-dark'))
const svg = await renderMermaid(diagram, colors)
See themes.md for complete theming reference.
| Type | Syntax | Example |
|------|--------|---------|
| Flowchart | graph TD/LR/BT/RL | graph LR; A --> B |
| State | stateDiagram-v2 | stateDiagram-v2\n[*] --> Active |
| Sequence | sequenceDiagram | sequenceDiagram\nAlice->>Bob: Hello |
| Class | classDiagram | classDiagram\nAnimal <|-- Dog |
| ER | erDiagram | erDiagram\nCUSTOMER ||--o{ ORDER : places |
import { renderMermaid, THEMES } from 'beautiful-mermaid'
import { writeFile } from 'fs/promises'
const svg = await renderMermaid(diagram, THEMES['github-dark'])
await writeFile('diagram.svg', svg)
import { renderMermaidAscii } from 'beautiful-mermaid'
const ascii = renderMermaidAscii(diagram, { useAscii: true })
const markdown = `## Architecture\n\n\`\`\`\n${ascii}\n\`\`\``
SVG output uses CSS custom properties. Switch themes without re-rendering:
svgElement.style.setProperty('--bg', '#282a36')
svgElement.style.setProperty('--fg', '#f8f8f2')
| File | Contents | |------|----------| | themes.md | Complete theming guide, color derivation, custom themes | | ascii-rendering.md | ASCII mode options, Unicode vs ASCII, formatting |
"Cannot find module 'beautiful-mermaid'": Run npm install beautiful-mermaid
Empty SVG output: Verify Mermaid syntax is valid. Test at mermaid.live first.
Fonts not rendering: Ensure the font is available. Use web-safe fonts or embed font CSS.
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.
development
Run, watch, debug, and extend OpenClaw QA testing with qa-lab and qa-channel. Use when Codex needs to execute the repo-backed QA suite, inspect live QA artifacts, debug failing scenarios, add new QA scenarios, or explain the OpenClaw QA workflow. Prefer the live OpenAI lane with regular openai/gpt-5.4 in fast mode; do not use gpt-5.4-pro or gpt-5.4-mini unless the user explicitly overrides that policy.
development
End-to-end Parallels smoke, upgrade, and rerun workflow for OpenClaw across macOS, Windows, and Linux guests. Use when Codex needs to run, rerun, debug, or interpret VM-based install, onboarding, gateway smoke tests, latest-release-to-main upgrade checks, fresh snapshot retests, or optional Discord roundtrip verification under Parallels.