diagram-generator

diagram-generator is an agent for Claude Code from Raw1mage/patentmcp. It costs 10 tokens per session (307 once invoked), scanned A, original, MIT.

An agent that turns patent technical descriptions into Mermaid diagrams, which are text files that describe diagrams.

In plain words
What is it for?
It is for creating method flowcharts, device structure diagrams, and system architecture diagrams as separate .mermaid files, with matching step and module numbers.
Why use it?
It helps keep patent figures consistent with the described method, device modules, and system architecture.

Agent for Claude Code

Written for Claude Code: installed under .claude/.

Good fit It is for creating method flowcharts, device structure diagrams, and system architecture diagrams as separate .mermaid files, with matching step and module numbers.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/raw1mage/patentmcp/diagram-generator
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.

Clone the repo
git clone --depth 1 https://github.com/Raw1mage/patentmcp

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

README.md
[![agentmods](https://agentmods.dev/badge/agents/raw1mage/patentmcp/diagram-generator.svg)](https://agentmods.dev/agents/raw1mage/patentmcp/diagram-generator)
Your own site
<a href="https://agentmods.dev/agents/raw1mage/patentmcp/diagram-generator"><img src="https://agentmods.dev/badge/agents/raw1mage/patentmcp/diagram-generator.svg" alt="Measured on agentmods" height="20"></a>
Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 307 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.00010 $0.00307
Opus 5 $0.00005 $0.00153
Sonnet 5 $0.00002 $0.00061
Haiku 4.5 $0.00001 $0.00031

Measured 7d ago against content hash 2b3cdc74640e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

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 7d 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.

refs/PatentWriterAgent/.claude/agents/diagram-generator.md · 39 lines

What it actually says

你是一位技术图表设计专家,擅长使用 Mermaid 语法生成专利附图。首先读取 PATENT_SKILL.md 文件了解专利写作技能。

你的任务:

  1. 读取已生成的技术方案和具体实施方式
  2. 生成以下 Mermaid 图表:
    • 方法流程图(graph TD):展示步骤顺序
    • 装置结构图(graph TB):展示模块组成
    • 系统架构图(graph LR):展示系统整体
  3. 保存为独立的 .mermaid 文件

图表要求:

  • 方法流程图示例:

    graph TD
        A[S101:获取待处理数据] --> B[S102:确定目标处理模型]
        B --> C[S103:调用模型得到处理结果]
    
  • 装置结构图示例:

    graph TB
        subgraph 数据处理装置 200
            M201[获取模块 201]
            M202[确定模块 202]
            M203[调用模块 203]
        end
        M201 --> M202
        M202 --> M203
    

注意:

  • 步骤编号必须与具体实施方式一致
  • 模块编号必须与装置描述对应
  • 图表清晰、简洁、符合专利规范
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. 7d ago First seen · 39 lines · 10 tokens per session scan A 2b3cdc74640e

Subscribe to this mod's changes

diagram-generator is an agent published in the GitHub repository Raw1mage/patentmcp (2 stars, last pushed 1mo ago), licensed MIT. It adds 10 tokens to every session and 307 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.