patent-aid: Instructions file for Claude Code

CLAUDE.md

patent-aid CLAUDE.md is an instructions file for Claude Code from KumnXi/patent-aid. It costs 699 tokens per session, scanned A, original, MIT.

Project instructions for an AI-assisted patent-writing system focused on the electricity industry and pipeline-inspection robots. The system turns a technical idea into a standard patent disclosure document, including generated text, checks, diagrams, and a Word export.

In plain words
What is it for?
Use it when developing or operating the patent-writing project: generate disclosure documents, run tests, create diagrams, discover patent data, and maintain project files safely.
Why use it?
It gives contributors consistent commands, architecture boundaries, testing guidance, and safeguards for files containing secrets or generated output.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: reads .claude/ paths.

This is KumnXi/patent-aid's own configuration. It tells Claude Code how to work on patent-aid itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything patent-aid configures →

Reuse

Borrowing it

Nothing to install: this file belongs to KumnXi/patent-aid. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/KumnXi/patent-aid/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/KumnXi/patent-aid

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-aid CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/kumnxi/patent-aid/claude-md/github.svg)](https://agentmods.dev/instructions/kumnxi/patent-aid/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/kumnxi/patent-aid/claude-md"><img src="https://agentmods.dev/badge/instructions/kumnxi/patent-aid/claude-md/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-aid CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/kumnxi/patent-aid/claude-md"><img src="https://agentmods.dev/badge/instructions/kumnxi/patent-aid/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 699 This file is loaded in full into every session.
When invoked 699 The same file — it is already loaded in full.
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.00699 $0.00699
Opus 5 $0.00349 $0.00349
Sonnet 5 $0.00140 $0.00140
Haiku 4.5 $0.00070 $0.00070

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

Security

Grade A, and why

patent-aid CLAUDE.md 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 9d 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.

CLAUDE.md · 56 lines

What it actually says

专利撰写助手 · 项目约定

项目定位

AI 辅助专利撰写系统,面向电力行业 + 管道检测机器人方向。

核心目标:从技术想法到标准专利格式交底书(不是从交底书到专利)。

核心链路:想法 → 三阶段 LLM 生成 → 防无中生有自动修复 → 权利要求格式校验 → 导出标准 Word(原生 OMML 公式 + Graphviz 附图)。

环境

  • Python 解释器:D:/Anaconda3/envs/mathmodel/python.exe(conda 环境 mathmodel
  • 依赖见 requirements.txt;Graphviz 已装(dot 二进制),无需 pip 依赖

常用命令

# 一键生成交底书(核心入口)
python scripts/generate_patent.py "技术想法" \
    --title "一种..." --tech-field "技术领域" \
    --purpose "要解决的问题" --core-method "核心方法" \
    --problems "现有技术不足" --out output/交底书.docx

# 自动化测试(22 项,会真实调用 LLM,约 10-15 分钟,需 API Key)
python scripts/run_tests.py

# 绘图自测(生成 output/_fig_test.png)
python src/utils/diagram_generator.py

# 专利数据(需 Clash 代理 127.0.0.1:7890)
python scripts/ipc_discovery.py 3        # IPC 领域发现
python scripts/fast_crawl.py             # 并发爬取全文
python scripts/firecrawl_discover.py --query "管道检测 专利"  # Firecrawl 备用通道
python scripts/db_maintain.py --dry-run  # 数据库治理(先分析不写回)

安全红线(重要)

  • config/api_config.jsondata/.secret.key.env真实 API 密钥,永不提交/推送
  • git add 前先 git status 检查;推送前确认无敏感文件入库
  • data/disclosure_history/ 为加密历史,不入库
  • output/.claude/settings.local.json 亦不入库

架构约束

  • 外部代码只应 from src.core import PatentInnovationEngine(统一入口,见 src/core/__init__.py
  • src/core 内部模块保持扁平,不要为外部新增直接依赖(改 src/core/__init__.py 导出即可)
  • 绘图统一走 src/utils/diagram_generator.mermaid_to_png():Graphviz dot 首选(300dpi 自动布局),matplotlib 回退
  • Word 导出走 src/utils/word_exporter.export_disclosure_to_word();历史加密走 src/utils/history.py

交流

  • 优先使用中文交流与代码注释(与 .claude/settings.json 约定一致)
  • 所有生成类代码交付前必须实际运行验证
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. 9d ago First seen · 56 lines · 699 tokens per session scan A 2c2dcfd2db4c

Subscribe to this mod's changes

patent-aid CLAUDE.md is an instructions file published in the GitHub repository KumnXi/patent-aid (2 stars, last pushed 15d ago), licensed MIT. It adds 699 tokens to every session, about $0.0035 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 instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 3,735 tokens