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.
npx skills add EthanYoQ/Skill-hub --skill mermaid-renderergit clone --depth 1 https://github.com/EthanYoQ/Skill-hubWrote 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.
[](https://agentmods.dev/skills/ethanyoq/skill-hub/mermaid-renderer)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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.
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
- mmdc/npx 不可用→ ok=False + fallback_inline = mermaid_text
- subprocess 失败(returncode 非零 / 输出文件不存在)→ ok=False + fallback_inline + 错误 message (含 stderr 前 500 char)
- 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 originalsource - per-block graph quality metrics:
edge_count,decision_node_count,numeric_evidence_count, andcross_point_count ok=falseif 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.
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.
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.
- 2mo ago First seen · 80 lines · 89 tokens per session scan A 031ff5e6137f
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.
mermaid-renderer compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| mermaid-rendererEthanYoQ/Skill-hub | Skill | 12 | 2d ago | MIT | A | 89 | Claude Code, Codex |
| wikiSethGammon/Citadel | Skill | 943 | 3d ago | MIT | A | 56 | Claude Code |
| escalation-governanceathola/claude-night-market | Skill | 358 | yesterday | MIT | A | 19 | Claude Code |
| agent-workflow-playbookGingiris-1031/gingiris-skills | Skill | 92 | 13d ago | MIT | A | 83 | Claude Code, Codex |
| ecom-socialkangise/ecommerce-ai-skills | Skill | 124 | 7d ago | CC0-1.0 | A | 60 | Claude Code, Codex |
| ecom-customer-servicekangise/ecommerce-ai-skills | Skill | 124 | 7d ago | CC0-1.0 | A | 49 | Claude Code, Codex |
| ecom-pricingkangise/ecommerce-ai-skills | Skill | 124 | 7d ago | CC0-1.0 | A | 35 | Claude Code, Codex |