mermaid-viewer

mermaid-viewer is a skill for Claude Code from atretyak1985/swarmery. It costs 69 tokens per session (906 once invoked), scanned A, original, Apache-2.0.

A browser-based viewer for Mermaid diagram files, which are text files that describe diagrams such as flowcharts and database relationships. It turns an existing `.mmd` file into a self-contained HTML page with pan and zoom.

In plain words
What is it for?
Use it to render an existing Mermaid file, explore entity-relationship diagrams, search entities, and create an HTML viewer.
Why use it?
It lets you inspect and explore a Mermaid diagram in a browser instead of reading its text source. It also keeps the original diagram source available for download.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the core plugin — 37 skills, 9 commands, 13 agents shipped together

Good fit Use it to render an existing Mermaid file, explore entity-relationship diagrams, search entities, and create an HTML viewer.

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

Made for: Claude Code.

Or install core, the plugin that ships this one along with the rest of its 37 skills, 9 commands, 13 agents.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/atretyak1985/swarmery/mermaid-viewer"><img src="https://agentmods.dev/badge/skills/atretyak1985/swarmery/mermaid-viewer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 906 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.00069 $0.00906
Opus 5.5 $0.00028 $0.00362
Sonnet 5.5 $0.00014 $0.00181
Haiku 4.5 $0.00007 $0.00091

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

Security

Grade A, and why

mermaid-viewer 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 3mo ago.

The scan reads SKILL.md. This mod also ships 4 executable files (scripts/build.sh, scripts/stats.sh, scripts/test.sh, …), 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.

plugins/core/skills/mermaid-viewer/SKILL.md · 65 lines

How it starts

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

Purpose

Materialise any Mermaid diagram source (.mmd) into a themed, interactive HTML viewer — one self-contained file with pan/zoom, ER entity search, and a source-download button. Mermaid 11.4.1 and svg-pan-zoom 3.6.2 load from jsDelivr at runtime; styling is a dark-terminal design system consistent with the html-reporting shell. ER-specific features no-op for other diagram types.

Rules

  • Colors in mermaid.initialize() config must be hex or rgba, never OKLCH — Mermaid's color parser (khroma) does not support it; violation gives a blank viewport.
  • Mermaid source stays in <script id="mmd-source" type="text/plain">, never <pre class="mermaid">, or the download button returns SVG.
  • build.sh substitutes sentinels with POSIX awk, never sed — Mermaid source breaks sed.
  • Playwright verification navigates via http://localhost:<port>, never file://; always verify.sh stop <port> afterwards.
  • Never bump the pinned deps (mermaid 11.4.1, svg-pan-zoom 3.6.2) without re-running test.sh + verify.sh + Playwright on a real fixture.
  • Fix bugs in templates/viewer.html.tpl, regenerate, refresh the golden (test.sh --update) — never patch generated HTML in isolation.

Resources

  • Read resources/build-procedure.md when running the pipeline — inputs/outputs, the four-step procedure, script reference, self-check, escalation, examples, file layout.
  • Read resources/gotchas-and-pinned-deps.md when debugging rendering or touching the template — the five baked-in gotchas, OKLCH→sRGB conversion table, pinned-dependency rules, CDN supply-chain note, failure modes.
  • Existing subdirs: templates/viewer.html.tpl (sentinel skeleton), scripts/ (stats.sh, build.sh, verify.sh, test.sh), examples/ (sample.mmd fixture + sample.html golden).

How to use

What it does

Turns an existing .mmd file into one self-contained HTML page: rendered diagram, pan and zoom, an entity search filter for ER diagrams, meta badges with counts, and a button to download the original Mermaid source — dark-themed so the output looks finished.

Read the full file on GitHub · 65 lines

Files

What ships with it

9 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. 3mo ago First seen · 65 lines · 69 tokens per session scan A 3cade2594e6b

Subscribe to this mod's changes

mermaid-viewer is a skill published in the GitHub repository atretyak1985/swarmery (9 stars, last pushed today), licensed Apache-2.0. It adds 69 tokens to every session and 906 once invoked, about $0.0003 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-03.

Related

mermaid-viewer compared with skills from other repositories

mermaid-viewer next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mermaid-vieweratretyak1985/swarmerySkill9todayApache-2.0A69Claude Code
excalidrawfakoli/fakoli-pluginsSkill46d agoMITA28Claude Code, Codex
anywhere-uianywhere-labs/Agents-AnywhereSkill4.0ktodayApache-2.0A46Claude Code, Codex
multi-surface-renderyonatangross/orchestkitSkill315todayMITA48Claude Code
web-artifacts-builder-v2sammcj/agentic-codingSkill1743d agoApache-2.0A73Claude Code, Codex
create-glyphpjt222/agent-almanacSkill46todayMITA106Claude Code
design-cli-outputpjt222/agent-almanacSkill46todayMITA96Claude Code