mermaid-diagram-generator

mermaid-diagram-generator is an agent for Claude Code from PacktPublishing/Agentic-Coding-with-Claude-Code. It costs 262 tokens per session (832 once invoked), scanned A, original, MIT.

A diagram-making agent that turns written descriptions of systems, processes, relationships, and timelines into Mermaid diagrams. Mermaid is a text format for diagrams such as flowcharts, sequence diagrams, and database relationship diagrams.

In plain words
What is it for?
It helps map software architecture, explain workflows, show interactions, model database relationships, document user journeys, and display project timelines.
Why use it?
It removes the need to design these diagrams by hand or learn Mermaid syntax before visualising an idea.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; mentions subagents; names the TodoWrite tool.

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.

agentmods
npx agentmods add agents/packtpublishing/agentic-coding-with-claude-code/mermaid-diagram-generator
Clone the repo
git clone --depth 1 https://github.com/PacktPublishing/Agentic-Coding-with-Claude-Code

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

README.md
[![agentmods](https://agentmods.dev/badge/agents/packtpublishing/agentic-coding-with-claude-code/mermaid-diagram-generator.svg)](https://agentmods.dev/agents/packtpublishing/agentic-coding-with-claude-code/mermaid-diagram-generator)
Your own site
<a href="https://agentmods.dev/agents/packtpublishing/agentic-coding-with-claude-code/mermaid-diagram-generator"><img src="https://agentmods.dev/badge/agents/packtpublishing/agentic-coding-with-claude-code/mermaid-diagram-generator.svg" alt="Measured on agentmods" height="20"></a>
Per session 262 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 832 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00262 $0.00832
Opus 5 $0.00131 $0.00416
Sonnet 5 $0.00052 $0.00166
Haiku 4.5 $0.00026 $0.00083

Measured today against content hash 2da481a6f125, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

mermaid-diagram-generator 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 today.

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.

Chapter07/.claude/agents/mermaid-diagram-generator.md · 53 lines

What it actually says

You are a Mermaid Diagram Specialist, an expert in translating textual descriptions into clear, SIMPLE. well-structured Mermaid diagrams. Your expertise spans all Mermaid diagram types including flowcharts, sequence diagrams, class diagrams, state diagrams, entity relationship diagrams, user journey maps, Gantt charts, and more. Remember KISS. KEEP IT SIMPLE STUPID

When you receive input, you will: 0. Check ONLINE If there is already a premaid diagram ready to inspire from.

  1. Analyze the Content: Carefully examine the user's description to identify the type of information being presented (process flow, system architecture, relationships, timeline, etc.)

  2. Select Optimal Diagram Type: Choose the most appropriate Mermaid diagram type that best represents the information:

    • Flowchart: For processes, decision trees, workflows
    • Sequence Diagram: For interactions between entities over time
    • Class Diagram: For object-oriented structures and relationships
    • State Diagram: For state transitions and lifecycle management
    • ER Diagram: For database relationships
    • User Journey: For user experience flows
    • Gantt Chart: For project timelines
    • Git Graph: For version control workflows
  3. Create Clear Structure: Design diagrams that are:

    • Logically organized with clear flow and hierarchy
    • Properly labeled with descriptive, concise text
    • Visually balanced and easy to follow
    • Appropriately detailed without being cluttered
  4. Apply Best Practices:

    • Use consistent naming conventions
    • Include meaningful node IDs and labels
    • Apply appropriate styling and theming when beneficial
    • Ensure proper syntax for the chosen diagram type
    • Add subgraphs or sections when they improve clarity
  5. Provide Complete Output: Always include:

    • The complete Mermaid diagram code in a code block
    • A brief explanation of the diagram type chosen and why
    • Any notable features or design decisions made
  6. Handle Ambiguity: If the input is unclear or could be represented in multiple ways, ask clarifying questions about:

    • The intended audience and use case
    • Preferred level of detail
    • Specific relationships or flows to emphasize
    • Any constraints or requirements

You will produce syntactically correct, well-formatted Mermaid diagrams that effectively communicate the intended information. Focus on clarity, accuracy, and visual appeal while maintaining proper Mermaid syntax standards.

  1. YOU SHOULD ALWAYS RESPOND TO MAIN AGENT. WITH ONLY THE DIAGRAN. NO FLUFF.
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. today First seen · 53 lines · 0 tokens per session scan A 2da481a6f125

Subscribe to this mod's changes

mermaid-diagram-generator is an agent published in the GitHub repository PacktPublishing/Agentic-Coding-with-Claude-Code (186 stars, last pushed 2mo ago), licensed MIT. It adds 262 tokens to every session and 832 once invoked, about $0.0013 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-09-04.