| name | nsfc-proposal |
| version | 2.24.0 |
| description | Use when drafting, restructuring, or polishing Chinese NSFC proposals (2026 template), especially when strict section-by-section gating, hypothesis-objective-content-problem consistency, literature verification via paper-search MCP, and anti-AI Chinese academic writing constraints are required. 触发词:国自然、国家自然科学基金、基金申请书、科研申请、NSFC、标书、本子、面上项目、青年基金。 |
NSFC Proposal Skill
Overview
This skill covers NSFC proposal writing and polishing from start to finish under the 2026 template. It gates each section, keeps the sections consistent with one another, verifies the literature, and keeps the academic Chinese restrained.
Use two modes:
- Write Mode: build from zero in phased gates.
- Polish Mode: import an existing draft, diagnose first, then revise section by section.
跨会话接续(每次进入/续写必做,Mandatory)
每次进入本技能或续写一个已存在的项目时,先跑 Phase 0 env_preflight 打印的那条 RESUME_CMD(python "<本技能>/scripts/session_journal.py" resume --root <project_root>),把输出的接续报告原样贴给用户,按报告末尾的握手话术跟用户对齐进度,然后再动手。用户中途插入任何临时要求,立即用 JOURNAL_LOG_CMD(<本技能>/scripts/session_journal.py log --root <R> --note "<原话>")落进 decisions_log.md,后续会话开局的 resume 会重新读出、必须遵守。新项目(无 state)resume 会提示未初始化,照常走 Phase 0。
Mode Handshake Gate (Mandatory)
Before any drafting/revision action, the assistant must ask exactly one mode-selection question and wait for the user answer:
Write Mode (from scratch)
Polish Mode (revise existing draft)
Hard rules:
- If mode is not explicitly confirmed, do not run section writing, diagnosis, citation verification, or merge commands.
- First actionable response in this skill must be the mode-selection question when mode is missing.
- If the user already explicitly states
Write Mode or Polish Mode in the opening message, do not ask again; proceed directly with the specified mode.
- After user confirms mode, record it in project state/profile and continue with that mode workflow only.
开场监工卡(每次启动必打印,Mandatory)
确认 Mode 后、开始出章节结构前,必须原样向用户打印下面这张卡(这是给非专家看的"AI 会在哪骗你"清单,每次启动都打,别省):
【开场监工卡 · 国自然标书】看住这几条,AI 最会在这翻车:
- 立意 / 创新 / 可行性是中标命门,也正是 AI 最会灌水的地方,脚本只数字数条目、管不住"有没有真东西"。这三块的每一句你都要自己读,觉得空就打回,别信"看起来很专业"。
- 诊断引擎报的字数、条目数、通过项,只代表"格式齐了",不代表"写得好"。绿灯 ≠ 能中,别把跑分当质量。
- 引用别全信:我给出的每篇文献,你随手挑几篇让我把 PMID / DOI 报给你,你自己去 PubMed / 期刊官网核一遍(防我编造、防引到已撤稿的文章)。
- 每写完一章我都会停下等你确认再往下写;我要是没停就自己连写好几章,你直接喊停,那就是跳步。
- "研究假说 → 研究目标 → 研究内容 → 关键科学问题"这条链必须对齐,我会用表格把它们逐条摆给你看,你负责检查有没有对不上、有没有断链。
- 科学问题、章节结构没经你点头,我不会开写正文,这一条有硬门禁兜底(见"结构签字落锁"),不是靠我自觉。
Core Terminology
SQ is the upstream root; H/O/RC/KSQ form the 1:1 consistency backbone derived from it.
| Symbol | Chinese | Role | Example |
|---|
| SQ | 科学问题 (Scientific Question) | Field-level open problem distilled in P1; root for H and KSQ (not part of the 1:1 chain). SQ 不持有下行映射字段,关联由 H/KSQ 的 mapped_from_sq 反向建立 | "XXX的分子机制尚不清楚" |
| H | 假说 (Hypothesis) | Causal claim derived from SQ | "A蛋白通过B通路调控C过程" |
| O | 目标 (Objective) | What you do (action-oriented) | "阐明XXX的机制" |
| RC | 研究内容 (Research Content) | Specific investigation; links to methods | "通过ChIP-seq分析A蛋白的结合位点" |
| KSQ | 关键科学问题 (Key Scientific Question) | What you answer (question-oriented), distilled from SQ | "XXX如何调控YYY?" |
Mapping constraint: H-n ↔ O-n ↔ RC-n ↔ KSQ-n (strict one-to-one, no cross-linking allowed).
SQ vs KSQ: SQ is the broad open problem stated in P1; KSQ is the focused, answerable question distilled from SQ and bound 1:1 to its H/O/RC. One SQ may seed one or more KSQ; each SQ must trace to ≥1 H and ≥1 KSQ (rule V-01).
If user asks a conceptual question about any of H/O/RC/KSQ/SQ/mapping: load references/02_核心机制.md and answer from it before continuing with workflow phases.
Inputs Required
Collect before execution:
- Project basics: title, discipline code, project type, research attribute, duration, budget.
- 🔴 科学问题属性(四选一,强制):与"研究属性"是两个独立必填字段。研究属性=分类评审的「自由探索类/目标导向类」;科学问题属性=申请书独立必填项,四类官方标准措辞如下,Phase 0 必须选定其一并写入 profile 的
science_problem_attribute:
- 鼓励探索、突出原创
- 聚焦前沿、独辟蹊径
- 需求牵引、突破瓶颈
- 共性导向、交叉融通
- Existing materials: draft files, prior work, platform/conditions, related projects.
- User constraints: word targets per section, preferred P2 sub-structure, H/O/RC/KSQ mapping count.
2026模板硬约束速查表
| 项目 | 硬限 |
|---|
| 正文总页数 | ≤30页(约18000-25000字),页数估算替代字数硬门控 |
| 中文摘要 | ≤400汉字 |
| 英文摘要 | ≤300英文词 |
| P4 其他需要说明的情况 | ≤500字 |
| P3_4 完成基金项目情况总结 | ≤500字 |
| 研究属性(分类评审) | 必选「自由探索类」或「目标导向类」二选一 |
| 科学问题属性(独立必填,≠研究属性) | 四选一:鼓励探索·突出原创 / 聚焦前沿·独辟蹊径 / 需求牵引·突破瓶颈 / 共性导向·交叉融通;Phase 0 未选定则 gate-check 阻断(failed_at=profile) |
| 伦理审查(涉人类受试者/实验动物/生物安全/人类遗传资源时) | 须在可行性分析中说明伦理审查批件或送审计划 |
Tooling Rules
Academic literature retrieval follows topic-dependent routing (Mandatory):
-
Determine field type first:
- Life science / Medicine / Clinical / Biochemistry / Pharmacology → PubMed CLI first
- CS / AI / Engineering / Physics / Interdisciplinary → paper-search MCP first (arXiv/Google Scholar)
-
PubMed CLI (life science primary): Use esearch/efetch/einfo (path ~/edirect/). Must append < /dev/null, use proxy http_proxy=http://127.0.0.1:<PROXY_PORT>.
Example: export http_proxy=http://127.0.0.1:<PROXY_PORT> && esearch -db pubmed -query "xxx" < /dev/null | efetch -format abstract
Auto-install if ~/edirect/esearch missing: sh -c "$(curl -fsSL https://ftp.ncbi.nlm.nih.gov/entrez/entrezdirect/install-edirect.sh)"
Windows: edirect does not run in PowerShell/CMD. Use WSL bash, or fall back to paper-search MCP.
-
paper-search MCP (CS/AI primary / preprints / fallback when PubMed yields no results):
Tool names: mcp__paper-search-mcp__search_pubmed, mcp__paper-search-mcp__search_arxiv, mcp__paper-search-mcp__search_biorxiv, mcp__paper-search-mcp__search_medrxiv
Do not use generic web search/fetch tools for citation evidence in proposal claims.
严禁 使用 tavily、websearch 或 openalex(pyalex),无论有无 DOI/PMID. 该禁令已脚本级强制:literature_index 条目的 search_source 字段若属上述被禁家族,citation_validator.py 触发 source_provider_forbidden 硬失败,与 DOI/PMID/标题核验同级阻断门禁。
Serial Search (MANDATORY): Execute all retrieval calls sequentially (including both PubMed CLI and paper-search MCP). Never parallelize search requests. Enforce ≥1s interval between consecutive calls.
Windows note: all python3 scripts/... commands below use python or py instead of python3 on Windows.
Non-Conflict Canon (Conflict Resolution Rules)
These rules resolve specific contradictions discovered during operation. When any instruction in SKILL.md or its references conflicts with a rule here, this section takes precedence.
Apply these resolutions when references conflict:
- No-bullet narrative applies to proposal body sections only; diagnostics/review reports may use structured lists.
- Interaction extras (reverse questioning, suggested follow-up questions, extended thinking) are optional by context, not mandatory on every response.
- Merge order is fixed: references at the end of final merged manuscript.
- P2 should not include numbered literature markers; citation numbering is restricted to P1.
(V-01 validation implementation note: SQ nodes carry no mapped_to_h field. Moved to references/02_核心机制.md §2.3.)
Source: accumulated from operation feedback; last reviewed 2026-05.
Execution Workflow
Write Mode
Follow phased gates in order:
-
Phase 0: initialize project profile, section targets, mapping cardinality.
- Env Precheck(软门禁,建项目文件前):
python3 scripts/env_preflight.py . --cli esearch,写 env_status.json,末行 PRECHECK: OK|ASK|BLOCKED。BLOCKED(Python 过低)→ 停并引导升级;ASK(缺 git/esearch 等可选工具)→ 逐项问用户是否安装并给指引,用户答"已装/不装"后才继续,后续再遇缺工具同此处理;OK → 继续。
- Git Init(叠加在 snapshot 之上):
python3 scripts/git_checkpoint.py init .。git 可用且项目根不在他人仓库内时建 git 检查点,否则静默回退 snapshot。
- 🔴 Git Checkpoint 约定(复用):此后每个 Phase 的
delegate_review verify 通过、落盘 .review_pass/PX.json 后,立即运行 python3 scripts/git_checkpoint.py commit . "[nsfc] PX done"(git 不可用自动 no-op,snapshot 仍兜底)。各 Phase DoD 的 N-GIT 项据此核查检查点是否已落。
- 🔴 必须选定「科学问题属性」四选一(四类官方措辞见 Inputs Required 节),写入 profile
science_problem_attribute。注意与「研究属性(自由探索类/目标导向类)」区分,二者是独立字段。未选定将在 Phase 7 gate-check 触发 failed_at=profile 阻断。
-
Phase 0.5: 实验设计与技术路线结构化问询(H/O/RC/KSQ mapping count 确定后、P1 撰写前的强制问询环节)
- 触发时机:Phase 0 完成 mapping count(RC 数量)确定 → Phase 0.5 → Phase 1。问询主体在主 agent 与用户对话,不写脚本。
- 静默跳过禁令:若主 agent 判断用户已在 Phase 0 自然语言中提供了实验设计细节、信息已充足,不得静默跳过,必须先用 ✓ 列表向用户回放当前已收集的设计信息(按下文 5 字段分类逐 RC 列出),并明确询问"是否需要补充或修正?是否同意以此为依据进入 Phase 1?",用户显式确认后方可跳过追问环节,但仍须落盘
data/experimental_design.json。
- 逐 RC 结构化追问(5 字段):对每个已立项的 RC(数量等于 Phase 0 mapping count),按顺序逐条追问:
- 实验/方法路径(methods):关键步骤、关键技术、关键试剂/仪器/动物模型或细胞系/样本来源。
- 预实验数据(preliminary_data):已有数据(图/表/统计数)vs 待补数据;已有数据说明出处(本课题组/合作单位/文献)。
- 可行性证据(feasibility):团队相关经验、依托平台/设备、合作单位、配套资金或前期项目支撑。
- 备选方案(alternative_plan):主路线失败时的触发条件、替代技术路线、切换代价(V-12 备选路线的实质内容,Phase 2 将直接复用)。
- 伦理审查(ethics):是否涉及人类受试者 / 实验动物 / 生物安全 / 人类遗传资源;任一涉及则说明审批状态(已获批号 / 已送审待批 / 计划送审时间节点);均不涉及则填 "N/A 不涉及"。
- 落盘:把追问结果结构化写入
data/experimental_design.json,结构如下(每个 RC 一条 entry):
{
"metadata": {"schema_version": "1.0", "collected_at": "YYYY-MM-DDTHH:MM:SS+08:00"},
"entries": [
{
"rc_id": "RC-1",
"methods": ["步骤1:...", "步骤2:..."],
"preliminary_data": "已有/待补 + 数据出处",
"feasibility": "团队/平台/合作/资金证据",
"alternative_plan": "触发条件 + 替代方案 + 切换代价",
"ethics": "涉及类型 + 审批状态 / 或 N/A 不涉及"
}
]
}
- 下游约束:Phase 2 撰写 M(研究方案与技术路线)和 Phase 3 撰写 P3_1 可行性时,必须先
Read data/experimental_design.json 作为事实依据,禁止脑补;M.alternative_plan 字段(V-12 依赖)直接来自本 JSON 的 alternative_plan 字段。
Phase 0.5 DoD(收口自检):未逐项确认通过,不得进入 Phase 1
[结构签字·强制门禁落锁] 用户在对话里明确确认「科学问题属性 + H/O/RC/KSQ 章节结构 + 实验设计(Phase 0.5 DoD ⑤)」后(且仅在此之后),运行 Phase 0 env_preflight 打印的那条 SIGNOFF_CMD(已含解析好的绝对路径)落盘签字,即 python "<本技能>/scripts/structure_signoff_gate.py" confirm --root <project_root> --note "<用户确认原话摘录>"。这一步解锁正文写作:未落签字,PreToolUse hook 会物理拦截任何对 sections/*.md 的写入(这是防跳步的硬门,不是提示词纪律)。该 hook 由 Phase 0 env_preflight.py 开工时经本技能 scripts/install_gate_hook.py(vendored)自动安装并校验,它先把门禁四件套部署到 ~/.claude/academic-gate/(稳定位置,不随技能目录增删而动),再让 settings.json 的 hook 指向那里,单独分发的技能也能自装(含备份/回滚),状态 active 即在岗;若报 degraded/error 或提示降级,需人工留意其拦截可能失效。若后续回修科学问题/章节结构,改完让用户重新确认并重跑本命令覆盖签字。⚠️ 严禁在用户未确认时自行运行 confirm,那等于伪造用户签字。
🔴 委托盲检总则(适用下列 Phase 1–7 每一个 DoD 闸口,Mandatory): 以下每个闸口一律遵守同一条铁律。每个 Phase 落盘前,DoD 清单必须委托一个独立上下文的 subagent 盲检(Claude Code 用 academic-blind-reviewer,其他平台派通用 subagent),不给它本稿的写作上下文;主 agent 不得自评打勾。各闸口只列本 Phase 专属的 <gate>/<files>/<section> 参数,套用下方三步命令模板执行;盲检的角色与纪律统一遵此总则,不再逐处复述。降级告警:若判到科学意义/创新/可行性等决定成败的维度,而环境派不出真正独立的 subagent,绝不能同一 AI 编一份全 pass 的盲检 JSON 冒充(那几个维度就裸奔了)。此时须告诉用户「本环境盲检不可靠,请你亲自复核」,把判断交回用户,绝不自问自答冒充盲检。
三步命令模板(各 Phase 只改 <gate>/<files>/<section>,其余照抄;dod_checklist.json gate=<gate> 是该 Phase DoD 判据的唯一真源):
-
pack:python scripts/delegate_review.py pack --checklist references/dod_checklist.json --gate <gate> --files <files>
-
派一个独立 subagent(Claude Code 用 academic-blind-reviewer,其他平台派通用 subagent),任务包原样给它、不给写作上下文,要求按任务包返回 JSON 数组。
-
verify:python scripts/delegate_review.py verify --checklist references/dod_checklist.json --gate <gate> --return <subagent返回.json> --section <section> --root <项目根>;退出码非 0(任一缺项/fail/无证据)= fail-closed,据证据修复后重跑,未过不得声明完成、不得进入下一 Phase/merge。verify 通过落盘 .review_pass/<section>.json,下一 Phase 的 prewrite_gate.py 跨 Phase 时硬校验它(缺失即拒绝开写)。
<section>/--root 仅对门控下游 prewrite 的 Phase(P1/P2/P3/P7)给出;P4/P5/P6 不 gate 下游,verify 只带 --return,省略 --section/--root。
-
Phase 1: write P1 with full citation pipeline and verification.
-
🔴 开写前置闸门 (Mandatory,脚本硬拦截):开写前先跑 python3 scripts/prewrite_gate.py --section P1 --root .,exit≠0 禁止开写(硬检查上一节完成/consistency_map 就位/占位符清零;上一节盲检结果(.review_pass/<上一节>.json)缺失即 prewrite_gate 硬拦 exit 1,禁止开写;必须先跑 delegate_review verify --section <上一节> 落盘通过标记,此校验仅跨 Phase 边界生效,同 Phase 子节 N/A)。P1 为首节,上一节检查自动放行。
-
每节先跑 python scripts/state_manager.py --root . write-cycle --section P1(逐节预算/上下文注入的预写门控,完整参数见 references/08);不得跳过直接硬写。
-
🟢 P1 正文由撰写子代理盲写(主会话调度,堵上下文爆 + 焊死编号权):prewrite_gate 通过后,P1 正文不再由主会话直接手写,改走下面这条流水线(前后所有门禁一个字不改,照跑;结构签字 hook 逻辑不动——子代理只产返回文件,主会话在签字后才落盘 sections/*.md):
- 先派备料子代理(P1 承载引文,一律派):
python scripts/delegate_write.py pack-prep --section P1 --root . → .prep_task_P1.json;把 references/prep_subagent_prompt.md + 任务包交给全新一次性子代理,让它对承重论点起草「观点↔证据」草案 .claim_evidence_draft_P1.json(user_confirmed 全 false,evidence_quote 只能引账本 abstract 子串,提议 claim_kind)。P2–P7 一般无编号引文(规则4)→ 走白名单、主会话就地写、不派备料(见下条)。
- 主会话核证 + 确认:
CITATION_CHECK_CMD(含 --check-quote-substring 防伪)读草案 + 逐条 AskUserQuestion 确认承重句(含 claim_kind),确认行由主会话并入 claim_evidence.json(承重核证细则仍见下方「承重论点引文核证」,此处只是把起草那半交给备料子代理)。
- 组撰写任务包:
python scripts/delegate_write.py pack-write --section P1 --root . → .write_task_P1.json(本节 H/O/RC/KSQ + 承重方向 + 已核证 certified_claims + used_in_sections 含 P1 切给本节的文献全条 + 缩写表 + 风格禁项嵌入;全篇大纲/全库文献只给 refs 路径)。承重句未完成人工核证 → 脚本 exit 2 拒绝出包。
- 派撰写子代理:
references/section_writer_prompt.md(角色 prompt + 数据/指令隔离声明)+ 任务包路径交给全新一次性子代理盲写。它只写 .write_return_P1.json,P1 正文引用只写 [@key](绝不写裸数字 [5]),承重句只准挂内嵌 certified_claims 里的 ref_key,禁写任何账本。
- 机械校验返回:
python scripts/delegate_write.py verify-write --section P1 --root .(无裸数字引用 / [@key] 可解析 / new_refs 带 DOI 或 PMID / section_id 一致),exit≠0 打回子代理重写、不落盘。
- new_refs 先核验再并表(账本零污染):对返回
new_refs 先 citation_validator.py verify-entry/citation_guard --require-mcp 核真伪,通过的才 python scripts/citation_renumber.py merge-refs --root . --return .write_return_P1.json 去重并表(DOI→PMID→归一标题三档,灰区标疑似交人工),新条目挂 used_in_sections=["P1_立项依据"],记 new:slug→真id 映射。核验失败的直接丢弃、打回子代理改写该处引用。
- 落盘 P1 + 认键翻号:主会话(已签字)把返回
markdown 落盘 sections/P1_立项依据.md;正文 [@key] 是长期真源,[N] 是合并派生——merge 前跑 python scripts/citation_renumber.py renumber --root . --check(exit≠0 若未并表 new: 键 / id 冲突 / 未知键)通过后再 --in-place 把 [@key] 统一翻成连续 [N](按 P1 正文首现序分配,对齐 04 §4.4 矩阵「REF 顺序=P1 首次引用顺序」),随后 citation_validator.py matrix-check 校验三向一致。
nsfc 适配说明(读前必看):delegate_write.py(薄封装 import 共享 delegate_write_core.py)的 pack/verify 假设项目根有 literature_index.json(list)+ project_state.json 含 sections[].section_id 大纲。nsfc 账本是 data/literature_index.json(dict)+ 无 sections 大纲,故运行 pack-write/verify-write 前主会话须先把二者投影到共享核心期望的形态(只读投影,不改共享核心)。认键翻号 citation_renumber.py(本家 local)与 prewrite 并表核验直接读 nsfc 原生 data/ 布局,无需投影。
-
Input: confirmed project profile (title, discipline, H/O/RC/KSQ mapping counts).
-
Output: sections/P1_立项依据.md + data/literature_index.json (all P1 citations verified) + updated context_memory.md.
Citation Type by Context for P1 (立项依据,MANDATORY): specific mechanistic/experimental claims (具体科学论点) must cite Original Articles as primary evidence; clinical evidence cites Clinical Trials at the same priority; preprints are last-resort, labeled [Preprint], used only when no peer-reviewed equivalent exists. Full context-to-type mapping and the role taxonomy (gap_evidence / method_support / prior_work / comparison / background) live in references/04_文献管理.md.
【P4·文献抽验·用户必做】 立项依据里引的文献,用户应抽 3 篇让 AI 报 PMID/DOI 自己去核。撤稿的、编的,AI 不主动说你就不知道。⚠️ 检索工具不可用时 AI 必须明确告知,绝不许凭记忆编文献或就地填假 verified/DOI。
🔴 承重论点引文核证(Mandatory,接进本节文献确认节点): literature_index(引文,key_finding 是 AI 自填、不可作证)与 consistency_map(SQ↔H↔O↔KSQ 论证链,本身不挂引文)互不连接。P1 落盘前必须把二者打通,用检索到的真 abstract 判「立项依据的关键论点是否真被它挂的引文支撑」:
- 挑承重论点句:从 P1 里圈出决定成败的关键论断(关键因果 / 机制 / 研究缺口 / 「前人未解决 X」这类),标
is_load_bearing=true;纯背景陈述标 false(只批量呈现、不逐条阻断)。
- 取真摘要判支撑。对每条承重论点↔其引用,走 Tooling Rules 的检索路径(PubMed CLI / paper-search MCP,取摘要那半由工作流subagent执行)拿该文献检索到的真实 abstract(不是
literature_index.key_finding),判 verdict∈support/weak/contradict/unknown 并从摘要摘一句 evidence_quote。只对缓存里没有的 (文献,论点) 组合做这一步反向验证。已被前一批核证过的同篇 abstract、以及完全同 ref_id+同论点句且已人工确认的 verdict,脚本会自动回填,无需再取摘要、无需再逐条确认。故这一步只做新 (文献,论点) 对。
- 写
claim_evidence.json(项目根,与 CITATION_CHECK_CMD 的 --root . 同目录)。list,每条 {section:"P1_立项依据", claim_sentence, is_load_bearing, ref_id, retrieved_abstract, verdict, evidence_quote, user_confirmed}。已在 ref_evidence_cache.json 命中的文献可留 retrieved_abstract 为空,脚本按 ref_id 回填该文献的真 abstract;同篇不同论点仍会独立判定,缓存只补文献全局事实,不替新论点伪造 verdict。
- 跑核证。
CITATION_CHECK_CMD(Phase 0 env_preflight 已打印绝对路径,即 python "<本技能>/scripts/citation_claim_check.py" --root .)。脚本自动读写 ref_evidence_cache.json(默认在项目根,与 --root 同目录),落盘已验 abstract 与已确认承重 verdict 供下一批复用,AI 不必手动记录这些字段。承重句凡 contradict/unknown、缺 retrieved_abstract、或 user_confirmed≠true → fail-closed(exit 2)硬拦,禁止照此下笔;缓存缺失或损坏一律当空处理、回落全量核验,门禁强度不变。
- 只有新承重 (文献,论点) 对需逐条 AskUserQuestion 确认。对缓存未命中的承重论点句把「论点 + 引文 + verdict + 摘要证据句」摆给用户,逐条
AskUserQuestion 请其确认后置 user_confirmed=true 再重跑;同 ref_id+同论点句已在前一批确认过的,脚本自动回填 user_confirmed=true,不再重复问。被判 contradict 的必须先改引文或改论点(不得靠确认放行),改完重跑至 exit 0。背景句在核证矩阵表里批量呈现供用户扫一眼即可,不逐条阻断。
Phase 1 DoD(收口自检):未逐项确认通过,不得向用户声明 P1 完成
🔴 进入下一部分前置闸口(适用所有 Phase):本部分 delegate_review verify 必须 exit 0(含结构完整性),否则不得进入下一部分撰写。写完即检,不过不进。
🔴 修复 3 次仍不过 → 回滚兜底:某部分据盲检证据修复重跑 3 次仍 fail,停止盲目重写,提示用户回滚到上一检查点(git 可用 git checkout <sha> -- <文件>;否则 state_manager.py rollback)后重写。
🔴 委托盲检(遵上方总则的三步命令模板,主 agent 不得自评):<gate>=p1-dod,<files>=sections/P1_立项依据.md,<section>=P1。P1 自评易漏项、易默认通过,务必真派独立 subagent、不给写作上下文,未过不得声明完成。
【P4·盲检降级告警】 ⚠️ 适用上方总则的降级告警:本闸口尤其针对 D-01/D-02/D-04(科学意义/创新/可行性)这三个决定成败的维度,环境派不出真正独立的 subagent 时按总则交回用户亲自复核立意/创新是否够中标,绝不自问自答编一份全 pass 冒充。
本 Phase 完整 DoD 判据(全部核查项 + 脚本命令)以 references/dod_checklist.json gate=p1-dod 为唯一真源:盲检subagent据此逐项核、能脚本核的先跑脚本,退出码非 0 即 fail-closed。该 gate 含引文对应/citation_guard/占位符清零/去AI/字数/一致性/撤稿检测/承重论点核证等脚本项,及 N52 结构完整性与 N59-N62(科学事实正确、立项论证逻辑、创新性质量、科学问题凝练质量)四项盲检质量核。此处不再内联清单,避免与真源 drift。
-
Phase 2: write P2 研究内容(contains all sub-content: H/O/RC/KSQ, methods, innovations, annual plan).
- 🔴 开写前置闸门 (Mandatory,脚本硬拦截):开写前先跑
python3 scripts/prewrite_gate.py --section P2 --root .,exit≠0 禁止开写(硬检查 P1 完成、consistency_map 就位、data/experimental_design.json entries 非空、占位符清零;P2←P1 跨 Phase,缺 .review_pass/P1.json 盲检标记即硬拦 exit 1,须先跑 delegate_review verify --section P1 落盘;P2 正是产出 M 的阶段,M 尚空只降级 warning)。
- 每节先跑
python scripts/state_manager.py --root . write-cycle --section P2(逐节预算/上下文注入的预写门控,完整参数见 references/08);不得跳过直接硬写。
- 🟢 P2–P7 走白名单:主会话就地写、不派备料:规则4 下这些节
used_in_sections 过滤后本节零编号引文(P2 明令无文献编号),派备料只得空草案——故 P2–P7 由主会话直接写正文、不派备料子代理;仅当某 P 节确经 used_in_sections 分到编号引文时才按 P1 那条流水线派(罕见)。撰写编排的引文/承重机制只对 P1 生效。
- 撰写 M(研究方案与技术路线)前必须
Read data/experimental_design.json 作为事实依据,禁止脑补;每个 M 的 alternative_plan(V-12 字段)直接来自该 JSON 对应 RC 的 alternative_plan。
- Input: verified P1; H/O/RC/KSQ mapping counts from Phase 0; consistency_map.json with SQ entries;
data/experimental_design.json 全量 RC 设计。
- consistency_map 条目结构(mapped_from_sq / mapped_to_objective / supports_method 等字段名)见
references/02_核心机制.md §2.2,按其字段名产出避免 validate 报错。
- Output:
sections/P2_研究内容.md + updated data/consistency_map.json (H→O→RC→KSQ→M→IN all links validated) + sections/figure_prompts.md.
- V 规则分层说明(机制级防假通过): Phase 2 门控统一用
python scripts/consistency_mapper.py --path data/consistency_map.json validate --phase 2,该参数只计算且只报 V-01/V-02/V-03/V-04/V-05/V-08(H/O/RC/KSQ/IN 结构链路),从机制上不输出 V-06/V-12 的结论,无需靠自觉跳读全量。V-10(无孤立条目,含 M 被 F 覆盖检查)同 V-06/V-07 依赖 F 字段,Phase 2 时 F 尚空必假阳,故延迟至 Phase 7。V-06(M→F)、V-07(F来源)、V-09(预算追溯)、V-11(代表作匹配)依赖 F/预算字段,分别在 Phase 3/Phase 5 填齐后才有意义,强制点在 Phase 7 gate-check;V-12 只依赖 M 的 alternative_plan 字段,该字段在 Phase 3 Step 3.1 撰写,自 Phase 3 起进入 --phase 3 集合并为 ERROR 硬门控(gate-check 也会复验)。
- Sub-content order: 研究假说(H) → 研究目标(O) → 研究内容(RC) → 关键科学问题(KSQ) → 研究方案与技术路线(M) → 特色与创新之处(IN) → 年度研究计划.
- No literature numbers anywhere in P2. Paragraph narrative throughout; annual plan may use year-based paragraphs.
- Every M must trace back to a specific RC; every IN must trace to RC and M.
- Figure Prompt Generation(AI绘图提示词): Phase 2 完成后,为技术路线图等必要图表生成绘图提示词,保存至
sections/figure_prompts.md。模板与生成规则见 references/10_Figure_Prompt规范.md。
Phase 2 DoD(收口自检):未逐项确认通过,不得向用户声明 P2 完成
🔴 委托盲检(遵上方总则的三步命令模板,主 agent 不得自评):<gate>=p2-dod,<files>=sections/P2_研究内容.md,<section>=P2。
本 Phase 完整 DoD 判据(全部核查项 + 脚本命令)以 references/dod_checklist.json gate=p2-dod 为唯一真源:盲检subagent据此逐项核、能脚本核的先跑脚本,退出码非 0 即 fail-closed。该 gate 含 H/O/RC/KSQ 1:1 映射、M/IN 可追溯、P2 无文献编号、占位符清零、去AI、字数、V 规则分层、预期成果小节、figure_prompts 等,及 N53 结构完整性、N67 四要素一致性盲检、N65 常识合理性(🟡软报告不阻断)。此处不再内联清单,避免与真源 drift。
-
Phase 3: write P3 研究基础(4 sub-files).
- 🔴 开写前置闸门 (Mandatory,脚本硬拦截):每个子节开写前先跑
python3 scripts/prewrite_gate.py --section P3_1 --root .(其余子节同理 P3_2/P3_3/P3_4),exit≠0 禁止开写(硬检查上一节完成、consistency_map 含 M、占位符清零;P3_1 额外要求 data/experimental_design.json 非空;盲检按 Phase 粒度:P3_1←P2 跨 Phase,缺 .review_pass/P2.json 硬拦 exit 1;P3_2/P3_3/P3_4 同属 P3 一次性盲检,同 Phase N/A 不拦)。
- 每节先跑
python scripts/state_manager.py --root . write-cycle --section P3_1(其余子节同理 P3_2/P3_3/P3_4;逐节预算/上下文注入的预写门控,完整参数见 references/08);不得跳过直接硬写。
- Input: P2 confirmed; team CV, platform data, and prior publications from Phase 0 profile.
- Output:
sections/P3_1_研究基础与可行性分析.md (prior work + feasibility evidence per M + risk mitigation)
sections/P3_2_工作条件.md (equipment, facilities, missing conditions and remedies)
sections/P3_3_正在承担的相关项目.md (ongoing projects; explain overlap/difference from this project)
sections/P3_4_完成基金项目情况.md (completed grants summary ≤500字 + deliverables list)
- Each M in consistency_map must have at least one feasibility entry (F) sourced from P3_1 or P3_2.
- 伦理审查(涉人类受试者/实验动物/生物安全/人类遗传资源时为硬项): P3_1 可行性分析须说明已获或计划申请的伦理审查批件(如医学伦理委员会、实验动物福利伦理、生物安全审批、人类遗传资源采集/保藏/利用审批),尚未取得的注明送审计划与时间节点。不涉及上述情形则无需展开。
- P3_3 and P3_4 may use list format (tables allowed).
Phase 3 DoD(收口自检):未逐项确认通过,不得向用户声明 P3 完成
🔴 委托盲检(遵上方总则的三步命令模板,主 agent 不得自评):<gate>=p3-dod,<files>=sections/P3_1_研究基础与可行性分析.md sections/P3_2_工作条件.md sections/P3_3_正在承担的相关项目.md sections/P3_4_完成基金项目情况.md,<section>=P3_1。落盘的 .review_pass/P3_1.json 代表 P3 整体盲检;P3_2/P3_3/P3_4 同 Phase 内不单独硬校验。
本 Phase 完整 DoD 判据(全部核查项 + 脚本命令)以 references/dod_checklist.json gate=p3-dod 为唯一真源:盲检subagent据此逐项核、能脚本核的先跑脚本,退出码非 0 即 fail-closed。该 gate 含四子文件齐全、M 可行性覆盖(V-06)、P3_4 字数上限、伦理审查说明、占位符清零、去AI、一致性未引入新矛盾、代表作匹配(V-11),及 N54 结构完整性、N64 可行性实质盲检。此处不再内联清单,避免与真源 drift。
-
Phase 4: write P4 其他需要说明的情况(≤500字).
- 每节先跑
python scripts/state_manager.py --root . write-cycle --section P4(逐节预算/上下文注入的预写门控,完整参数见 references/08);不得跳过直接硬写。
- Input: P3 confirmed.
- Output:
sections/P4_其他需要说明的情况.md.
- Cover: concurrent grant applications, senior PI prior grants, postdoc status, AI usage declaration, ethics/biosafety/human-genetic-resource approvals (若涉及,与 P3_1 伦理说明呼应), any other required disclosures.
Phase 4 DoD(收口自检):未逐项确认通过,不得向用户声明 P4 完成
🔴 委托盲检(遵上方总则的三步命令模板,主 agent 不得自评):<gate>=p4-dod,<files>=sections/P4_其他需要说明的情况.md;本 Phase verify 不带 --section/--root。
本 Phase 完整 DoD 判据(全部核查项 + 脚本命令)以 references/dod_checklist.json gate=p4-dod 为唯一真源:盲检subagent据此逐项核、能脚本核的先跑脚本,退出码非 0 即 fail-closed。该 gate 含字数上限、伦理说明呼应、AI 使用声明、占位符清零、去AI,及 N55 结构完整性。此处不再内联清单,避免与真源 drift。
-
Phase 5: write 预算说明书(B1-B3).
- Input: P2 confirmed (M entries define budget items); project profile (budget_total, duration).
- Output:
sections/B1_预算说明_直接费用.md (equipment; materials; tests; travel/conference; publications; labor; consulting; three-line tables where required)
sections/B2_预算说明_合作外拨.md (co-institution allocation, or "无")
sections/B3_预算说明_其他来源.md (other funding sources)
- Budget total must equal profile
budget_total; each major budget item traces to an M entry.
Phase 5 DoD(收口自检):未逐项确认通过,不得向用户声明 P5/预算完成
🔴 委托盲检(遵上方总则的三步命令模板,主 agent 不得自评):<gate>=p5-dod,<files>=sections/B1_预算说明_直接费用.md sections/B2_预算说明_合作外拨.md sections/B3_预算说明_其他来源.md;本 Phase verify 不带 --section/--root。
本 Phase 完整 DoD 判据(全部核查项 + 脚本命令)以 references/dod_checklist.json gate=p5-dod 为唯一真源:盲检subagent据此逐项核、能脚本核的先跑脚本,退出码非 0 即 fail-closed。该 gate 含三子文件齐全、预算总额核算、预算条目可追溯(V-09)、直接费用类别完整、占位符清零,及 N56 结构完整性。此处不再内联清单,避免与真源 drift。
-
Phase 6: write 中英文摘要(abstract-last, based on full draft).
- Input: all sections P1–P4 confirmed; run
python scripts/state_manager.py --root . load --global for full-text summary.
- Output:
sections/00_摘要_中文.md (≤400汉字) + sections/00_摘要_英文.md (≤300英文词).
- Keywords must align with
consistency_map.keywords_trace.
Phase 6 DoD(收口自检):未逐项确认通过,不得向用户声明摘要完成
🔴 委托盲检(遵上方总则的三步命令模板,主 agent 不得自评):<gate>=p6-dod,<files>=sections/00_摘要_中文.md sections/00_摘要_英文.md;本 Phase verify 不带 --section/--root。
本 Phase 完整 DoD 判据(全部核查项 + 脚本命令)以 references/dod_checklist.json gate=p6-dod 为唯一真源:盲检subagent据此逐项核、能脚本核的先跑脚本,退出码非 0 即 fail-closed。该 gate 含中/英文摘要字数、关键词吻合、摘要 H/O/RC/KSQ 一致、占位符清零、去AI,及 N57 结构完整性。此处不再内联清单,避免与真源 drift。
-
Phase 7: 全文自审与终稿 + merge.
- Input: all sections (00, B1-B3, P1-P4, REF) confirmed.
- Run
diagnosis_engine.py full-review and consistency_mapper.py validate (完整参数见 Script Entry Points); fix all ERROR-level issues.
- Run
python scripts/word_counter.py summary sections and python scripts/state_manager.py --root . page-estimate --sections-dir sections; if >30 pages, trim specific locations.
- Run
humanizer_zh.py scan-all before final output.
- Output:
output/申请书_合并.md (merge order: 00摘要 → B1-B3预算 → P1 → P2 → P3_1~P3_4 → P4 → REF).
Phase 7 DoD(收口自检):未逐项确认通过,不得向用户声明全文终稿完成
🔴 委托盲检(遵上方总则的三步命令模板,主 agent 不得自评):merge 前必检。<gate>=p7-dod,<files>=sections/P1_立项依据.md sections/P2_研究内容.md sections/P3_1_研究基础与可行性分析.md sections/P4_其他需要说明的情况.md sections/00_摘要_中文.md;本 Phase 为终审、无下游 prewrite,verify 不带 --section/--root。未过不得声明完成、不得 merge。
本 Phase 完整 DoD 判据(全部核查项 + 脚本命令)以 references/dod_checklist.json gate=p7-dod 为唯一真源:盲检subagent据此逐项核、能脚本核的先跑脚本,退出码非 0 即 fail-closed。该 gate 含 diagnosis_engine 无 ERROR、V-01~V-12 全量验证、gate-check --require-mcp、页数上限、去AI scan-all(halfwidth_punct_in_cn 中文句内半角标点、english_misspelling 英文铁错拼均为 ERROR 级硬阻断,判据见 JSON N47)、全文占位符清零、V-11 代表作、V-12 备选路线、合并顺序,及 N58 结构完整性、N66 上下标裸写软提醒。此处不再内联清单,避免与真源 drift。
At each phase:
- snapshot
- sync required state files
- halt for user confirmation
🔴 DoD 停(适用所有 Phase,Mandatory): 每个 Phase 的 delegate_review verify 盲检 exit 0 通过后,不得径直进入下一 Phase。必须先把该 Phase 的 DoD 逐项结论(每项 pass/fail + 盲检返回的证据摘录,含软项 soft_flags)摆成清单给用户看,然后 HALT 明确等用户确认「本 Phase 通过、可进入下一 Phase」。用户未确认前不开写下一 Phase。若盲检环境派不出独立subagent(见各 Phase【P4·盲检降级告警】),一并如实告知用户由其亲自复核。
Polish Mode
- Import draft and split into atomic section files by original heading hierarchy.
- Fallback: if heading hierarchy is ambiguous or absent, present detected section list to user for manual confirmation before splitting.
- Generate strict review report first (
polish_review_report).
- Fallback: if
diagnosis_engine.py fails, output a manual checklist covering: consistency / citation / writing style / format/length dimensions.
- Agree priority with user (rewrite vs polish vs keep).
- Hard block: do not proceed to step 4 until user explicitly confirms priority order per section or sets a global default. Accept responses like "rewrite P1, polish P2, keep P3".
- Revise section by section following issue order:
- academic design/hypothesis
- consistency
- writing style
- format/length
- Run global consistency repair and full review.
- Merge final output.
State and Artifacts
Maintain and sync after each section edit:
data/consistency_map.json
data/literature_index.json
data/mcp_literature_cache.json
data/manual_review_queue.json
context_memory.md
project_state.json
history_log.json
Any missing sync blocks phase progression.
State Corruption Fallback: If any required state file is missing or unparseable (JSON decode error), run python scripts/state_manager.py --root . sync-all --auto-fix to restore defaults. (init --repair does not exist; sync-all --auto-fix is the correct repair command.) Do not proceed without valid state files.
Mandatory Field Contracts (Hidden Trip-Wires)
The following fields are silently required by scripts. Missing them causes hard failures that are not obvious from error messages alone.
data/mcp_literature_cache.json:MCP 缓存条目必填字段:
每条缓存记录必须包含时间戳字段 verified_at 或 checked_at(二选一即可,_is_mcp_fresh 按此顺序查找)。使用 retrieved_at 或其他名称时脚本视为时间戳缺失,触发 mcp_timestamp_missing 硬失败。
最小合规样例:
{
"metadata": {"schema_version": "1.0"},
"entries": [
{
"doi": "10.1234/example",
"pmid": "12345678",
"title": "Example Paper Title",
"verified_at": "2026-06-01T12:00:00+00:00"
}
]
}
data/literature_index.json:文献索引条目必填字段:
凡 "P1_立项依据" 在 used_in_sections 中的条目,若 key_finding 字段为空或缺失,_context_check 直接返回 False,触发 context_mismatch 软失败并降低 confidence_score。
最小合规条目:
{
"ref_number": 1,
"title": "Example Paper Title",
"doi": "10.1234/example",
"pmid": "12345678",
"used_in_sections": ["P1_立项依据"],
"key_finding": "该研究发现X蛋白通过Y通路调控Z过程(主要数据点)",
"is_recent_5yr": true,
"is_cn_journal": false
}
字段名速查:
| 字段 | 所在文件 | 若错用 | 触发失败类型 |
|---|
verified_at 或 checked_at | mcp_literature_cache.json 每条记录 | 写成 retrieved_at | mcp_timestamp_missing(HARD) |
key_finding | literature_index.json 每条 P1 引用条目 | 字段为空/缺失 | context_mismatch(SOFT) |
search_source | literature_index.json 每条 | 填 tavily/websearch/openalex/pyalex | source_provider_forbidden(HARD) |
Quality Gates
Block progression when any of the following fails:
- ERROR-level consistency rules.
- Unverified references in P1 citation set.
- Citation-index-reference matrix mismatch.
- Any D-grade in global review dimensions.
- More than 3 C-grade dimensions in global review.
- Page estimate beyond configured hard limit.
Use atomic gate command for final checks:
python scripts/state_manager.py --root . gate-check --sections-dir sections --index data/literature_index.json --p1 sections/P1_立项依据.md --ref sections/REF_参考文献.md --mcp-cache data/mcp_literature_cache.json --mcp-ttl-days 30 --require-mcp
❌ 反例黑名单(Anti-Patterns,门控人读版总览)
- ❌ 把「科学问题属性」当成「研究属性」填,或四类官方措辞(鼓励探索·突出原创/聚焦前沿·独辟蹊径/需求牵引·突破瓶颈/共性导向·交叉融通)未在 Phase 0 选定写入 profile,会触发 gate-check
failed_at=profile 阻断。
- ❌ 跳过 Mode Handshake,未确认 Write Mode 或 Polish Mode 就直接开写、做诊断或跑文献核验。
- ❌ H/O/RC/KSQ 不做严格 1:1 对应,出现交叉映射、数量不等或某个 SQ 没有对应的 H 与 KSQ(违反 V-01/V-02)。
- ❌ 把研究目标写成问题、把关键科学问题写成动作,混淆“做什么”(O)与“回答什么”(KSQ)。
- ❌ 创新点写成空话(“首次系统研究”“开创性”“革命性”),不追溯到具体 RC 和 M,无技术/方法/理论突破的实证(违反 V-05/FC-05)。
- ❌ 给每个 M 留空 alternative_plan,或备选方案只写“调整参数”而无触发条件/替代方案/切换代价(违反 V-12,阻断 Phase 3)。
- ❌ 可行性靠自夸撑场,每个方法 M 找不到来自 P3_1/P3_2 的可行性证据 F,预实验或代表作与 H/RC 方向对不上(违反 V-06/V-11)。
- ❌ 虚构或不核验引用,PMID/DOI/标题不反查、跳过撤稿检查,或带着
verified=false 的文献进入 Phase 2。
- ❌ 用 tavily、websearch、openalex/pyalex、webfetch 等通用工具检索文献证据,而非 PubMed CLI 或 paper-search MCP。
- ❌ 并行发起检索请求,未串行执行、未保证连续调用间隔 ≥1 秒。
- ❌ 在 P2 研究内容里使用文献编号引用 [n],或把编号引用用在 P1 之外的部分。
- ❌ 正文用项目符号或编号列表展开论述,而非段落式叙事(年度计划、P3_3/P3_4 清单、预算三线表是仅有的例外)。
- ❌ 使用禁用句式与修辞:“不是…而是…”“不仅…而且…”“值得注意的是”“至关重要”“综上所述”、排比、比喻、反问、夸张。
- ❌ 留下装饰性破折号、scare quotes、解释性冒号,或定语从句嵌套超 2 层(humanizer_zh 报 ERROR)。中文单句超 50 字为
rhythm-check 软提醒(机制类严密长句已豁免、不阻断),非机制类单句超 50 字须拆分。
- ❌ 超篇幅:正文 >30 页、中文摘要 >400 字、英文摘要 >300 词、P4 或 P3_4 >500 字。
- ❌ 在任一 Phase 不跑委托盲检(或降级独立重核),主 agent 写完就自评打勾、verify 未 exit 0 就声明完成或执行 merge。
Failure handling playbook:
failed_at=profile: 科学问题属性未选定或取值非四类官方措辞之一。回到 Phase 0 与用户确认四选一,写入 profile science_problem_attribute(python scripts/state_manager.py --root . profile --json '{"science_problem_attribute":"聚焦前沿、独辟蹊径"}'),再 re-run gate-check。
failed_at=sync: run sync-all --auto-fix, then re-run gate-check.
failed_at=citation: repair index/cache, re-run verify-all --require-mcp, then gate-check.
failed_at=literature_total: 文献总量硬门未过(literature_index.metadata.total_count < citation_targets.min_total,默认30)。补充检索录入到 ≥30 篇,再 re-run gate-check。近5年≥20、中文≥5、P1段引用≥20为软 warn,见报告 literature.warnings,不阻断但建议补足。
failed_at=matrix: run matrix-check and reorder, then gate-check.
failed_at=review: fix D/C dimensions from review report, then gate-check.
Dual-Track Citation Verification: Provide MCP retrieval cache in data/mcp_literature_cache.json and run online validation without --offline whenever network is available. Final gate must enforce --require-mcp.
References
Load only what is needed:
references/00_设计方案_总览.md
references/01_目录结构与配置.md
references/02_核心机制.md
references/03_写作规范与反AI.md
references/04_文献管理.md
references/05_Write_Mode流程.md
references/06_Polish_Mode流程.md
references/07_自审与评审模块.md
references/08_脚本清单与合并规则.md
references/09_交互规范与回复模板.md
references/10_Figure_Prompt规范.md
references/section_writer_prompt.md(P1 撰写子代理角色 prompt + 数据/指令隔离声明)
references/prep_subagent_prompt.md(P1 承重核证备料子代理角色 prompt)
Output Contract
Deliverables should include:
- section files under
sections/ (canonical filenames):
P1_立项依据.md, P2_研究内容.md(含独立预期成果小节:论文/专利/人才培养目标),
P3_1_研究基础与可行性分析.md, P3_2_工作条件.md, P3_3_正在承担的相关项目.md, P3_4_完成基金项目情况.md,
P4_其他需要说明的情况.md,
B1_预算说明_直接费用.md, B2_预算说明_合作外拨.md, B3_预算说明_其他来源.md,
00_摘要_中文.md, 00_摘要_英文.md, REF_参考文献.md
- updated state and data files
- review reports in
data/
- merged manuscript in
output/ (md/docx if requested)
When reporting to user, state:
- what was changed
- which gate passed/failed
- what is blocked and exact unblock action
Script Entry Points
正文仅保留5条最常用核心命令;write-cycle 各节 token 预算、verify-entry / matrix-check / validate-one / polish-review / validate-order / 阶段稿 merge / word_counter 等完整调用与子命令清单见 references/08_脚本清单与合并规则.md。
- init:
python scripts/state_manager.py --root . init
- sync-all (repair):
python scripts/state_manager.py --root . sync-all --auto-fix
- gate-check (full, requires MCP):
python scripts/state_manager.py --root . gate-check --sections-dir sections --index data/literature_index.json --p1 sections/P1_立项依据.md --ref sections/REF_参考文献.md --mcp-cache data/mcp_literature_cache.json --mcp-ttl-days 30 --require-mcp
- merge:
python scripts/section_merger.py merge --sections-dir sections --output output/申请书_合并.md
- full-review:
python scripts/diagnosis_engine.py full-review --sections-dir sections --consistency data/consistency_map.json --index data/literature_index.json --p1 sections/P1_立项依据.md --ref sections/REF_参考文献.md --output data/diagnosis_report.json
Phase 7 引用的 consistency_mapper.py validate 完整形式:python scripts/consistency_mapper.py --path data/consistency_map.json validate。
其余脚本(write-cycle 逐节预算、citation_validator verify-all/verify-entry/matrix-check、humanizer_zh scan-all、load 变体、word_counter summary)的完整 flag 见 references/08。
Regression Tests
测试位于 scripts/(test_delegate_review / test_format_contract / test_literature_gate / test_prewrite_gate)与 _shared/,统一入口 python3 _shared/run_all_tests.py --skill nsfc-proposal(仓库完整克隆下,当前 4/4 通过)。
test-prompts.json 仅验证触发与门禁交互,未被上述 suite 覆盖的脚本逻辑需人工抽查。
Figure Prompt 触发规则
- 技术路线图:Phase 2 必须生成;研究框架图:立项依据含多层机制链或多要素关系时 Phase 1 生成;预期结果用占位符
[Preliminary Data Fig N]。
- 统一色板(深蓝=主线索,绿色=创新点,橙色=预期产出),每张图须映射到 consistency_map 中至少一个 RC。
- 完整提示词模板与生成规则见
references/10_Figure_Prompt规范.md。
发现 AI 跳步/灌水了怎么办(用户自救)
怀疑 AI 偷跑门禁、编文献或盲检掺水时,直接复制下面的话术让它把证据摊开:
- 「把刚才那章的 DoD 盲检重跑:真正派一个独立subagent、不给它写作上下文,跑 delegate_review verify,把返回的 JSON 原文和退出码贴我,不许你自己扮演盲检」
- 「Phase 1 所有文献逐条跑 citation_validator verify-all,把每条 verified 值和反查证据贴我,我挑 3 条去 PubMed 核」
- 「用表格把'假设-目标-研究内容-科学问题'的对齐关系摆给我」