mermaid-renderer

mermaid-renderer is a skill for Claude Code, Codex from EthanYoQ/Skill-hub. It costs 89 tokens per session (1,089 once invoked), scanned A, original, MIT.

A renderer that turns Mermaid diagrams into PNG images. Mermaid is a text format for describing diagrams such as flowcharts and decision trees.

In plain words
What is it for?
Use it to render Mermaid blocks as PNG assets, replace diagram markup with image references, and detect when the required rendering command is unavailable or fails.
Why use it?
It removes the manual step of converting diagram text into image files for reports or other outputs. It also reports failures and can retain the original diagram text as a fallback.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to render Mermaid blocks as PNG assets, replace diagram markup with image references, and detect when the required rendering command is unavailable or fails.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ethanyoq/skill-hub/mermaid-renderer
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 EthanYoQ/Skill-hub --skill mermaid-renderer
Clone the repo
git clone --depth 1 https://github.com/EthanYoQ/Skill-hub

Made for: Claude Code, Codex.

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-renderer

README.md
[![agentmods](https://agentmods.dev/badge/skills/ethanyoq/skill-hub/mermaid-renderer/github.svg)](https://agentmods.dev/skills/ethanyoq/skill-hub/mermaid-renderer)
Your own site
<a href="https://agentmods.dev/skills/ethanyoq/skill-hub/mermaid-renderer"><img src="https://agentmods.dev/badge/skills/ethanyoq/skill-hub/mermaid-renderer/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-renderer

Your own site · 80×15
<a href="https://agentmods.dev/skills/ethanyoq/skill-hub/mermaid-renderer"><img src="https://agentmods.dev/badge/skills/ethanyoq/skill-hub/mermaid-renderer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 89 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,089 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.00089 $0.01089
Opus 5.5 $0.00036 $0.00436
Sonnet 5.5 $0.00018 $0.00218
Haiku 4.5 $0.00009 $0.00109

Measured 2mo ago against content hash 031ff5e6137f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

mermaid-renderer 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 2mo ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/renderer.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.

archives/user-installed-skills/mermaid-renderer/d41320222bdbad43/mermaid-renderer/SKILL.md · 80 lines

How it starts

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

mermaid-renderer (Phase 4.5)

用途

Phase 4.5 hook,提取 LLM 输出的 <div class="mermaid">...</div> block,转成 PNG 文件,替换为 <img src="assets/decision-tree-N.png">。优先用 mmdc;若未全局安装但 npx 可用,临时调用 @mermaid-js/mermaid-cli。

接口

render_mermaid_to_png(
    mermaid_text: str,
    output_path: Path,
    timeout_sec: int = 30,
    width: int = 5000,
    scale: int = 2,
) -> dict

返回:

{
    "ok": bool,                  # True = PNG 渲染成功
    "path": Path | None,         # 成功时是 output 文件路径
    "fallback_inline": str | None,  # 失败时是原 mermaid 文本
    "reason": str,               # 状态说明 ("mmdc ok" / "mmdc not installed" / "mmdc exit N: ..." / "mmdc timeout")
    "render_width": int,          # 默认 5000
    "render_scale": int,          # 默认 2
}

三层 fallback

  1. mmdc/npx 不可用→ ok=False + fallback_inline = mermaid_text
  2. subprocess 失败(returncode 非零 / 输出文件不存在)→ ok=False + fallback_inline + 错误 message (含 stderr 前 500 char)
  3. subprocess 超时(默认 30s)→ ok=False + fallback_inline + "mmdc timeout"

production smoke 必须把 ok=False 视为阻断;非生产 dry-run 可保留 inline <div class="mermaid">...</div> 便于调试。

V25 render quality contract

Renderer defaults to mmdc -w 5000 --scale 2. Callers may only lower these values for explicit test fixtures. production_smoke_audit blocks low-resolution decision-tree assets, so PNG existence alone is not proof.

Production provenance contract

Production orchestration must write .cache/<slug>/mermaid_render_manifest.json whenever decision-tree assets are rendered. The manifest must include:

  • renderer: "mermaid-renderer"
  • one block per Mermaid source with index, ok, path, reason, and original source
  • per-block graph quality metrics: edge_count, decision_node_count, numeric_evidence_count, and cross_point_count
  • ok=false if any block failed

PNG-only assets, Chrome screenshots, or manually appended skill_run_log entries do not prove this skill ran. Production smoke must block when decision-tree PNGs exist without this manifest.

Read the full file on GitHub · 80 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. 2mo ago First seen · 80 lines · 89 tokens per session scan A 031ff5e6137f

Subscribe to this mod's changes

mermaid-renderer is a skill published in the GitHub repository EthanYoQ/Skill-hub (12 stars, last pushed 2d ago), licensed MIT. It adds 89 tokens to every session and 1,089 once invoked, about $0.0004 per session on Opus 5.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-09-13.

Related

mermaid-renderer compared with skills from other repositories

mermaid-renderer next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mermaid-rendererEthanYoQ/Skill-hubSkill122d agoMITA89Claude Code, Codex
wikiSethGammon/CitadelSkill9433d agoMITA56Claude Code
escalation-governanceathola/claude-night-marketSkill358yesterdayMITA19Claude Code
agent-workflow-playbookGingiris-1031/gingiris-skillsSkill9213d agoMITA83Claude Code, Codex
ecom-socialkangise/ecommerce-ai-skillsSkill1247d agoCC0-1.0A60Claude Code, Codex
ecom-customer-servicekangise/ecommerce-ai-skillsSkill1247d agoCC0-1.0A49Claude Code, Codex
ecom-pricingkangise/ecommerce-ai-skillsSkill1247d agoCC0-1.0A35Claude Code, Codex