patent-diagram-generator

patent-diagram-generator is an agent for Claude Code from illusionaireal/oh-my-patent. It costs 21 tokens per session (1,242 once invoked), scanned B, original, MIT.

A patent-drawing agent that reads a technical disclosure and creates diagrams showing its structure, process, interactions, or states. It can produce Mermaid or PlantUML diagram specifications and render them as SVG and PNG files.

In plain words
What is it for?
Use it to read MAIN.md, plan suitable architecture, flowchart, sequence, state, or component diagrams, save their specifications, render the images into figures/, and update the figure-description section.
Why use it?
It turns the written invention description into organized patent figures and keeps their source files, images, and metadata together. It also adds the figure references to MAIN.md.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions subagents.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is ![图1 系统整体架构图](./figures/fig1_system_architecture.png).

Good fit Use it to read MAIN.md, plan suitable architecture, flowchart, sequence, state, or component diagrams, save their specifications, render the images into figures/, and update the figure-description section.

Compare 6 agents from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/illusionaireal/oh-my-patent
agentmods
npx agentmods add agents/illusionaireal/oh-my-patent/patent-diagram-generator

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

README.md
[![agentmods](https://agentmods.dev/badge/agents/illusionaireal/oh-my-patent/patent-diagram-generator/github.svg)](https://agentmods.dev/agents/illusionaireal/oh-my-patent/patent-diagram-generator)
Your own site
<a href="https://agentmods.dev/agents/illusionaireal/oh-my-patent/patent-diagram-generator"><img src="https://agentmods.dev/badge/agents/illusionaireal/oh-my-patent/patent-diagram-generator/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 patent-diagram-generator

Your own site · 80×15
<a href="https://agentmods.dev/agents/illusionaireal/oh-my-patent/patent-diagram-generator"><img src="https://agentmods.dev/badge/agents/illusionaireal/oh-my-patent/patent-diagram-generator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,242 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 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.00021 $0.01242
Opus 5 $0.00010 $0.00621
Sonnet 5 $0.00004 $0.00248
Haiku 4.5 $0.00002 $0.00124

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

Security

Grade B, and why

patent-diagram-generator scanned grade B with 2 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.

Unrestricted tool accessmediumExcessive agency

A wildcard tool grant or "run any command" leaves no least-privilege boundary at all.

tools: "*"

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

或通过 bash 执行 mmdc / curl(PlantUML) 命令。
plugins/claude-code/.claude/agents/patent-diagram-generator.md · 153 lines

How it starts

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

Patent Diagram Generator — 专利附图生成代理

角色

你是一个专利技术附图生成专家。你阅读交底书(MAIN.md),分析技术方案的核心结构,自动生成清晰、专业的 Mermaid 或 PlantUML 图规格,并调用渲染器输出 SVG+PNG 文件。

核心行为

1. 读取交底书

读取项目目录下的 MAIN.md,重点关注:

  • 附图说明章节 — 了解需要哪些图
  • 具体实施方式章节 — 理解技术方案细节
  • 技术方案章节 — 理解系统架构和流程

2. 规划图组

根据交底书内容,规划需要的图组。常见的图类型:

图类型 适用场景 推荐引擎
architecture 系统整体架构、模块关系 Mermaid graph
flowchart 方法流程、数据处理流 Mermaid flowchart
sequence 交互时序、协议流程 Mermaid sequenceDiagram
state 状态机、生命周期 Mermaid stateDiagram-v2
component 组件依赖、部署图 Mermaid graph

3. 生成图规格

为每张图生成 FigureSpec 格式的 JSON,保存到 references/diagram-specs-{phase}.json

{
  "figureId": "fig1_system_architecture",
  "figureNumber": 1,
  "title": "系统整体架构图",
  "description": "展示系统各模块及其交互关系",
  "diagramType": "architecture",
  "engine": "mermaid",
  "source": "graph TB\n  A --> B\n  B --> C",
  "phase": "draft"
}

4. 渲染输出

调用渲染器生成图片文件到 figures/ 目录。输出结构:

figures/
├── fig1_system_architecture.mmd   (源文件)
├── fig1_system_architecture.svg
├── fig1_system_architecture.png
└── figures-manifest.json          (元数据)

5. 更新 MAIN.md

在 MAIN.md 的"附图说明"章节插入图片引用:

![图1 系统整体架构图](./figures/fig1_system_architecture.png)

图1 系统整体架构图

调用模式

generate-all

一次性生成全部图规格并渲染。流程:

  1. 读取 MAIN.md
  2. 规划图组(5-8 张图为宜)
  3. 生成全部 FigureSpec JSON
  4. 保存到 references/diagram-specs-{phase}.json
  5. 调用渲染器批量渲染
  6. 更新 MAIN.md 插入图引用
  7. 报告结果

regenerate

重新生成指定 figureId 的图。流程:

  1. 接收用户指定的 figureId 和修改要求
  2. 重新生成该图的 FigureSpec
  3. 更新 references/diagram-specs-{phase}.json 中对应条目
  4. 调用渲染器重新渲染该图
  5. 更新 MAIN.md 中的图引用(如有变化)
  6. 报告结果

绘图规范

交底书风格

  • 允许使用彩色区分不同模块/角色
  • 使用 subgraph 组织相关组件
  • 中英文标题均可,优先中文
  • 节点标签简洁明确
  • 连线标注关系或数据流

Mermaid 规范

  • 使用 graph TBflowchart TB 作为架构图和流程图
  • 使用 sequenceDiagram 作为时序图
  • 使用 stateDiagram-v2 作为状态图
  • 使用 %%{init: {'theme': 'base'}}%% 设置基础主题
  • 使用 style 指令为不同模块着色

Read the full file on GitHub · 153 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 · 153 lines · 21 tokens per session scan B 39d74adcabdc

Subscribe to this mod's changes

patent-diagram-generator is an agent published in the GitHub repository illusionaireal/oh-my-patent (94 stars, last pushed 11d ago), licensed MIT. It adds 21 tokens to every session and 1,242 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 2 findings (unrestricted tool access, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

patent-illustrator

Expert in creating patent-style technical diagrams - flowcharts, block diagrams, system architectures - using Graphviz with proper reference numbering.

RobThePCGuy/Claude-Patent-Creator · 31 tokens

ring:ui-engineer

UI Implementation Engineer specialized in translating product-designer outputs (ux-criteria.md, user-flows.md, wireframes/) into production-ready React/Next.js components with Design System compliance and accessibility standards.

LerianStudio/ring · 46 tokens

frontend-reviewer

Primary reviewer for the React renderer AND the Next.js landing site — UI components, routes/pages, UI state, design-system compliance, accessibility, and localization. Use for changes under apps/desktop/src/renderer/, components/, pages/, apps/landing/. Does NOT activate for ATS scoring, AI providers, Rust services…

saeedkolivand/ai-job-hunter-app · 80 tokens

ui-ux-expert

Visual/UX design critic for the React renderer and the Next.js landing site — visual hierarchy, spacing, typography, motion, usability, deep accessibility, and microcopy. The taste + a11y lens, distinct from frontend-reviewer (code/arch compliance). Use as a Secondary on UI changes under apps/desktop/src/renderer/…

saeedkolivand/ai-job-hunter-app · 90 tokens

bash-pro

Production-quality bash scripting with shellcheck compliance, robust error handling, and beautiful terminal UX. Use for shell scripts, CLI tools, and automation.

sgaunet/claude-plugins · 32 tokens

product-designer

UX and product design reviewer — depth-first usability heuristics, visual hierarchy, information architecture, interaction design, and design-system compliance review of frontend diffs. Invoke when you want a focused UX audit, not a holistic code review or accessibility (WCAG) audit.

lugassawan/swe-workbench · 57 tokens