Agent skill

Pretty Mermaid Renderer

by imxv in imxv/Pretty-mermaid-skills

Writes and renders Mermaid diagrams as themed SVG, PNG or terminal ASCII and Unicode art with a bundled Node.js CLI that needs no browser.

MITAuto-check passedDevelopment

Install Pretty Mermaid Renderer

skills CLI
$ npx skills add imxv/Pretty-mermaid-skills --skill pretty-mermaid -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install imxv/Pretty-mermaid-skills pretty-mermaid --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
pretty-mermaid
GitHub stars
1.5k
Token cost
~2k tokens
SKILL.md length
821 words
Files
60 (incl. scripts, references, assets)
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Writes and renders Mermaid diagrams as themed SVG, PNG or terminal ASCII and Unicode art with a bundled Node.js CLI that needs no browser.

  • Works in 7 steps: Determine whether the user supplied… → Choose the diagram type and output… → Read only the relevant reference file… → …
  • Drawing an architecture or data-flow diagram for a README
  • SKILL.md covers Working directory, Workflow, Choose a diagram type and Choose an output, plus 7 more sections
  • Calls node and npm

What it does

The agent either takes Mermaid source you provide or writes one from prose, picks a diagram type from a table (flowchart, sequence, state, class, ER or XY chart) and an output format, saves new source as a .mmd file and renders it with a named theme or explicit colors. It then inspects the result for syntax errors, clipping or a crowded layout, renders again if needed, and returns the source and output paths with the chosen format and theme. It never overwrites an existing source or output file unless you ask.

Rendering runs through Node scripts in the skill folder: themes.mjs lists the 15 built-in themes, and render.mjs produces SVG, PNG with the format option, Unicode or plain ASCII text with an ASCII flag, or ANSI-colored text through a color-mode option. SVG suits READMEs and slides, PNG suits chats and raster-only tools, and text output suits terminals and logs. It runs locally without a browser or DOM, and the renderer is not copied into your project.

When your agent uses it

  • Drawing an architecture or data-flow diagram for a README
  • Rendering existing .mmd files to themed SVG or PNG
  • Showing a diagram in a terminal or CI log as ASCII art
  • Batch-converting several Mermaid files in one run

Example prompts

  • “Draw a sequence diagram of the login flow and render it as an SVG.”
  • “Render docs/architecture.mmd as a PNG using a dark theme.”
  • “Show this flowchart as Unicode art so I can paste it into our CI log.”

Requirements

  • Node.js, to run the bundled render scripts

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Determine whether the user supplied Mermaid source or needs a diagram authored from prose.
  2. Choose the diagram type and output format from the tables below.
  3. Read only the relevant reference file when syntax, theme selection, or API behavior needs more detail.
  4. Save new source as a .mmd file, preserving user terminology and relationships.
  5. Render with a named theme or explicit colors.
  6. Inspect the result. Fix syntax, clipping, crowded layout, or unclear labels and render again.
  7. Return the source and output paths, plus the selected format and theme.

What it can do on your machine

Read from SKILL.md and the folder at commit e234ab7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/, which the agent can run.

    Shell commands in SKILL.md call:

    • node
    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Pretty Mermaid Renderer loads about 2k tokens when it runs, and up to ~6.9k if it reads all its reference files. Until then it costs about 127 tokens; SKILL.md has 821 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~127
When it runs · the whole SKILL.md, loaded when a task matches
~2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from imxv/Pretty-mermaid-skills at commit e234ab7, republished under its MIT licence (© imxv). 821 words, ~1,951 tokens.

Download SKILL.mdSave it as .claude/skills/pretty-mermaid/SKILL.md (or your agent's skills folder). This skill also uses 59 other files; get the full folder from GitHub.
name
pretty-mermaid
description
Generate and render Mermaid diagrams for architecture docs, READMEs, PRs, terminals, chats, and CI as themed SVG, PNG, or ASCII/Unicode art. Use this skill whenever the user provides Mermaid code or .mmd files; asks for a flowchart, sequence/state/class diagram, ERD, XY chart, or architecture/workflow/data-model visualization; or wants to beautify, theme, batch-convert, or make a diagram terminal-friendly. Runs locally without a browser or DOM, with 15 built-in themes and custom colors.

Pretty Mermaid

Create or render Mermaid diagrams with the bundled Node.js CLI. Use SVG for scalable documentation, PNG for sharing or raster-only consumers, and ASCII or Unicode for terminals and plain text.

Working directory

Treat the directory containing this file as <skill-root>. Run bundled scripts from that directory, or invoke them with absolute paths. Keep user source and rendered output in the user's requested location; do not copy the renderer into their project.

Workflow

  1. Determine whether the user supplied Mermaid source or needs a diagram authored from prose.
  2. Choose the diagram type and output format from the tables below.
  3. Read only the relevant reference file when syntax, theme selection, or API behavior needs more detail.
  4. Save new source as a .mmd file, preserving user terminology and relationships.
  5. Render with a named theme or explicit colors.
  6. Inspect the result. Fix syntax, clipping, crowded layout, or unclear labels and render again.
  7. Return the source and output paths, plus the selected format and theme.

Do not overwrite an existing source or output file unless the user asked for replacement.

Choose a diagram type

NeedDiagram typeStarter
Process, decision tree, architectureFlowchartflowchart LR
API calls, messages, interactionsSequencesequenceDiagram
Lifecycle or finite-state machineStatestateDiagram-v2
Classes, modules, relationshipsClassclassDiagram
Database entities and cardinalityERerDiagram
Bars, lines, trends, comparisonsXY chartxychart-beta

Read references/DIAGRAM_TYPES.md when authoring non-trivial Mermaid syntax.

Choose an output

OutputBest forNotes
SVGREADMEs, docs, slides, websitesScalable, themed, supports transparency
PNGChats, previews, raster-only toolsSet --format png; no external converter required
UnicodeModern terminals and readable text previewsDefault ASCII renderer output
Plain ASCIILogs and restricted terminalsAdd --use-ascii
ANSI-colored textInteractive terminalsSet --color-mode

Core commands

Run these from <skill-root>.

List themes
bash
node scripts/themes.mjs
Render SVG
bash
node scripts/render.mjs \
  --input diagram.mmd \
  --output diagram.svg \
  --theme tokyo-night
Render terminal text
bash
node scripts/render.mjs \
  --input diagram.mmd \
  --output diagram.txt \
  --format ascii \
  --color-mode none

Add --use-ascii when Unicode box-drawing characters are not acceptable.

Render PNG
bash
node scripts/render.mjs \
  --input diagram.mmd \
  --output diagram.png \
  --format png \
  --width 1200 \
  --theme tokyo-night
Batch render a directory
bash
node scripts/batch.mjs \
  --input-dir ./diagrams \
  --output-dir ./rendered \
  --format svg \
  --theme github-dark \
  --workers 4

Use batch rendering for three or more diagrams or when consistent options must be applied to a directory.

Theme selection

  • General dark documentation: tokyo-night
  • GitHub dark or light surfaces: github-dark, github-light
  • Print and presentations: zinc-light
  • High-contrast color: dracula
  • Cool, restrained palette: nord, nord-light

Read references/THEMES.md or open docs/THEME_GALLERY.md when visual theme choice matters. A named theme can be refined with explicit color flags.

Useful options

Shared styling
OptionPurpose
--theme <name>Apply one of the 15 built-in themes
--bg, --fgSet required base colors
--line, --accent, --mutedRefine connectors, highlights, and secondary text
--surface, --borderRefine node fill and stroke
--font <name>Set the SVG font family
SVG
OptionPurpose
--transparentRemove the SVG background
--padding <n>Set canvas padding
--node-spacing <n>Set horizontal node spacing
--layer-spacing <n>Set vertical layer spacing
--component-spacing <n>Separate disconnected components
--interactiveEnable XY chart hover tooltips
PNG
OptionPurpose
--width <n>Set output width from 100 to 10000 pixels while preserving aspect ratio
--transparentPreserve a transparent background
Show full SKILL.md (340 more words)Show less
Terminal output
OptionPurpose
--use-asciiReplace Unicode box drawing with plain ASCII
--padding-x, --padding-yTune diagram spacing
--box-border-paddingTune padding inside node boxes
--color-mode <mode>none, auto, ansi16, ansi256, truecolor, or html

Run node scripts/render.mjs --help or node scripts/batch.mjs --help for the authoritative CLI list.

Authoring guidance

  • Prefer short, concrete labels; preserve domain-specific terms from the user.
  • Use explicit edge labels when a branch or message is ambiguous.
  • Keep large diagrams readable by splitting unrelated concerns instead of shrinking text.
  • Use LR for wide flows and TB for narrow documents.
  • Avoid communicating meaning through color alone.
  • Use a light theme for print and confirm contrast against the final background.
  • For unfamiliar syntax, start from assets/example_diagrams/ and consult the diagram reference.

Validation

After rendering:

  1. Confirm the command exits successfully and the output file is non-empty.
  2. Confirm SVG output begins with <svg; confirm PNG output opens as a valid image; confirm text output contains visible diagram content.
  3. Inspect visual output when layout matters, especially long labels, CJK text, disconnected components, and XY charts.
  4. Confirm arrows, cardinalities, states, and labels match the source request.
  5. Report any renderer limitation instead of silently dropping unsupported syntax.

Run both npm test and npm run validate when changing this skill, its scripts, templates, or references.

Troubleshooting

  • Missing dependency: run npm install in <skill-root>; the CLI also attempts a first-run install.
  • Unknown theme: run node scripts/themes.mjs and use an exact listed name.
  • Parse error: consult references/DIAGRAM_TYPES.md, reduce to the failing statement, then restore the diagram incrementally.
  • Crowded SVG: increase --node-spacing, --layer-spacing, or --component-spacing.
  • PNG color error: use concrete hex values for custom colors; unresolved external CSS variables cannot be rasterized.
  • Terminal color escape codes in redirected output: use --color-mode none.

Reference routing

ResourceRead or use when
references/DIAGRAM_TYPES.mdAuthoring or debugging Mermaid syntax
references/THEMES.mdComparing themes or defining custom colors
references/api_reference.mdExtending scripts or calling beautiful-mermaid directly
docs/THEME_GALLERY.mdChoosing a theme visually
assets/example_diagrams/Starting from a supported diagram template
scripts/render.mjsRendering one diagram
scripts/batch.mjsRendering a directory in parallel
scripts/themes.mjsListing installed themes

© imxv, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 59 other files (scripts, references, assets) in the repository root of imxv/Pretty-mermaid-skills.

  • SKILL.md
  • .github/ISSUE_TEMPLATE/bug_report.yml
  • .github/ISSUE_TEMPLATE/config.yml
  • .github/ISSUE_TEMPLATE/feature_request.yml
  • .github/PULL_REQUEST_TEMPLATE.md
  • .github/release.yml
  • .github/workflows/ci.yml
  • .github/workflows/release.yml
  • .gitignore
  • CHANGELOG.md
  • CODE_OF_CONDUCT.md
  • CONTRIBUTING.md
  • LICENSE
  • README.md
  • README_CN.md
  • README_JA.md
  • RELEASING.md
  • SECURITY.md
  • … and 42 more

Open the folder on GitHubat commit e234ab7

Compare with similar skills

Pretty Mermaid Renderer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Pretty Mermaid Renderer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Pretty Mermaid Renderer this skillimxv/Pretty-mermaid-skills1.5k—~2kAutomated safety check: PassMIT
Wiki Ado Convertmicrosoft/skills3.1k—~2.3kAutomated safety check: PassMIT
Diagram Designcathrynlavery/diagram-design49k1 repos~7.6kAutomated safety check: PassMIT
Draw.io Diagram StudioAgents365-ai/drawio-skill10k—~2.4kAutomated safety check: NotesMIT
Mermaid Diagramsjjmartres/opencode1336 repos~1.9kAutomated safety check: PassMIT
Eli5coldteadotai/pr-lens1.9k—~2.3kAutomated safety check: PassMIT

Similar skills

  • Wiki Ado Convert

    microsoft/skills

    Official

    Converts VitePress/GFM wiki markdown to Azure DevOps Wiki-compatible format.

    3.1k GitHub stars~2.3k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Diagram Design

    cathrynlavery/diagram-design

    Creates branded diagrams, from architecture, flowchart and sequence to charts and maps, as self-contained HTML with inline SVG, with import from draw.io, Mermaid and Excalidraw.

    49k GitHub starsUsed in 1 repo~7.6k tokens
    DevelopmentAuto-check passed
  • Draw.io Diagram Studio

    Agents365-ai/drawio-skill

    Creates and edits editable draw.io diagrams from descriptions, code, infrastructure files, SQL and API schemas, with sync, review, test and export tools.

    10k GitHub stars~2.4k tokensUpdated today
    DevelopmentAuto-check: notes
  • Mermaid Diagrams

    jjmartres/opencode

    Helps an agent pick the right Mermaid diagram type and write the syntax for class, sequence, flow, ER, C4, state and other software diagrams.

    133 GitHub starsUsed in 6 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Eli5

    coldteadotai/pr-lens

    WHAT: Explains a codebase, a folder, a feature, a command or a pull request to someone who knows nothing about it, as a PR Lens canvas whose walkthrough builds the picture one part at a time.

    1.9k GitHub stars~2.3k tokensUpdated 6 days ago
    DevelopmentAuto-check passed
  • C4 Architecture Diagrams

    lexler/skill-factory

    Creates C4 model diagrams at every zoom level, from system landscape to code, in ASCII, Mermaid or Structurizr, for designing or documenting software architecture.

    239 GitHub stars~2.3k tokensUpdated yesterday
    DevelopmentAuto-check passed

Works with

Questions about Pretty Mermaid Renderer

What does Pretty Mermaid Renderer do?

Writes and renders Mermaid diagrams as themed SVG, PNG or terminal ASCII and Unicode art with a bundled Node.js CLI that needs no browser. mmd file and renders it with a named theme or explicit colors. It then inspects the result for syntax errors, clipping or a crowded layout, renders again if needed, and returns the source and output paths with the chosen format and theme.

When should I use Pretty Mermaid Renderer?

Pretty Mermaid Renderer fits situations like: drawing an architecture or data-flow diagram for a README; rendering existing .mmd files to themed SVG or PNG; showing a diagram in a terminal or CI log as ASCII art; batch-converting several Mermaid files in one run.

How do I install Pretty Mermaid Renderer in Claude Code?

Run `npx skills add imxv/Pretty-mermaid-skills --skill pretty-mermaid -a claude-code`. Or copy the skill folder (the imxv/Pretty-mermaid-skills repository) into .claude/skills/pretty-mermaid in your project. Claude Code loads it when a task matches its description.

How do I install Pretty Mermaid Renderer in Codex?

Run `npx skills add imxv/Pretty-mermaid-skills --skill pretty-mermaid -a codex`. Or copy the skill folder (the imxv/Pretty-mermaid-skills repository) into .agents/skills/pretty-mermaid in your project. Codex loads it when a task matches its description.

Can I use Pretty Mermaid Renderer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add imxv/Pretty-mermaid-skills --skill pretty-mermaid -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pretty-mermaid, .gemini/skills/pretty-mermaid, .github/skills/pretty-mermaid and .opencode/skills/pretty-mermaid in your project.

What does Pretty Mermaid Renderer need to run?

Going by SKILL.md and its folder, Pretty Mermaid Renderer needs the command-line tools its instructions call (node and npm). Our summary lists: Node.js, to run the bundled render scripts.

Does Pretty Mermaid Renderer access the network?

SKILL.md contains no URLs. Its commands use npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Pretty Mermaid Renderer safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Pretty Mermaid Renderer use?

Pretty Mermaid Renderer is published under the MIT licence (from the LICENSE file in the skill folder). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Pretty Mermaid Renderer use?

About 2k tokens (SKILL.md is roughly 7.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5k tokens, read only when the agent opens those files.

What are the alternatives to Pretty Mermaid Renderer?

Skills that share tags, products or a category with Pretty Mermaid Renderer: Wiki Ado Convert (microsoft/skills, 3.1k stars), Diagram Design (cathrynlavery/diagram-design, 49k stars), Draw.io Diagram Studio (Agents365-ai/drawio-skill, 10k stars) and Mermaid Diagrams (jjmartres/opencode, 133 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Pretty Mermaid Renderer?

imxv (a GitHub user) maintains it in imxv/Pretty-mermaid-skills, which has 1,524 GitHub stars. The repository was last updated on August 22, 2026.

Source: imxv/Pretty-mermaid-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.