Agent skill

Mermaid Graph Renderer

by curiositech in curiositech/some_claude_skills

Renders Mermaid diagrams to SVG, PNG, and PDF in both web and offline contexts.

MITAuto-check: notesDevelopment

Install Mermaid Graph Renderer

skills CLI
$ npx skills add curiositech/some_claude_skills --skill mermaid-graph-renderer -a claude-code

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

GitHub CLI
$ gh skill install curiositech/some_claude_skills mermaid-graph-renderer --agent claude-code

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

Manual copy
$ git clone --depth 1 https://github.com/curiositech/some_claude_skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/mermaid-graph-renderer .claude/skills/mermaid-graph-renderer && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

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

Facts

Skill name
mermaid-graph-renderer
GitHub stars
244
Token cost
~2.5k tokens
SKILL.md length
857 words
Files
3
Skills in repo
95
Repo updated
First seen
Licence
MIT

At a glance

Renders Mermaid diagrams to SVG, PNG, and PDF in both web and offline contexts.

  • Exporting diagrams to images
  • SKILL.md covers Core Constraint, When to Use, Rendering Decision Tree and Web Rendering, plus 4 more sections
  • Calls npm, docker and curl; reaches cdn.jsdelivr.net and kroki.io
  • Optimizing Mermaid rendering performance on web pages

What it does

Mermaid Graph Renderer is an agent skill from curiositech/some_claude_skills. Renders Mermaid diagrams to SVG, PNG, and PDF in both web and offline contexts. Covers client-side lazy loading, SSR trade-offs, CLI batch export, and native Rust rendering. Use when exporting diagrams to images, optimizing Mermaid rendering performance on web pages, setting up CI/CD diagram pipelines, or choosing a rendering library. Activate on "render mermaid", "export diagram", "mermaid to png", "mermaid to svg", "mermaid performance", "diagram export". NOT for writing Mermaid syntax (use…

Its SKILL.md is about 2.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files (for example `.claude-plugin/plugin.json` and `CHANGELOG.md`).

It sits in Development, covering Diagrams. It works with Mermaid and Rust. The repository describes itself as: Claude skills that make my life easier. The licence is MIT.

When your agent uses it

  • Exporting diagrams to images
  • Optimizing Mermaid rendering performance on web pages
  • Setting up CI/CD diagram pipelines
  • Choosing a rendering library

Example prompts

  • “render mermaid”
  • “export diagram”
  • “mermaid to png”
  • “/mermaid-graph-renderer”

Requirements

  • Node.js
  • Docker
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash

What it can do on your machine

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

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm
    • docker
    • curl
    • cargo

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

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • cdn.jsdelivr.net
    • kroki.io

    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

Mermaid Graph Renderer loads about 2.5k tokens when it runs. Until then it costs about 150 tokens; SKILL.md has 857 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~150
When it runs · the whole SKILL.md, loaded when a task matches
~2.5k

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: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Write, Edit, Bash

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); files beside SKILL.md are not scanned.

SKILL.md

The full file from curiositech/some_claude_skills at commit 6713fc7, republished under its MIT licence (© curiositech). 857 words, ~2,520 tokens.

Download SKILL.mdSave it as .claude/skills/mermaid-graph-renderer/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
mermaid-graph-renderer
description
Renders Mermaid diagrams to SVG, PNG, and PDF in both web and offline contexts. Covers client-side lazy loading, SSR trade-offs, CLI batch export, and native Rust rendering. Use when exporting diagrams to images, optimizing Mermaid rendering performance on web pages, setting up CI/CD diagram pipelines, or choosing a rendering library. Activate on "render mermaid", "export diagram", "mermaid to png", "mermaid to svg", "mermaid performance", "diagram export". NOT for writing Mermaid syntax (use mermaid-graph-writer), general image processing, or non-Mermaid diagram formats.
allowed-tools
Read, Write, Edit, Bash
argument-hint
[input-file-or-diagram] [output-format: svg|png|pdf]
metadata.category
Content & Writing
metadata.tags
mermaid, graph, renderer, render-mermaid, export-diagram

Mermaid Graph Renderer

Renders Mermaid diagrams to production-quality SVG, PNG, and PDF in web and offline contexts. Covers the full spectrum from lazy-loaded client-side rendering to 1000x-faster native Rust batch export.

Core Constraint

Mermaid.js requires browser APIs (document.createElement, SVGTextElement.getBBox()) to compute text dimensions. Every non-browser rendering path must either embed a headless browser or reimplement the renderer from scratch. This constraint shapes every decision below.


When to Use

✅ Use for:

  • Rendering Mermaid diagrams on web pages (performance-optimized)
  • Exporting diagrams to SVG, PNG, or PDF (offline/CLI)
  • Setting up CI/CD pipelines that generate diagram images
  • Choosing between rendering libraries for a project
  • Optimizing Mermaid load time on documentation sites

❌ NOT for:

  • Writing Mermaid syntax (use mermaid-graph-writer)
  • Rendering non-Mermaid formats (PlantUML, GraphViz — see Kroki)
  • General image processing or manipulation

Rendering Decision Tree

mermaid
flowchart TD
  A{Where are you rendering?} -->|Browser| B{Performance matters?}
  A -->|CLI / CI| C{Volume?}
  A -->|Server-side| D{Must avoid client JS?}

  B -->|Yes| E[Lazy-load mermaid.js]
  B -->|No| F[CDN script tag]

  C -->|1-10 diagrams| G[mermaid-cli]
  C -->|10-100 diagrams| H{Need multiple formats?}
  C -->|100+ diagrams| I[mmdr Rust renderer]

  H -->|Mermaid only| G
  H -->|Multiple languages| J[Kroki]

  D -->|Yes, zero JS| K[Build-time with Puppeteer]
  D -->|Some JS OK| E
  K -->|Slow builds warning| L[rehype-mermaid + Playwright]

Web Rendering

Best for documentation sites, blogs, and apps where only some pages have diagrams.

How it works: Check for .mermaid elements before loading the library. The ~480 KB cost is only paid on pages that actually need it.

javascript
// Lazy load pattern — only loads mermaid.js when diagrams exist
function initMermaid() {
  const diagrams = document.querySelectorAll('.mermaid');
  if (diagrams.length === 0) return;

  const script = document.createElement('script');
  script.src = 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.min.js';
  script.onload = () => {
    mermaid.initialize({ startOnLoad: false, theme: 'neutral' });
    mermaid.run({ nodes: diagrams });
  };
  document.head.appendChild(script);
}

// Handle initial load + SPA navigation
document.addEventListener('DOMContentLoaded', initMermaid);
// For SPA route changes: call initMermaid() after navigation

Key detail: Handle both initial page load AND client-side navigation (SPA route changes) by re-running mermaid.run() when new diagram content appears.

AspectValue
Bundle size~480 KB (core + lazy diagram chunks)
Render time~50-200 ms per diagram (client)
Diagram coverageFull (all Mermaid types)
Best forDocs sites, blogs, apps with occasional diagrams
Option 2: @mermaid-js/tiny

Pre-bundled subset for CDN use. All diagram types included upfront (no lazy-loading of diagram chunks). Smaller total but loaded eagerly.

Use when: You know exactly which 1-2 diagram types you need and want a single-file import.

Option 3: Build-Time SSR (Usually Not Worth It)

Render SVGs at build time using Puppeteer/Playwright. Sounds appealing; painful in practice.

Costs:

  • Adds ~280 MB to node_modules (Puppeteer + Chromium)
  • ~2-3 seconds per diagram to spin up and render
  • A 5-second build becomes 45 seconds for ~30 diagrams
  • Docker/CI headaches (Chrome needs to be installed)

When actually worth it: Strict zero-JS requirements, or sites with hundreds of diagrams where you want to eliminate client-side rendering entirely.

Tools: rehype-mermaid (uses Playwright), rehype-mermaid-cli (wraps official CLI).

Verdict: Unless you have strict zero-JS requirements, lazy-loaded client-side rendering is the better trade-off.


Offline / CLI Rendering

Option 1: mermaid-cli (Official)

The canonical CLI tool. Launches headless Chromium, renders, captures output.

bash
# Install
npm install -g @mermaid-js/mermaid-cli

# Basic usage
mmdc -i input.mmd -o output.svg
mmdc -i input.mmd -o output.png -b transparent
mmdc -i input.mmd -o output.pdf

# With config
mmdc -i input.mmd -o output.svg -t dark --configFile mermaid.config.json

# Batch: process Markdown with embedded diagrams
mmdc -i document.md -o document-with-images.md

# Docker
docker run --rm -v $(pwd):/data minlag/mermaid-cli -i /data/input.mmd -o /data/output.svg
AspectValue
Speed~3000 ms per diagram (Chromium overhead)
OutputSVG, PNG, PDF
Size~280 MB (Puppeteer + Chromium)
CoverageFull (all Mermaid types, 100% parity)
Best for1-50 diagrams, when accuracy matters most

SVG gotcha: Output SVGs contain <foreignObject> elements that break in Inkscape and rsvg-convert. Fix: set "htmlLabels": false in config, or export to PNG instead.

Option 2: Kroki (Multi-Format Gateway)

Unified HTTP API that routes diagram source to appropriate rendering engine. Supports 25+ languages (Mermaid, PlantUML, GraphViz, D2, Excalidraw, etc.).

bash
# Render via HTTP (self-hosted or kroki.io)
curl -X POST https://kroki.io/mermaid/svg \
  -H 'Content-Type: text/plain' \
  -d 'flowchart LR
    A --> B --> C' \
  -o diagram.svg

# Self-host via Docker Compose
# docker-compose.yml needs: yuzutech/kroki + yuzutech/kroki-mermaid
AspectValue
Speed~500-2000 ms (network + render)
OutputSVG, PNG, PDF, JPEG
Languages25+ (Mermaid, PlantUML, GraphViz, D2, etc.)
Best forMulti-language pipelines, CI/CD, documentation generators

When Kroki wins: You need multiple diagram languages in one pipeline. When it doesn't: Simple "render one Mermaid diagram" — overkill.

Show full SKILL.md (351 more words)Show less
Option 3: mmdr (Native Rust — Fastest)

Native Rust reimplementation. No browser, no Node.js. ~1000x faster than mermaid-cli.

bash
# Install (Rust toolchain required)
cargo install mmdr

# Usage
mmdr input.mmd -o output.svg
mmdr input.mmd -o output.png  # via resvg, no browser
AspectValue
Speed~3 ms per diagram (1000x faster)
OutputSVG (native), PNG (via resvg)
Size~5-10 MB binary
Coverage13 diagram types (partial parity)
Best forBatch processing 100+ diagrams, CI/CD speed

Trade-off: Not all Mermaid features are supported yet. Flowcharts and sequence diagrams are mature; other types vary. Accept imperfection for speed, or fall back to mermaid-cli for edge cases.

No <foreignObject> issue: Uses native SVG text, so output works with Inkscape and other SVG tools.


Comparison Matrix

Criterionmermaid.js CDNmermaid-cliKrokimmdr (Rust)
RuntimeBrowserNode + PuppeteerDockerNative binary
Speed/diagram~100 ms~3000 ms~1000 ms~3 ms
SVG qualityExcellentExcellentExcellentGood (improving)
PNG qualityN/AGoodGoodGood (resvg)
PDF exportN/AYesYesNot yet
Install size~480 KB~280 MB~1 GB (Docker)~5-10 MB
Diagram coverageFullFullFull13 types
CI/CD fitPoorModerateGoodExcellent
Multi-languageNoNoYes (25+)No

Recommendations by Use Case

Use CaseRecommendationWhy
Docs site with occasional diagramsLazy-loaded mermaid.jsOnly loads on pages that need it
Next.js / SSR appDynamic import, ssr: falseDon't fight build-time rendering
CI/CD generating static docs (Mermaid only)mmdr for speed, mermaid-cli for accuracy1000x faster vs. 100% feature parity
CI/CD with multiple diagram languagesKrokiOne API for PlantUML + Mermaid + GraphViz
Batch export for print/PDF (100+ diagrams)mmdr + mermaid-cli fallbackFast for most, accurate for edge cases
Desktop apps (Electron/Obsidian/VS Code)Built-in mermaid.jsChromium already embedded

Anti-Patterns

SSR Obsession

Wrong: Spending 3 days setting up Puppeteer in CI to avoid 480 KB of client JS. Right: Lazy-load mermaid.js. The 480 KB is only fetched on pages with diagrams. Most users won't notice.

foreignObject Surprise

Wrong: Exporting SVGs from mermaid-cli and wondering why Inkscape can't open them. Right: Set "htmlLabels": false in config, or export to PNG directly.

One Tool for Everything

Wrong: Using mermaid-cli for 500 diagrams in CI (25 minutes of build time). Right: Use mmdr for batch, mermaid-cli for the few diagrams that need full parity.

© curiositech, 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 2 other files in .claude/skills/mermaid-graph-renderer of curiositech/some_claude_skills.

  • SKILL.md
  • .claude-plugin/plugin.json
  • CHANGELOG.md

Open the folder on GitHubat commit 6713fc7

Compare with similar skills

Mermaid Graph 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.

Mermaid Graph Renderer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Mermaid Graph Renderer this skillcuriositech/some_claude_skills244—~2.5kAutomated safety check: NotesMIT
Generating Documentationancoleman/ai-design-components525—~3kAutomated safety check: PassMIT
Archify Diagramstt-a1i/archify81k—~2.9kAutomated safety check: PassMIT
Diagram Designcathrynlavery/diagram-design48k1 repos~7.6kAutomated safety check: PassMIT
Draw.io Diagram StudioAgents365-ai/drawio-skill10k—~2.4kAutomated safety check: NotesMIT
Pretty Mermaid Rendererimxv/Pretty-mermaid-skills1.5k—~2kAutomated safety check: PassMIT

Similar skills

  • Generating Documentation

    ancoleman/ai-design-components

    Generate comprehensive technical documentation including API docs (OpenAPI/Swagger), code documentation (TypeDoc/Sphinx), documentation sites (Docusaurus/MkDocs), Architecture Decision Records…

    525 GitHub stars~3k tokensUpdated 10 mo ago
    DevelopmentAuto-check passed
  • Archify Diagrams

    tt-a1i/archify

    Creates interactive architecture, workflow, sequence, data-flow and lifecycle diagrams as standalone HTML with inline SVG, themes and image or video export.

    81k GitHub stars~2.9k tokensUpdated today
    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.

    48k 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 8 days ago
    DevelopmentAuto-check: notes
  • Pretty Mermaid Renderer

    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.

    1.5k GitHub stars~2k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Archify Diagram Builder

    Unclecheng-li/AI_Animation

    Builds validated architecture, workflow, sequence, data-flow and lifecycle diagrams as standalone interactive HTML from a small JSON spec, with optional motion and image export.

    1.5k GitHub starsUsed in 2 repos~4.1k tokens
    DevelopmentAuto-check passed

More from curiositech/some_claude_skills

All 95 skills in this repo
  • Crisis Detection Intervention AI

    curiositech/some_claude_skills

    Detect crisis signals in user content using NLP, mental health sentiment analysis, and safe intervention protocols.

    244 GitHub starsUsed in 2 repos~3.8k tokens
    Auto-check passed
  • Form Validation Architect

    curiositech/some_claude_skills

    End-to-end form handling with react-hook-form, Zod schemas, validation patterns, error messaging, field arrays, and multi-step wizards.

    244 GitHub stars~3.8k tokensUpdated 1 mo ago
    Auto-check passed
  • GitHub Actions Pipeline Builder

    curiositech/some_claude_skills

    Build production CI/CD pipelines with GitHub Actions. An agent skill from curiositech/some_claude_skills.

    244 GitHub stars~2.8k tokensUpdated 1 mo ago
    Auto-check: notes
  • Background Job Orchestrator

    curiositech/some_claude_skills

    Expert in background job processing with Bull/BullMQ (Redis), Celery, and cloud queues.

    244 GitHub stars~3.2k tokensUpdated 1 mo ago
    Auto-check passed
  • Competitive Cartographer

    curiositech/some_claude_skills

    Strategic analyst that maps competitive landscapes, identifies white space opportunities, and provides positioning recommendations.

    244 GitHub stars~1.3k tokensUpdated 1 mo ago
    Auto-check passed
  • Computer Vision Pipeline

    curiositech/some_claude_skills

    Build production computer vision pipelines for object detection, tracking, and video analysis.

    244 GitHub stars~4k tokensUpdated 1 mo ago
    Auto-check passed

Works with

Categories

Questions about Mermaid Graph Renderer

What does Mermaid Graph Renderer do?

Renders Mermaid diagrams to SVG, PNG, and PDF in both web and offline contexts. Mermaid Graph Renderer is an agent skill from curiositech/some_claude_skills. Renders Mermaid diagrams to SVG, PNG, and PDF in both web and offline contexts.

When should I use Mermaid Graph Renderer?

Mermaid Graph Renderer fits situations like: exporting diagrams to images; optimizing Mermaid rendering performance on web pages; setting up CI/CD diagram pipelines; choosing a rendering library.

How do I install Mermaid Graph Renderer in Claude Code?

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

How do I install Mermaid Graph Renderer in Codex?

Run `npx skills add curiositech/some_claude_skills --skill mermaid-graph-renderer -a codex`. Or copy the skill folder (.claude/skills/mermaid-graph-renderer in curiositech/some_claude_skills) into .agents/skills/mermaid-graph-renderer in your project. Codex loads it when a task matches its description.

Can I use Mermaid Graph 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 curiositech/some_claude_skills --skill mermaid-graph-renderer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mermaid-graph-renderer, .gemini/skills/mermaid-graph-renderer, .github/skills/mermaid-graph-renderer and .opencode/skills/mermaid-graph-renderer in your project.

What does Mermaid Graph Renderer need to run?

Going by SKILL.md and its folder, Mermaid Graph Renderer needs the command-line tools its instructions call (npm, docker, curl and cargo). Our summary lists: Node.js; Docker. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash.

Does Mermaid Graph Renderer access the network?

SKILL.md names 2 domains. In commands or code: cdn.jsdelivr.net and kroki.io; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.

Is Mermaid Graph Renderer safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Mermaid Graph Renderer use?

Mermaid Graph Renderer is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Mermaid Graph Renderer use?

About 2.5k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Mermaid Graph Renderer?

Skills that share tags, products or a category with Mermaid Graph Renderer: Generating Documentation (ancoleman/ai-design-components, 525 stars), Archify Diagrams (tt-a1i/archify, 81k stars), Diagram Design (cathrynlavery/diagram-design, 48k stars) and Draw.io Diagram Studio (Agents365-ai/drawio-skill, 10k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Mermaid Graph Renderer?

curiositech (a GitHub organization) maintains it in curiositech/some_claude_skills, which has 244 GitHub stars. The repository holds 95 skills in this directory. The repository was last updated on September 6, 2026.

Source: curiositech/some_claude_skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.