mermaid-to-image

mermaid-to-image is a skill for Claude Code from bestdeejay-design/agent-skills. It costs 160 tokens per session (1,097 once invoked), scanned A, original, MIT.

A renderer that turns Mermaid diagram text into PNG or SVG image files. Mermaid is a text format for describing diagrams such as flows, sequences, and relationships.

In plain words
What is it for?
Use it to convert a Mermaid file or standard input into PNG or SVG, choosing the output format, background, scale, and rendering method.
Why use it?
It provides static image files for places where Mermaid source is not rendered, such as some README files, presentations, or reports.

Skill for Claude Code

Written for Claude Code: when-to-use in frontmatter.

Good fit Use it to convert a Mermaid file or standard input into PNG or SVG, choosing the output format, background, scale, and rendering method.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bestdeejay-design/agent-skills/mermaid-to-image
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add bestdeejay-design/agent-skills --skill mermaid-to-image
Clone the repo
git clone --depth 1 https://github.com/bestdeejay-design/agent-skills

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mermaid-to-image

README.md
[![agentmods](https://agentmods.dev/badge/skills/bestdeejay-design/agent-skills/mermaid-to-image/github.svg)](https://agentmods.dev/skills/bestdeejay-design/agent-skills/mermaid-to-image)
Your own site
<a href="https://agentmods.dev/skills/bestdeejay-design/agent-skills/mermaid-to-image"><img src="https://agentmods.dev/badge/skills/bestdeejay-design/agent-skills/mermaid-to-image/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mermaid-to-image

Your own site · 80×15
<a href="https://agentmods.dev/skills/bestdeejay-design/agent-skills/mermaid-to-image"><img src="https://agentmods.dev/badge/skills/bestdeejay-design/agent-skills/mermaid-to-image.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 160 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,097 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00160 $0.01097
Opus 5 $0.00080 $0.00549
Sonnet 5 $0.00032 $0.00219
Haiku 4.5 $0.00016 $0.00110

Measured today against content hash b9b95b598d55, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

mermaid-to-image scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/mermaid_to_image.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/mermaid-to-image/SKILL.md · 79 lines

How it starts

The opening of the file, as written. The whole thing — 79 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Mermaid To Image

Рендер Mermaid-диаграмм из текста .mmd в файлы PNG/SVG.

Загружай этот скилл когда нужно превратить Mermaid-диаграмму в картинку: для README, документации, презентаций, бейджей или вложений в отчёты.

🎯 When to use

Use this skill when:

  • Есть .mmd-файл или текст Mermaid и нужен PNG/SVG-файл
  • Нужно вставить диаграмму в README/вики/презентацию (у рендер-плагинов GitHub нет PNG)
  • Просят «отрендерить диаграмму», «mermaid в png», «схему в картинку»
  • Нужна статичная картинка для экспорта (не интерактивная mermaid.live)

Do NOT use when:

  • Диаграмма нужна только в Markdown-исходнике — GitHub рендерит Mermaid сам
  • Нужны диаграммы из текстового описания без Mermaid-кода — это diagram-maker
  • Нужны диаграммы архитектуры AWS/GCP — отдельный рендер в roadmap

📦 Files

  • SKILL.md — этот файл
  • scripts/mermaid_to_image.py — рендерер .mmd → PNG/SVG (Python 3 stdlib)

🧰 Usage

# Файл → SVG (по умолчанию):
python3 skills/mermaid-to-image/scripts/mermaid_to_image.py -i diagram.mmd -o diagram.svg

# Файл → PNG:
python3 skills/mermaid-to-image/scripts/mermaid_to_image.py -i diagram.mmd -o diagram.png

# Из stdin (текст прямо в пайплайне):
cat diagram.mmd | python3 mermaid_to_image.py --stdin -o out.svg

# С фоном и масштабом:
python3 mermaid_to_image.py -i d.mmd -o d.png --bg white --scale 3

# В stdout (для программного использования):
python3 mermaid_to_image.py -i d.mmd --stdout > d.svg

🧭 Движки рендера

Движок Как включить Когда выбирать
mmdc (mermaid-cli) --engine mmdc (npm i -g @mermaid-js/mermaid-cli) офлайн, приватные схемы, большие диаграммы, точный контроль
ink (mermaid.ink) --engine ink без установки, быстрый старт; PNG отдаётся как JPEG-образ

По умолчанию --engine auto: используется mmdc, если он установлен, иначе ink.

🔬 Проверка результата

  • SVG: файл начинается с <svg, валиден для вставки в Markdown/HTML.
  • PNG: file out.png показывает «JPEG image data» — это нормально для mermaid.ink (API отдаёт JPEG-кодированный образ); визуально проверьте открытием.
  • При ошибке сети/API скрипт пишет причину в stderr и завершается с кодом 2.

Read the full file on GitHub · 79 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed · +8 lines b9b95b598d55
  2. 12d ago First seen · 71 lines · 160 tokens per session scan A cd8d8bcaa0b0

Subscribe to this mod's changes

mermaid-to-image is a skill published in the GitHub repository bestdeejay-design/agent-skills (6 stars, last pushed yesterday), licensed MIT. It adds 160 tokens to every session and 1,097 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.