Sandbox
@imxv/Pretty-mermaid-skills

Mermaid diagram skill for AI agents

Pretty Mermaid adds a skill for generating Mermaid diagrams in formats builders can use right away: SVG for docs, PNG for sharing, and ASCII for terminals. It uses local Node scripts for single renders, batch renders, theme selection, and image output without a browser.

1,197 stars63 forksJavaScriptUpdated 25d ago
Who it's for

Builders who want their agent to turn Mermaid source into polished diagrams for docs and sharing.

What it delivers

You can turn a Mermaid sketch into a themed diagram without leaving your agent or opening a browser.

What it does

Multi-format rendering

Renders Mermaid source to SVG, PNG, and terminal-friendly ASCII or Unicode output.

Built-in themes

Includes 15 themes such as tokyo-night, dracula, github-dark, and solarized-dark.

Six diagram types

Supports flowchart, sequence, state, class, ER, and XY chart diagrams.

Batch rendering

Processes many `.mmd` files at once with `scripts/batch.mjs`.

Local output generation

Creates PNG directly in Node.js and does not need Chromium, Puppeteer, or a DOM.

Agent integrations

Documents use with Claude Code, Cursor, Codex, Gemini CLI, and other agent tools.

How to get it

  1. 1Run
    npx skills add imxv/pretty-mermaid-skills@pretty-mermaid -g -y
  2. 2Run
    npx skills add imxv/pretty-mermaid-skills@pretty-mermaid -g -y
  3. 3Run
    npx skills list -g
  4. 4Run
    node scripts/themes.mjs
  5. 5Run
    node scripts/render.mjs \
      --input diagram.mmd \
      --output output.svg \
      --theme tokyo-night
  6. 6Run
    node scripts/render.mjs \
      --input diagram.mmd \
      --output output.png \
      --format png \
      --width 1200 \
      --theme tokyo-night

README

Pretty Mermaid

Beautiful Mermaid diagrams for AI agents

Turn Mermaid source into polished SVGs, shareable PNGs, and terminal-ready ASCII—locally, without a browser.

Pretty Mermaid converts Mermaid source into themed SVG, PNG, and terminal ASCII diagrams

skills.sh CI License: MIT Node.js Version GitHub stars

English中文日本語

🚀 Install

npx skills add imxv/pretty-mermaid-skills@pretty-mermaid -g -y

View the skill, install count, and security audits on skills.sh →

Why Pretty Mermaid?

  • Made for AI agents: works with Claude Code, Cursor, Codex, Gemini CLI, and more
  • One source, three outputs: polished SVG for docs, PNG for sharing, and ASCII/Unicode for terminals
  • No browser required: renders locally without Chromium, Puppeteer, or a DOM
  • Flexible by default: 15 themes, custom colors, six diagram types, and batch rendering

✨ Features

  • 📊 Multi-format Support: SVG, PNG, and ASCII rendering export
  • 🎨 Rich Themes: 15 built-in themes for different scenarios
  • 📈 Six Diagram Types: Flowchart, Sequence, State, Class, ER, and XY charts
  • High Performance: Batch parallel rendering
  • 📚 Ready to Use: Complete templates and detailed documentation

Supported Themes

Light ThemesDark ThemesOther
zinc-lightzinc-darknord
tokyo-night-lighttokyo-nightnord-light
catppuccin-lattetokyo-night-stormdracula
github-lightcatppuccin-mochaone-dark
solarized-lightgithub-dark
solarized-dark

🎨 Theme Gallery

Compare the same flowchart across every built-in theme in the complete 15-theme gallery.

Tokyo Night theme preview GitHub Light theme preview

🤖 AI Assistant Integration

Seamlessly integrates with the following AI coding environments:

  • Claude Code
  • Cursor
  • Gemini CLI
  • Antigravity
  • OpenCode
  • Codex
  • qoder

Installation details

Install from GitHub

npx skills add imxv/pretty-mermaid-skills@pretty-mermaid -g -y

Verify Installation

npx skills list -g

Confirm that pretty-mermaid appears in the global skill list. Node.js 16 or newer is required.

📖 Quick Start

List Available Themes

node scripts/themes.mjs

Render Single Diagram

node scripts/render.mjs \
  --input diagram.mmd \
  --output output.svg \
  --theme tokyo-night

Render PNG

node scripts/render.mjs \
  --input diagram.mmd \
  --output output.png \
  --format png \
  --width 1200 \
  --theme tokyo-night

Batch Render

node scripts/batch.mjs \
  --input-dir ./diagrams \
  --output-dir ./output \
  --theme dracula

📂 Examples

Check the 6 template files in assets/example_diagrams/:

  • flowchart.mmd - Flowchart
  • sequence.mmd - Sequence Diagram
  • state.mmd - State Diagram
  • class.mmd - Class Diagram
  • er.mmd - ER Diagram
  • xychart.mmd - XY Chart (bar and line)

PNG output is rendered directly in Node.js with no external converter required. The renderer also supports CJK state names, multiline labels, linkStyle, configurable ELK layout spacing, interactive XY chart tooltips, and ANSI-colored terminal output.

📚 Documentation

🤝 Community

Read the contribution guide, report problems with the issue templates, and review the security policy before sharing sensitive findings. Release history is tracked in the changelog.

⚙️ Requirements

  • Node.js 16+

📄 License

MIT License

Star History

Star History Chart

🙏 Acknowledgments

Based on beautiful-mermaid

Files in the repo

Repository payload18 top-level entries
  • .github
  • assets
  • docs
  • references
  • scripts
  • .gitignore
  • CHANGELOG.md
  • CODE_OF_CONDUCT.md
  • CONTRIBUTING.md
  • LICENSE
  • package-lock.json
  • package.json
  • README_CN.md
  • README_JA.md
  • README.md
  • RELEASING.md
  • SECURITY.md
  • SKILL.md

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More skills

obra/
superpowers

An agentic skills framework & software development methodology that works.

285k
1 add

Turn any codebase, with its docs, SQL schemas, configs, and PDFs, into a queryable knowledge graph. A /graphify skill for Claude Code, Cursor, Codex, and Gemini CLI: local deterministic AST parsing, every edge explained, no vector store.

117k
1 add
Vincentwei1021/
anything2explainer

Topic in, narrated explainer video out. A Claude Code / Codex skill that turns any topic into a black-canvas motion-graphics explainer video with TTS voiceover, subtitles and a chapter progress bar. Chinese or English; every frame drawn in code with Remotion.

666

Open-source AI job search: scan job portals, evaluate listings into a structured A-H report with a global 1-5 score, tailor your CV, track applications — runs locally in your AI coding CLI (Claude Code, Codex, OpenCode, Antigravity…)

71k