mermaid-diagram

mermaid-diagram is a skill for Claude Code from wanshuiyin/Auto-claude-code-research-in-sleep. It costs 36 tokens per session (4,107 once invoked), scanned A, original, MIT.

A tool that turns a written request into Mermaid code for diagrams such as flowcharts, timelines, sequence diagrams, and database relationship diagrams.

In plain words
What is it for?
Use it to create diagrams from requirements, save them in a figures directory, and check the generated code for syntax errors.
Why use it?
It removes the need to learn the diagram language and manually arrange every component and connection.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to create diagrams from requirements, save them in a figures directory, and check the generated code for syntax errors.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/wanshuiyin/auto-claude-code-research-in-sleep/mermaid-diagram
About the project

ARIS is a collection of Markdown-based skills that define a workflow for autonomous machine-learning research, including idea discovery, experiment automation, and review loops. Researchers and AI coding agents use it across tools such as Claude Code, Codex, Cursor, and OpenClaw without depending on a single framework. The catalogue entries are ARIS workflow skills and agents.

wanshuiyin/Auto-claude-code-research-in-sleep · 16,030 stars · on GitHub

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 wanshuiyin/Auto-claude-code-research-in-sleep --skill mermaid-diagram
Clone the repo
git clone --depth 1 https://github.com/wanshuiyin/Auto-claude-code-research-in-sleep

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 mermaid-diagram

README.md
[![agentmods](https://agentmods.dev/badge/skills/wanshuiyin/auto-claude-code-research-in-sleep/mermaid-diagram/github.svg)](https://agentmods.dev/skills/wanshuiyin/auto-claude-code-research-in-sleep/mermaid-diagram)
Your own site
<a href="https://agentmods.dev/skills/wanshuiyin/auto-claude-code-research-in-sleep/mermaid-diagram"><img src="https://agentmods.dev/badge/skills/wanshuiyin/auto-claude-code-research-in-sleep/mermaid-diagram/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-diagram

Your own site · 80×15
<a href="https://agentmods.dev/skills/wanshuiyin/auto-claude-code-research-in-sleep/mermaid-diagram"><img src="https://agentmods.dev/badge/skills/wanshuiyin/auto-claude-code-research-in-sleep/mermaid-diagram.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,107 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. Third-party audits
  • Socket pass 19 Mar 2026
  • Snyk warn 19 Mar 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 6 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high YARA Match · line 3
    YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).
    Fix: Remove offensive tool references and exploit code. Legitimate agent skills should not contain penetration testing tools, exploit frameworks, or reconnaissance utilities.
  • high Prompt Injection · line 99
    Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
    Fix: Audit all comments and invisible characters. Remove any instructions that direct the agent to perform unauthorized actions. Use plain, reviewable content.
  • high Prompt Injection · line 105
    Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
    Fix: Audit all comments and invisible characters. Remove any instructions that direct the agent to perform unauthorized actions. Use plain, reviewable content.
  • medium analysis-evasion · line 1
    Suspicious Unicode normalization or mixed-script content
    Fix: Review the flagged content for security risks. Ensure no credentials, secrets, or sensitive data are exposed.
  • medium MCP Rug Pull · line 121
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 122
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
How audits are shown
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.00036 $0.04107
Opus 5 $0.00018 $0.02054
Sonnet 5 $0.00007 $0.00821
Haiku 4.5 $0.00004 $0.00411

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

Security

Grade A, and why

mermaid-diagram 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 13d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

skills/mermaid-diagram/SKILL.md · 420 lines

How it starts

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

Mermaid Diagram Generator

Generate high-quality Mermaid diagram code based on user requirements, with file output and verification.

Constants

  • OUTPUT_DIR = figures/ — Output directory for all generated files
  • MAX_ITERATIONS = 3 — Maximum refinement rounds for syntax errors

Workflow: MUST EXECUTE ALL STEPS

Step 0: Pre-flight Check

# Create output directory
mkdir -p figures

Step 1: Understand Requirements & Select Diagram Type

Parse the input: $ARGUMENTS

  1. Analyze user description to determine the most suitable diagram type
  2. Read the corresponding syntax reference documentation (see Diagram Type Reference below)
  3. If the diagram involves mathematical notation (formulas, equations, Greek letters, subscripts, superscripts, fractions, matrices, etc.), apply the math syntax rules from the Math Formulas in Diagrams section below
  4. Identify all components, connections, and data flow
  5. Plan the diagram structure

Step 2: Read Documentation

Select the appropriate diagram type based on the use case. Use your built-in knowledge of Mermaid syntax, or fetch up-to-date docs via the context7 MCP server if needed.

Type Use Cases
Flowchart Processes, decisions, steps
Sequence Diagram Interactions, messaging, API calls
Class Diagram Class structure, inheritance, associations
State Diagram State machines, state transitions
ER Diagram Database design, entity relationships
Gantt Chart Project planning, timelines
Pie Chart Proportions, distributions
Mindmap Hierarchical structures, knowledge graphs
Timeline Historical events, milestones
Git Graph Branches, merges, versions
Quadrant Chart Four-quadrant analysis
Requirement Diagram Requirements traceability
C4 Diagram System architecture (C4 model)
Sankey Diagram Flow, conversions
XY Chart Line charts, bar charts
Block Diagram System components, modules
Packet Diagram Network protocols, data structures
Kanban Task management, workflows
Architecture Diagram System architecture
Radar Chart Multi-dimensional comparison
Treemap Hierarchical data visualization
User Journey User experience flows
ZenUML Sequence diagrams (code style)

Read the full file on GitHub · 420 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. 13d ago First seen · 420 lines · 36 tokens per session scan A b7cb4fb550b4

Subscribe to this mod's changes

mermaid-diagram is a skill published in the GitHub repository wanshuiyin/Auto-claude-code-research-in-sleep (16,030 stars, last pushed yesterday), licensed MIT. It adds 36 tokens to every session and 4,107 once invoked, about $0.0002 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-30.

Related

Other skills, from other repositories

drawio-reconstruction

Reconstructs reference images into high-fidelity, editable Draw.io files with rendered previews: native Draw.io elements carry text and structure, SVG covers simple icons that match the reference, and cropped or transparent PNGs preserve complex visuals. Use when the user wants a diagram image, research figure…

HKUSTDial/Supervisor-Skills · 102 tokens

figure-designer

Advises on the design of the three core figures in a technical paper: the Motivated Example (Figure 1), the Solution Overview (Methodology), and the Experimental Results figures. Recommends the right design paradigm, layout, labelling, and tool for each figure type, then runs a quality-control audit. Use when the user…

HKUSTDial/Supervisor-Skills · 112 tokens

visual-architect

Transform research papers into professional visual schemas. Analyzes paper logic, selects optimal layout patterns, and generates detailed prompts for AI image generation.

proyecto26/sherlock-ai-plugin · 32 tokens

do-not-ship-an-empty-surface

An empty screen, tab or category is a promise the product is not keeping. Hide it until it has content, or do not build it yet.

brcampidelli/chimera-agent · 39 tokens

warn-before-the-thing-you-are-warning-about

A caution placed after the action it concerns arrives after the reader has already decided. Put it above, and make it undismissable when it matters.

brcampidelli/chimera-agent · 41 tokens

context-menu

Guide for creating and displaying context menus in Wave Terminal. Use when implementing right-click menus, adding context menu items, creating submenus, or handling menu interactions with checkboxes and separators.

mits-pl/wove · 40 tokens