Back to

Beautiful Mermaid: Giving AI agents the power to draw

A look at Beautiful Mermaid, a skill that lets AI agents render high-quality diagrams from text. No more ASCII art—just clean, styled SVGs and PNGs.

Text is great, but sometimes I just want a picture.

We’ve all been there with LLMs. You ask for a system architecture, and it gives you a wall of text or, worse, some janky ASCII art that breaks the moment you resize your window.

That’s where Beautiful Mermaid comes in. It’s a specialized skill for AI agents that turns text-based Mermaid code into crisp, professional diagrams. It’s not just about making things look "pretty"—it’s about giving agents a reliable way to communicate visual ideas without hallucinating pixels.

Why text-to-diagram matters

If you’ve ever tried to get an AI to "draw" a flowchart, you know the pain. Image generation models like Midjourney are terrible at text and logic (good luck reading the labels on those flowcharts), and standard LLMs are stuck in text-mode.

Mermaid.js solved this for humans a long time ago by letting us write code that compiles into diagrams. But agents needed a way to execute that compilation reliably, apply themes, and export formats that are actually usable in a report or a chat interface.

Beautiful Mermaid bridges that gap. It lets an agent take a string of text—like A --> B—and hand you back a 4K PNG or a scalable SVG.

How it works under the hood

The workflow is surprisingly robust. It doesn’t just blindly render; it goes through a pipeline designed for quality:

  1. Validation: It checks if the Mermaid code is valid. If you missed a bracket or used a weird arrow syntax, it catches it.
  2. Rendering: It converts that code into an SVG.
  3. Styling: This is the "beautiful" part. It applies themes like Dracula, Tokyo Night, or GitHub Dark so the output doesn’t look like a default white-box wireframe.
  4. Capture: It uses a headless browser (via the agent-browser skill) to screenshot the rendered HTML at high resolutions.

I really like that it separates the logic (Mermaid code) from the presentation (Themes). You can ask your agent to "draw the database schema in dark mode," and it just works.

It’s not just flowcharts

I initially thought this was just for basic A-to-B flowcharts, but it supports the full Mermaid suite:

  • Sequence Diagrams: Great for showing API calls or OAuth flows.
  • State Machines: Perfect for explaining how a connection lifecycle works.
  • Entity-Relationship (ER) Diagrams: Vital for database modeling.
  • Class Diagrams: For the OOP purists out there.

The ability to render specific diagrams means agents can now genuinely help with documentation. Imagine dumping a messy Python file into an agent context and getting back a clean class diagram in return.

The theme engine

Visuals matter. If I’m looking at a dark-mode IDE all day, I don’t want a blinding white diagram.

Beautiful Mermaid comes with a bunch of presets. Dracula and Tokyo Night are my favorites for technical diagrams because they fit right into most developer environments. There’s also Catppuccin Latte if you want something softer, or just standard GitHub Light/Dark if you want it to look official.

A note on dependencies

There is one catch: for the high-res PNG export, this skill relies on another skill called agent-browser. It makes sense—rendering a web technology like Mermaid requires a browser engine to look right—but it does mean your agent needs that extra capability loaded.

If you just need SVGs, it’s lighter, but honestly, the 4K PNG export is the killer feature here. It solves the "fuzzy screenshot" problem permanently.

Conclusion

Beautiful Mermaid is a simple tool that solves a specific, annoying problem. It gives agents a visual voice. Whether you’re automating documentation or just want a quick diagram of a codebase you’re exploring, this is a solid addition to an agent’s toolkit.

Give it a shot next time you need to explain a complex flow—because a diagram really is worth a thousand tokens.