用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/bb-boy/repo2patent --skill repo2patent命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | repo2patent |
| version | 5.0.0 |
| description | 面向中国发明专利:从 GitHub 项目/技术方案生成可交付的专利技术交底书(Word .docx),并【必须】完成专利检索 + 权利要求抽取(claims)+ 特征对比矩阵 + 候选新颖点(差异特征组合)提炼。 |
本 Skill 解决两件事(两者都是必须):
.docx)references/00_authoritative_sources.mdsrc/scheduler/)disclosure.docx:交付给代理人/内部评审的交底书(主交付)disclosure.json:结构化交底内容(必须,schema 化)run_report.md:流程执行报告(日志分流文件,不进入交底正文)prior_art.json:检索结果(结构化,召回)prior_art_full.json:对比文件“精读包”(至少包含 claims)claims_manual.json:人工回填 claims(当自动抓取失败时必须产出)novelty_matrix.json:特征×对比文件矩阵(claim 优先)+ 候选差异特征/差异组合统计missing_info.md:待补信息清单.patent_assistant/evidence.json:证据包(路径+行号+片段,可审计)说明
- A:检索召回(prior_art.json)
- B:抓取权利要求(prior_art_full.json) ← 本版本新增(必须)
- C:基于 claims 的特征级对比与新颖点提炼 ← 本版本加强(必须)
python scripts/repo_fetcher.py --repo <repo_url_or_path> --ref <optional> --workdir .patent_assistant --force
产物:.patent_assistant/repo/、.patent_assistant/repo_meta.json
python scripts/repo_indexer.py --repo .patent_assistant/repo --out .patent_assistant/repo_index.json
LLM 只读取 .patent_assistant/repo_index.json,输出 reading_plan.json(必须符合 schema):
references/schemas/reading_plan.schema.jsonPlanner 硬性要求:
repo_index.json 给出了 entrypoints,必须包含至少 1 个 entrypointmax_files、max_total_charspython scripts/evidence_builder.py --repo .patent_assistant/repo --index .patent_assistant/repo_index.json --plan reading_plan.json --out .patent_assistant/evidence.json
LLM 只读取:
.patent_assistant/repo_meta.json.patent_assistant/evidence.json
并输出结构化 invention_profile.json(必须符合 schema):references/schemas/invention_profile.schema.json要求至少包含:
若关键信息缺失,必须输出 missing_info.md(参考 references/04_inventor_question_bank.md)。
先由 Codex agent 产出 queries.agent.json(list 或 {queries:[...]}),再由脚本做质量门禁与回退合并:
python scripts/query_builder.py \
--profile invention_profile.json \
--agent-queries queries.agent.json \
--query-source auto \
--min-agent-queries 4 \
--strict \
--min-query-tokens 2 \
--out queries.json
说明:
--query-source auto:agent 优先;若 agent 查询缺失/不足,自动回退并合并 profile 查询。queries.agent.json 不存在,流程可继续(回退 profile),但会给出 warning。至少使用 Google Patents(可追加 lens/espacenet/cnipa 等)。
python scripts/patent_search.py \
--queries queries.json \
-s google -c CN -n 30 -a \
--timeout 45 --retries 4 --backoff 1.8 --jitter 0.25 \
--query-sleep 2 --query-jitter 0.3 \
--min-unique-patents 10 --fail-on-low-recall \
--fail-on-empty \
--out-json prior_art.json \
--failures-json prior_art.failures.json
Step 7 召回门禁
- 若 unique patents < 10,必须由 Codex agent 重写
queries.agent.json并重新执行 Step 6-7。- 不得在召回不足时直接进入 Step 8。
python scripts/patent_fetch_claims.py \
--in prior_art.json \
--topk 10 \
--claim-sources auto \
--timeout 40 --retries 4 --backoff 1.8 --jitter 0.25 \
--sleep 2 --resume \
--out prior_art_full.json \
--cache-dir .patent_assistant/patent_cache
说明
- 自动路由支持
google/espacenet/cnipa/lens(--claim-sources auto)。- 每条文献会记录
claims_fetch_attempts(来源、URL、失败原因)。- 如果
claims_status大量失败(403/412/503 等),必须进入 Step 8B,由 Codex agent 接管完成 claims 回填。
python scripts/manual_claims_template.py \
--in prior_art.json \
--topk 10 \
--out claims_manual.json \
--out-md claims_manual_checklist.md
claims_manual_checklist.md 逐条打开专利链接,提取至少独立权利要求(建议 1-3 条)。claims_manual.json(字段:patent_number + claims_text 或 claims[])。python scripts/patent_fetch_claims.py \
--in prior_art.json \
--topk 10 \
--resume \
--manual-claims claims_manual.json \
--require-min-ok-ratio 0.3 \
--out prior_art_full.json \
--cache-dir .patent_assistant/patent_cache
Step 8 完成判定
prior_art_full.json中claims_status in {ok, ok_fallback, manual_ok}的比例应 >= 0.3;- 未达到阈值时,Codex agent 必须继续补录 claims(或向用户请求可访问资料后补录),不得直接进入 Step 9。
python scripts/novelty_matrix.py \
--profile invention_profile.json \
--prior-art-full prior_art_full.json \
--min-claims-ok-ratio 0.3 \
--fail-on-low-claims \
--out novelty_matrix.json
矩阵输出包含:
LLM 输入:
invention_profile.jsonprior_art.jsonprior_art_full.json(含 claims)novelty_matrix.jsontemplates/disclosure_template_cn_invention.mdtemplates/disclosure_structured_template.jsonreferences/06_novelty_playbook.mdreferences/07_novelty_findings_output.mdreferences/08_disclosure_output.mdLLM 必须同时输出三份文件:
novelty_findings.json(结构化新颖点结论,必须符合 schema)
references/schemas/novelty_findings.schema.jsondisclosure.json(结构化交底内容,必须符合 schema)
references/schemas/disclosure.schema.jsonmissing_info.md(若仍缺)硬性要求:
python scripts/disclosure_builder.py --in disclosure.json --out-md disclosure.md --strict
python scripts/run_report_builder.py \
--repo-meta .patent_assistant/repo_meta.json \
--queries queries.json \
--prior-art prior_art.json \
--prior-art-full prior_art_full.json \
--novelty-matrix novelty_matrix.json \
--failures prior_art.failures.json \
--out run_report.md
要求:
run_report.md 只能包含流程日志/统计信息,不得作为交底正文输入。disclosure_builder.py 严格拦截 workflow/log 词进入 disclosure.md。python scripts/docx_renderer.py --input disclosure.md --output disclosure.docx
evidence_idprior_art.json records.scripts/patent_search.py) and pass strict source integrity checks.prior_art.json source names containing manual/fallback/synthetic/mock/test are invalid.claims_source_url (direct accessible evidence link)claims_source_type in {google_patents, office_portal, pdf_copy, freepatentsonline}fpo (FreePatentsOnline) as a strict fallback, especially for US publications/grants when Google/Espacenet pages are blocked.scripts/prior_art_rerank.py on prior_art.json before claims fetching.invention_profile.json as semantic anchor; optional --agent-rerank can blend agent-scored relevance.prior_art.reranked.json and feed it into Step 8 (patent_fetch_claims).--prefer-relevance enabled so TopK claims fetching follows reranked relevance.--fail-on-low-relevance --min-topk-avg-score <X> to prevent low-quality candidates entering claims stage.