preview-mermaid

preview-mermaid is a skill for Claude Code from veelenga/preview-skills. It costs 25 tokens per session (1,204 once invoked), scanned A, original, MIT.

A browser preview tool for Mermaid diagrams, which are diagrams written as text. It supports flowcharts, timelines, sequence diagrams, class diagrams, database-relationship diagrams, state diagrams, Gantt charts, and pie charts.

In plain words
What is it for?
Use it to render and inspect Mermaid files or snippets, including software flows, interactions, data relationships, project schedules, and state changes.
Why use it?
It lets you review a diagram visually without building a separate drawing or webpage. Text can be piped directly into the preview for temporary diagrams.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Good fit Use it to render and inspect Mermaid files or snippets, including software flows, interactions, data relationships, project schedules, and state changes.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/veelenga/preview-skills/preview-mermaid"><img src="https://agentmods.dev/badge/skills/veelenga/preview-skills/preview-mermaid.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,204 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.00025 $0.01204
Opus 5 $0.00013 $0.00602
Sonnet 5 $0.00005 $0.00241
Haiku 4.5 $0.00003 $0.00120

Measured 11d ago against content hash 6482f79870c8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

preview-mermaid 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 11d ago.

The scan reads SKILL.md. This mod also ships 8 executable files (config.sh, lib/browser-utils.sh, lib/content-utils.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.

skills/preview-mermaid/SKILL.md · 230 lines

How it starts

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

Preview Mermaid Skill

Interactive Mermaid diagram viewer that renders flowcharts, sequence diagrams, class diagrams, ER diagrams, state diagrams, Gantt charts, pie charts, and more.

Agent Usage

When the user asks to preview a Mermaid diagram, DO NOT build HTML manually. Use the Bash tool to execute this skill's run.sh script:

# Preview a file
./run.sh diagram.mmd

# Pipe content
echo "graph TD
  A-->B" | ./run.sh

The script handles all HTML generation and automatically opens the result in the browser. Do NOT open the file manually to avoid duplicate tabs.

Usage

# Preview a Mermaid diagram file
/preview-mermaid diagram.mmd

# Pipe Mermaid content (preferred for temporary content)
cat flowchart.mermaid | /preview-mermaid
echo "graph TD\n  A-->B" | /preview-mermaid

# With custom background color
/preview-mermaid sequence.mmd --background "#ffffff"

Best Practice: For temporary or generated content, prefer piping over creating temporary files. This avoids cluttering your filesystem and the content is automatically cleaned up.

Options

The script works with sensible defaults but supports these flags for flexibility:

  • -o, --output PATH - Custom output path
  • --no-browser - Skip browser, output file path only

Features

  • All diagram types supported:
    • Flowcharts
    • Sequence diagrams
    • Class diagrams
    • State diagrams
    • ER diagrams (Entity-Relationship)
    • Gantt charts
    • Pie charts
    • Git graphs
    • User journey diagrams
    • Requirement diagrams
  • Interactive diagrams with clickable nodes
  • Pan and zoom for large diagrams
  • Export to SVG functionality
  • Light/dark theme support
  • Auto-layout for optimal diagram rendering
  • Responsive design adapts to screen size

When to Use This Skill

Use this skill when the user wants to:

  • Visualize flowcharts and process diagrams
  • Create sequence diagrams for system interactions
  • Document software architecture with class diagrams
  • Design database schemas with ER diagrams
  • Plan projects with Gantt charts
  • Share visual documentation

Read the full file on GitHub · 230 lines

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. 11d ago First seen · 230 lines · 25 tokens per session scan A 6482f79870c8

Subscribe to this mod's changes

preview-mermaid is a skill published in the GitHub repository veelenga/preview-skills (8 stars, last pushed 1mo ago), licensed MIT. It adds 25 tokens to every session and 1,204 once invoked, about $0.0001 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.

Related

Other skills, from other repositories

long-audio-transcript-processor

A workflow for checking, cleaning up, and splitting very long speech-to-text files into manageable sections. It keeps a glossary, topic notes, and progress records so work can continue later.

cafe3310/public-agent-skills · 32 tokens

im-local-kb

A local knowledge-base manager for turning chat logs into organized Markdown records and sourced project documents. A knowledge base is a searchable collection of stored information.

cafe3310/public-agent-skills · 27 tokens

long-audio-to-obsidian

A workflow for combining scattered voice-transcription project files into organized Markdown documents for Obsidian, a note-taking and knowledge-management app. It sorts transcript sections by the numbers in their filenames and groups related project material.

cafe3310/public-agent-skills · 35 tokens

yuque

Work with Yuque OpenAPI for reading, searching, creating, and updating users, groups, repos, docs, TOC structures, versions, and statistics. Use when Codex needs to operate on Yuque knowledge bases or documents, reorganize document placement in a repo, inspect API capabilities, or prepare guarded plans for destructive…

flc1125/skills · 72 tokens

agent-browser

A command-line browser automation tool for AI agents. It can navigate websites and operate Electron desktop applications, using a compact view of page controls and their references.

cafe3310/public-agent-skills · 36 tokens

getnote

A tool for working with Get 笔记, a note-taking and knowledge-management service. It can handle notes, images, links, tags, and knowledge bases through that service's API.

flc1125/skills · 83 tokens