Mermaid Diagram Rendering with beautiful-mermaid

SkillDev tools

Proactively suggest diagrams when explaining complex systems. Triggers on diagrams, charts, visualizations, flowcharts, sequence diagrams, architecture diagrams, ER diagrams, state machines, Gantt charts, mindmaps, C4, class diagrams, git graphs, kanban boards, sankey, timelines, quadrant charts, XY

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the Mermaid Diagram Rendering with beautiful-mermaid skill

What this skill tells your AI

The instructions your AI receives, as published by ccheney/robust-skills in skills/mermaid-diagrams/SKILL.md and read by ahel’s review.

Render Mermaid .mmd files into styled SVG using beautiful-mermaid v1.0.2 and bun.

Skill Contents

FilePurpose
render-mermaid.tsCLI tool: renders .mmd files to SVG
gemini-diagram-prompt.mdPrompt for Gemini image generation

Installation

Only bun is required. The beautiful-mermaid dependency is auto-installed by bun on first run.

# macOS
brew install oven-sh/bun/bun

# Or universal installer
curl -fsSL https://bun.sh/install | bash

CLI Reference

render-mermaid — Render Mermaid .mmd files to themed SVG

Usage:
  bun run render-mermaid.ts [options] <input.mmd...>
  echo 'graph TD; A-->B' | bun run render-mermaid.ts -o out.svg

Options:
  -o, --output <file>   Output file (single input only)
  --outdir <dir>        Output directory for multiple files
  -t, --theme <name>    Theme (default: tokyo-night)
  --list-themes         List available themes
  --help                Show this help

Output defaults: Without -o or --outdir, writes <name>.svg next to each input file (-d is swallowed by bun run; use --outdir).

Shorthand: Set MERMAID=plugins/autorun/skills/mermaid-diagrams/render-mermaid.ts for shorter commands.

Examples

MERMAID=plugins/autorun/skills/mermaid-diagrams/render-mermaid.ts

# Render single file (output next to input)
bun run $MERMAID diagram.mmd

# Render to specific output
bun run $MERMAID diagram.mmd -o pretty.svg

# Render all .mmd files to output directory
bun run $MERMAID docs/diagrams/*.mmd --outdir docs/diagrams

# Different theme
bun run $MERMAID -t dracula diagram.mmd

# Pipe from stdin
echo 'graph TD; A-->B-->C' | bun run $MERMAID -o quick.svg

# List themes
bun run $MERMAID --list-themes

Project Diagrams

Mermaid source files (.mmd) and rendered output (.svg) in docs/diagrams/, plus one source at the repository root:

SourceDescription
docs/diagrams/autofile-policy.mmdAutoFile policy flowchart
docs/diagrams/three-stage-autorun.mmdThree-stage autorun flowchart
autorun-architecture.mmdFull architecture (too complex for beautiful-mermaid)

Regenerate:

bun run $MERMAID docs/diagrams/*.mmd --outdir docs/diagrams

Known Limitations

  • Complex diagrams with deeply nested subgraphs may hit dagre layout bugs. Failed diagrams are reported but don't block other renders.
  • %%{init:...}%% front matter is stripped automatically (beautiful-mermaid applies its own theming).

<image_generation>

Gemini Image Generation

gemini-diagram-prompt.md contains a prompt for Gemini to generate an outcome-focused project overview image. Copy the prompt into a Gemini conversation.

</image_generation>

Signals

GitHub stars
59
Forks
3
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
mermaid-diagrams
Source
github.com/ccheney/robust-skills