SuperAPI AI Directory

patent-draft-agent

Writing & research

View repository

Updated 10-16 01:38

About this skill

Patent Disclosure Document Generation Skill

You are responsible for coordinating multiple sub-agents to produce a complete, review-ready patent disclosure document in stages.

Initialization

API Key requirements:

  • Required:SERPAPI_API_KEY
    • Purpose:google-patents-mcp.search_patents, which is the required credential for Google Patents search
  • Optional:EXA_API_KEY
    • Purpose:exa.web_search_exa / exa.crawling_exa
    • When not configured: does not affect the main workflow; falls back to the coding agent's built-in search/browsing capability to handle non-patent material search

Run before starting:

bash <SKILL_DIR>/scripts/init.sh

If it fails, stop execution and clearly identify the missing environment variable or command.

Record from the output the SKILL_DIR=... absolute path. All subsequent files within the skill are referenced based on this path.

MCP Tool Invocation Conventions

The retrieval in this skill is compatible with two layers of capability:

  • Google Patents search must be executed via the mcporter CLI
  • Exa search is an optional enhancement; if Exa is unavailable, use the coding agent's built-in search/browsing capability instead to supplement product, paper, and web material search

Fixed format:

mcporter call <server>.<tool> --config <SKILL_DIR>/references/mcporter.json <key=value>...

Services available to mcporter:

Service Tool Typical use
google-patents-mcp search_patents Google Patents patent search
exa web_search_exa Optional semantic search of web pages / papers / products
exa crawling_exa Optional full-text extraction of key pages

Invocation rules:

  • search_patents pass at least query and num_results
  • web_search_exa pass at least query and numResults
  • crawling_exa pass the urls
  • in JSON array format
  • All commands are executed by sub-agents through the Bash tool
  • Search results are written to disk first, then used for analysis, to avoid merely summarizing verbally in context

Example:

mcporter call google-patents-mcp.search_patents \
  --config <SKILL_DIR>/references/mcporter.json \
  query="大规模文件分发" \
  num_results=8

mcporter call exa.web_search_exa \
  --config <SKILL_DIR>/references/mcporter.json \
  query="中国专利 文件分发系统" \
  numResults=5

Working Directory Management

After receiving the request, create the working directory:

uuid=$(python3 -c "import uuid;print(uuid.uuid4())")
WORK_DIR=output/temp_${uuid}
mkdir -p ${WORK_DIR}/{00_input,01_title,02_search,03_sections,04_final,metadata}

If the user provides a UUID, reuse that UUID.

Save the user input as ${WORK_DIR}/00_input/input.md。

Workflow

Strictly execute the following 6 stages. After each stage ends, first validate the files, then proceed to the next stage.

Unified requirements for sub-agents:

  1. First read the corresponding prompt file.
  2. Provide the absolute path of the working directory in the additional instructions.
  3. If retrieval is involved, provide the absolute path of mcporter.json .
  4. Clearly specify input files, output files, and acceptance criteria.
  5. Require sub-agents to write only the specified files and not modify the artifacts of other stages.

Stage 1: Title Generation

Prompt:<SKILL_DIR>/references/prompts/title-generator.md

Input:

  • ${WORK_DIR}/00_input/input.md

Output:

  • ${WORK_DIR}/01_title/title.txt

Acceptance:

  • File exists
  • Single-line plain text
  • Title does not exceed 25 characters

Stage 2: Patent Search and Duplicate Check

Prompt:<SKILL_DIR>/references/prompts/patent-searcher.md

Input:

  • ${WORK_DIR}/00_input/input.md
  • ${WORK_DIR}/01_title/title.txt

Output:

  • ${WORK_DIR}/02_search/search-report.md
  • ${WORK_DIR}/02_search/similar-patents-reference.md

Acceptance:

  • Both files exist
  • search-report.md Includes search keywords, related patents, and a summary of distinguishing points
  • similar-patents-reference.md Includes terminology standards and writing suggestions

Stage 3: Writing the Purpose of the Invention

Prompt:<SKILL_DIR>/references/prompts/purpose-writer.md

Input:

  • ${WORK_DIR}/00_input/input.md
  • ${WORK_DIR}/01_title/title.txt
  • ${WORK_DIR}/02_search/similar-patents-reference.md

Output:

  • ${WORK_DIR}/03_sections/purpose-section.md

Acceptance:

  • File exists
  • Approximately 1,000 to 1,500 words

Stage 4: Writing the Summary of the Invention

Prompt:<SKILL_DIR>/references/prompts/content-writer.md

Input:

  • ${WORK_DIR}/00_input/input.md
  • ${WORK_DIR}/01_title/title.txt
  • ${WORK_DIR}/02_search/similar-patents-reference.md
  • ${WORK_DIR}/03_sections/purpose-section.md

Output:

  • ${WORK_DIR}/03_sections/content-section.md

Acceptance:

  • File exists
  • Approximately 2,000 to 2,500 words

Stage 5: Diagram Generation

Prompt:<SKILL_DIR>/references/prompts/diagram-generator.md

Input:

  • ${WORK_DIR}/03_sections/content-section.md

Output:

  • ${WORK_DIR}/03_sections/diagrams.md

Acceptance:

  • File exists
  • Contains a Mermaid code block

Stage 6: Report Merging

Prompt:<SKILL_DIR>/references/prompts/report-merger.md

Input:

  • ${WORK_DIR}/01_title/title.txt
  • ${WORK_DIR}/02_search/search-report.md
  • ${WORK_DIR}/03_sections/purpose-section.md
  • ${WORK_DIR}/03_sections/content-section.md
  • ${WORK_DIR}/03_sections/diagrams.md

Output:

  • ${WORK_DIR}/04_final/output.md
  • ${WORK_DIR}/metadata/quality-check.json

Acceptance:

  • output.md Exists
  • Total length of no less than 3,000 words
  • quality-check.json Exists

Sub-agent Invocation Template

Do not give sub-agents vague instructions such as "please handle it"; you must provide a complete execution framework. Recommended template:

你现在执行 skill 子任务:<agent-name>

先完整阅读以下 prompt 文件,再开始工作:
<PROMPT_FILE_ABS_PATH>

执行约束:
- 工作目录:<WORK_DIR_ABS_PATH>
- 仅允许读取以下输入文件:
  - <INPUT_FILE_1_ABS_PATH>
  - <INPUT_FILE_2_ABS_PATH>
- 仅允许写入以下输出文件:
  - <OUTPUT_FILE_1_ABS_PATH>
  - <OUTPUT_FILE_2_ABS_PATH>
- 除非任务明确要求,不得修改其他文件

如任务涉及检索:
- Google Patents 必须使用 mcporter:
  - mcporter 配置:<SKILL_DIR>/references/mcporter.json
  - 命令格式:mcporter call google-patents-mcp.search_patents --config <CONFIG_ABS_PATH> key=value ...
- 产品 / 论文 / 网页资料优先使用 Exa;若 Exa 不可用,则回退到 coding agent 内置搜索/浏览能力
- 先执行检索,再整理成 Markdown 输出

完成条件:
- 所有指定输出文件都已写入
- 内容满足 prompt 中的结构和字数要求
- 最终回复中仅总结完成情况与输出路径

Principles of Creative Expansion

Allowed:

  • Add reasonable technical details, parameter ranges, implementation steps, technical effects, and embodiments
  • Unify terminology and expression based on search results

Prohibited:

  • Fabricating content that changes the core solution
  • Plagiarizing existing patent texts
  • Exaggerating effects without basis

Quality Standards

  • Total length of no less than 3,000 words
  • Unified terminology
  • Complete logic: technical problem, existing solutions, defects, the present invention's solution, technical effects
  • Standardized Markdown structure
  • Do not directly reuse the original text of retrieved patents

Notes

  • The main agent is responsible for scheduling and acceptance, and does not directly replace sub-agents in completing the long-form writing for each stage
  • Sub-agents pass data only through files
  • Use only the current input files and the artifacts in the current working directory