Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
intellectronica avatar

Beautiful Mermaid

  • 1.7k installs
  • 281 repo stars
  • Updated April 25, 2026
  • intellectronica/agent-skills

Skill that programmatically converts Mermaid diagram syntax to production-ready SVG and PNG assets with theme customization and multi-runtime support.

About

Beautiful Mermaid enables programmatic rendering of Mermaid diagrams to scalable SVG and high-resolution PNG formats. Supports flowcharts, sequence diagrams, state machines, class diagrams, and entity-relationship models with 13 customizable themes. Integrates with agent-browser for automated screenshot capture at 4K resolution. Includes syntax validation, edge label formatting, and special character handling. Outputs vector and raster assets to the current working directory with automatic cleanup of intermediary files.

  • Renders 5 diagram types: flowchart, sequence, state, class, entity-relationship
  • 13 customizable themes including Dracula, Tokyo Night, Nord, GitHub, Catppuccin
  • Dual output: scalable SVG and 4K PNG via agent-browser integration
  • Handles special characters, edge labels with pipe syntax, and node escaping
  • Automated workflow with HTML wrapping, screenshot capture, and cleanup

Beautiful Mermaid by the numbers

  • 1,714 all-time installs (skills.sh)
  • +22 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #277 of 2,245 Frontend Development skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

beautiful-mermaid capabilities & compatibility

Capabilities
parse mermaid diagram syntax · render svg from mermaid code · apply 13 customizable themes · capture high resolution png via browser automati · generate html wrapper for screenshot capture · validate and fix diagram syntax
Works with
chrome
Use cases
documentation · web design · ui design · api development
npx skills add https://github.com/intellectronica/agent-skills --skill beautiful-mermaid

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1.7k
repo stars281
Security audit2 / 3 scanners passed
Last updatedApril 25, 2026
Repositoryintellectronica/agent-skills

What it does

Render Mermaid diagrams as SVG and PNG for documentation, architecture visualization, and flowchart generation.

Who is it for?

Documentation generation, architecture visualization, CI/CD pipeline diagrams, database schema rendering, API flow documentation in automated agent workflows.

Skip if: Interactive diagram editing, real-time collaborative diagramming, manual UI design, unstructured diagram input.

When should I use this skill?

User requests diagram rendering, user provides Mermaid syntax, agent needs to visualize architecture or flow, documentation requires diagram assets.

What you get

Agent can generate high-quality diagram assets in both vector and raster formats with consistent theming, proper syntax handling, and automated browser capture.

  • SVG vector diagram
  • PNG raster image at 4K resolution
  • HTML wrapper for screenshot capture

By the numbers

  • 13 themes available
  • 5 diagram types supported
  • 4K viewport resolution (3840x2160)

Files

SKILL.mdMarkdownGitHub ↗

Beautiful Mermaid Diagram Rendering

Render Mermaid diagrams as SVG and PNG images using the Beautiful Mermaid library.

Dependencies

This skill requires the agent-browser skill for PNG rendering. Load it before proceeding with PNG capture.

Supported Diagram Types

  • Flowchart - Process flows, decision trees, CI/CD pipelines
  • Sequence - API calls, OAuth flows, database transactions
  • State - State machines, connection lifecycles
  • Class - UML class diagrams, design patterns
  • Entity-Relationship - Database schemas, data models

Available Themes

Default, Dracula, Solarized, Zinc Dark, Tokyo Night, Tokyo Night Storm, Tokyo Night Light, Catppuccin Latte, Nord, Nord Light, GitHub Dark, GitHub Light, One Dark.

If no theme is specified, use default.

Common Syntax Patterns

Flowchart Edge Labels

Use pipe syntax for edge labels:

A -->|label| B
A ---|label| B

Avoid space-dash syntax which can cause incomplete renders:

A -- label --> B   # May cause issues

Node Labels with Special Characters

Wrap labels containing special characters in quotes:

A["Label with (parens)"]
B["Label with / slash"]

Workflow

Step 1: Generate or Validate Mermaid Code

If the user provides a description rather than code, generate valid Mermaid syntax. Consult references/mermaid-syntax.md for full syntax details.

Step 2: Render SVG

Run the rendering script to produce an SVG file:

bun run scripts/render.ts --code "graph TD; A-->B" --output diagram --theme default

Or from a file:

bun run scripts/render.ts --input diagram.mmd --output diagram --theme tokyo-night

Alternative runtimes:

npx tsx scripts/render.ts --code "..." --output diagram
deno run --allow-read --allow-write --allow-net scripts/render.ts --code "..." --output diagram

This produces <output>.svg in the current working directory.

Step 3: Create HTML Wrapper

Run the HTML wrapper script to prepare for screenshot:

bun run scripts/create-html.ts --svg diagram.svg --output diagram.html

This creates a minimal HTML file that displays the SVG with proper padding and background.

Step 4: Capture High-Resolution PNG with agent-browser

Use the agent-browser CLI to capture a high-quality screenshot. Refer to the agent-browser skill for full CLI documentation.

# Set 4K viewport for high-resolution capture
agent-browser set viewport 3840 2160

# Open the HTML wrapper
agent-browser open "file://$(pwd)/diagram.html"

# Wait for render to complete
agent-browser wait 1000

# Capture full-page screenshot
agent-browser screenshot --full diagram.png

# Close browser
agent-browser close

For even higher resolution on complex diagrams, increase the viewport further or use the --padding option when creating the HTML wrapper to give the diagram more space.

Step 5: Clean Up Intermediary Files

After rendering, remove all intermediary files. Only the final .svg and .png should remain.

Files to clean up:

  • The HTML wrapper file (e.g., diagram.html)
  • Any temporary .mmd files created to hold diagram code
  • Any other files created during the rendering process
rm diagram.html

If a temporary .mmd file was created, remove it as well.

Output

Both outputs are always produced:

  • SVG: Vector format, infinitely scalable, small file size
  • PNG: High-resolution raster, captured at 4K (3840×2160) viewport with minimum 1200px diagram width

Files are saved to the current working directory unless the user explicitly specifies a different path.

Theme Selection Guide

ThemeBackgroundBest For
defaultLight greyGeneral use
draculaDark purpleDark mode preference
tokyo-nightDark blueModern dark aesthetic
tokyo-night-stormDarker blueHigher contrast
nordDark arcticMuted, calm visuals
nord-lightLight arcticLight mode with soft tones
github-darkGitHub darkMatches GitHub UI
github-lightGitHub lightMatches GitHub UI
catppuccin-latteWarm lightSoft pastel aesthetic
solarizedTan/creamSolarized colour scheme
one-darkAtom darkAtom editor aesthetic
zinc-darkNeutral darkMinimal, no colour bias

Troubleshooting

Theme not applied

Check the render script output for the bg and fg values, or inspect the SVG's opening tag for --bg and --fg CSS custom properties.

Diagram appears cut off or incomplete

  • Check edge label syntax — use -->|label| pipe notation, not -- label -->
  • Verify all node IDs are unique
  • Check for unclosed brackets in node labels

Render produces empty or malformed SVG

  • Validate Mermaid syntax at https://mermaid.live before rendering
  • Check for special characters that need escaping (wrap in quotes)
  • Ensure flowchart direction is specified (graph TD, graph LR, etc.)

Related skills

Forks & variants (1)

Beautiful Mermaid has 1 known copy in the catalog totaling 263 installs. They canonicalize to this original listing.

FAQ

What diagram types are supported?

Flowchart, sequence, state, class, and entity-relationship diagrams. Flowcharts work for processes and decision trees; sequence for API flows; state for lifecycle models; class for UML patterns; ER for database schemas.

How do I render high-resolution PNG output?

Beautiful Mermaid uses agent-browser integration with 4K viewport (3840x2160) to capture screenshots. PNG files are automatically saved with minimum 1200px width. Use --padding option for additional spacing on complex diagrams.

What should I do if my diagram renders incomplete or cut off?

Check edge label syntax (use -->|label| pipe notation, not -- label -->), verify unique node IDs, ensure special characters are quoted, and validate syntax at mermaid.live before rendering.

Is Beautiful Mermaid safe to install?

skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.