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, 8 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, 8 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 1mo 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 1mo 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. 1mo 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 (7 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

Other skills, from other repositories

excalidraw

Create or extend editable Excalidraw diagrams from descriptions or repository evidence using a local skeleton-to-scene converter.

fakoli/fakoli-plugins · 28 tokens

multi-surface-render

Multi-surface rendering with json-render — one JSON spec produces React web, Next.js, React Native, Ink terminal UIs, PDFs, emails, Remotion videos, OG images, and 3D scenes. Covers renderer target selection, registry mapping, and platform APIs (renderToBuffer, renderToStream, renderToFile). Use when generating output…

yonatangross/orchestkit · 98 tokens

web-artifacts-builder-v2

Suite of tools for creating elaborate, multi-component claude.ai HTML artefacts using modern frontend web technologies (React 19, Tailwind CSS v4, shadcn/ui). Use for complex artefacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artefacts.

sammcj/agentic-coding · 73 tokens

design-workflow

A workflow for bringing design handoff files, design tokens, and project design briefs into a code project. It validates the tokens and loads research, system, and specification notes before interface implementation.

modu-ai/moai-cowork · 48 tokens

create-glyph

Create R-based pictogram glyphs for skill, agent, or team icons in the visualization layer. Covers concept sketching, ggplot2 layer composition using the primitives library, color strategy, registration in the appropriate glyph mapping file and manifest, rendering via the build pipeline, and visual verification of the…

pjt222/agent-almanac · 106 tokens

design-cli-output

Design terminal output for a CLI tool with chalk colors, Unicode glyphs, multiple verbosity levels (human, verbose, quiet, JSON), and consistent voice rules. Covers color palette selection, status indicator design, reporter function architecture, ceremony/narrative output variants, and cross-terminal compatibility.…

pjt222/agent-almanac · 96 tokens