| name | nsfc-proposal |
| version | 2.37.2 |
| 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.
【Python 解释器探测·开工第一件事,一次探测全程沿用】 本文命令里写的 python3 / python 只是 macOS/Linux 的习惯写法,不是硬性要求。动手前先跑一次 python3 --version:
- 打印出正常版本号 → 本次会话所有命令照抄用
python3。
- 报 command not found、没有任何输出、或弹出应用商店 → 改跑
python --version,能出版本号就把后续所有命令里的解释器统一换成 python。注意 Windows 自带一个 0 字节的 python3 占位程序,python3 --version 弹商店或无输出就是撞上了它,不算有 python3,按"没有"处理(用户也可在 设置 → 应用 → 应用执行别名 里关掉 python3.exe)。
- 反过来
python 出不了版本号就换 python3(macOS 12.3 起系统不再自带 python)。
- 两个都出不了版本号 = 这台机器没装 Python,停下来告诉用户先安装,不要硬跑。
- 探测只做这一次,之后所有命令沿用同一个名字,不要每条命令都再试。
跨会话接续(每次进入/续写必做,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 / 期刊官网核一遍(防我编造、防引到已撤稿的文章)。
- 每写完一章我都会停下等你确认再往下写;我要是没停就自己连写好几章,你直接喊停,那就是跳步。
- "研究假说 → 研究目标 → 研究内容 → 关键科学问题"这条链必须对齐,我会用表格把它们逐条摆给你看,你负责检查有没有对不上、有没有断链。
- 科学问题、章节结构没经你点头,我不会开写正文,这一条有硬门禁兜底(见"结构签字落锁"),不是靠我自觉。
- 默认按国自然 2026 模板走。你要写的是省基金、校基金、企业课题或别的其他基金 / 自定义模板,现在就说——我会先读你的模板走结构提取,把章节结构提出来给你逐条核对,之后的章节、顺序、字数上限都按你的模板走。不说的话,我会按国自然的结构和「科学问题属性四选一」要求你。
基金归属确认(Mandatory,仅全新项目问一次)
打完上面那张卡后,先做基金归属判定。两个条件同时成立才问,缺一不问:项目根不存在 project_state.json,且项目根不存在 structure_profile.json(文件在但内容坏了也算"有",交由结构真源三态处理去报,不许退化成重新问一遍)。满足则问一次,二选一:
- A. 国自然 2026(默认) → 不建任何文件。契约不变:「无
structure_profile.json = 国自然默认,行为一个字不变」。
- B. 其他基金 / 自定义模板 → 请用户给模板文件路径,走下方 Phase 0「模板结构提取」的五步链,最后由
structure_profile.py confirm 落盘 funding_scheme: "other"。
不问的三种情况:任一判据文件已存在(老项目续写,按已有真源走);用户在开场消息里已明说基金类型(如「我写省自然」「国自然面上」——口径同上方 Mode 已明说就不再问);同一会话内已经问过。
⚠️ 已知天花板(如实登记):答 A 故意不落任何文件,所以只承诺同一会话内问过不再问;用户答完 A 就中断、没走到 state_manager init 的,下次新会话两个判据文件仍都不存在,会再问一次——这是接受的代价,不为它新造"AI 自己写结构真源"的落点。
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。适用范围:没有结构真源(项目根无 structure_profile.json)或真源未声明非国自然时,本项必填;真源声明 "funding_scheme": "other"(非国自然)后本项不再必填——gate-check 不再因它阻断(SPA-REQUIRED 关闭),并记入报告的「未执行的检查」(见 references/07):
- 鼓励探索、突出原创
- 聚焦前沿、独辟蹊径
- 需求牵引、突破瓶颈
- 共性导向、交叉融通
- 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)。结构真源声明 funding_scheme: "other" 后不再必填、不再阻断(进「未执行的检查」) |
| 伦理审查(涉人类受试者/实验动物/生物安全/人类遗传资源时) | 须在可行性分析中说明伦理审查批件或送审计划 |
字数/页数硬限以 python scripts/word_counter.py check 输出为准(单一真源:scripts/word_counter.py 顶部 NSFC_WORD_MAX / NSFC_PAGE_MAX);非国自然模板按 structure_profile.chapters[].word_max 与 proposal_profile.json 的 page_limit 声明取值。
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 阻断。
- 模板结构提取(仅当用户拿的不是国自然 2026 模板——省基金/其他基金/自定义章节结构时才做;国自然项目跳过本条,什么文件都不用建):目标是产出项目根的
structure_profile.json(结构真源:声明本项目有哪些章节、什么顺序、哪些必需、各自字数上限、是不是国自然)。此后合并顺序、必需章节、写作顺序、字数上限都按它走;没有这份文件 = 国自然默认,行为一个字不变。不许直接手写这份文件走捷径,必须走五步链(谁干什么是定死的):
- 脚本投影:
python3 scripts/structure_profile.py extract-text --source <用户模板文件>(支持 .md/.markdown/.txt/.docx/.pdf;docx 按文档顺序收段落和表格单元格文字;只读原件,绝不写它)→ 产 tmp/structure_source.txt(全文投影)+ tmp/structure_source.lines.tsv(短行取景框,省 token 用)。
- AI 读投影提章节:优先读短行取景框(不够再读全文投影),把认出的章节写
tmp/structure_draft.json(AI 唯一直接写的文件,形状与字段见 references/08 §2.8)。
- 脚本逐字节核验:
python3 scripts/structure_profile.py verify --draft tmp/structure_draft.json --text tmp/structure_source.txt。每个章节名必须能在投影里逐字节原样找到,任何一条对不上就整批拒收(exit 3、不写任何文件、逐条回显对不上的串);全过才产 tmp/structure_candidate.json(此时仍未生效,任何脚本都不读它)。
- 用户逐条确认:把候选章节表逐条摆给用户增删改。候选里
filename_autogen: true 表示文件名是脚本按规则猜的,必须明说请用户核对、改成 sections/ 下的真实文件名。
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 判据默认以 dod_checklist.json gate=<gate> 为真源,项目协商关过自检项时以第 0 步投影后的清单为准):
0. 选清单(条件分支,每个 Phase 盲检前先做这一步):项目根存在 data/dod_selection.json(用户在 DoD 协商中关过自检项,见 references/05 Step 0.4b)或 structure_profile.json(结构真源;合法已确认 funding_scheme: "other" 时投影会按清单声明键减免国自绑定项、把结构完整性类判据换成按结构真源查齐,见 references/08 §2.9)任一时,先跑 python3 scripts/dod_project.py project --root . --gate <gate> --out tmp/dod_active_<gate>.json 产出投影清单,且第 1、3 步的 checklist 参数一律改用投影产物 --checklist tmp/dod_active_<gate>.json——pack 与 verify 必须同用这一份:pack 用投影、verify 仍用全量,会把被减免/被关掉的项判成「缺漏未裁决」硬卡盲检(实测 exit 1)。两份文件都不存在时跳过本步,第 1、3 步照抄下方原样命令、用全量 references/dod_checklist.json(国自然默认,与协商前行为一字不变)。
-
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.
老项目排障(round21 T2):pack-write 切片为 0 而账本明明有 P1 文献 → 多半是存量条目还挂着旧节标识 "P1_立项依据"(切片链只认新值 "P1")。跑一次 python scripts/citation_validator.py normalize-sections --index data/literature_index.json(可先加 --dry-run 预览、幂等)归一后即恢复;检查链(matrix-check/find-orphans/stats/gate-check 的 P1 计数)新旧两值都认,不受影响。check-gates 发现旧值条目会给 WARN 并附这条命令。
- 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 . 同目录)。顶层是对象,形如
{"outline_claim_set_hash": "<原样抄自 .prep_task_P1.json 的同名字段>", "rows": [{"section": "P1", "claim_sentence": ..., "is_load_bearing": true, "ref_id": ..., "retrieved_abstract": ..., "verdict": ..., "evidence_quote": ..., "user_confirmed": true}]}。
🔴 两处易错、错了 pack-write 直接 exit 2:顶层承载数组的键只能叫 rows(写 claims 会让共享的 citation_claim_check.py 硬报 bad_evidence);行里的 section 值必须是 "P1" 这个节标识,不是 sections/ 的文件名前缀。outline_claim_set_hash 忘抄或抄错 → OUTLINE_GATE: claim_evidence_stale(大纲论点变了却没重跑核证,重跑 pack-prep 拿新指纹)。已在 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,不再重复问。被判 的必须先改引文或改论点(不得靠确认放行),改完重跑至 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 为默认真源;项目根有 data/dod_selection.json(用户协商关项)或 structure_profile.json(结构真源,非国自减免/改判)时,实际执行的是三步模板第 0 步经 dod_project.py 投影后的清单,被关/被减免的项不进盲检、已进报告「未执行的检查」留痕:盲检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)。
- 🔴 非国自然项目 P2 前置计划环节(round21 T3,Mandatory;国自然项目跳过本条、行为与此前完全一致):结构真源声明
funding_scheme: "other" 后四维表校验已关,P2 开写前改由段落级计划补位——AI 先出草稿 tmp/outline_draft.json(每段 gist+conclusion+rc_id 写明对应哪个研究内容;不要求承重段与文献,段落自己声明 is_load_bearing: true 时才必须给 refs),摆给用户逐条过目,用户点头后由用户授意运行 python3 scripts/outline_manager.py confirm --from tmp/outline_draft.json --root . --note "<用户确认原话>"——与 P1 共用唯一真源 data/outline.json(同一份文件,不新建第二份)。未确认 / 被改过 / 真源里还没有 P2 这一节,prewrite_gate 与 pack-write/pack-prep 一律拦(reason 依次 outline_not_confirmed / outline_stale / outline_section_not_covered——最后这个的处置是给 P2 补一段再重跑 confirm;outline_missing=还没建过;outline_checker_unavailable=检查器坏了,先修好再出包)。
- ⚠️ 如实登记(round21):非国自然项目在 P2 处当前只有这道计划闸口;同一位置的
new_refs 并表核验与 experimental_design 素材检查在这类项目里不触发(节标识形态分叉的既有缺陷,已登记待单独开轮)。别以为 P2 已有完整守卫。另:结构真源读口坏掉时会退回国自然最严口径,此时 P2 被拦的理由会变成 consistency_map 缺失而不是计划缺失。
- 每节先跑
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; 全量 RC 设计。
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
- 导入整稿 → 机械原子化拆分(脚本流水线,取代旧"肉眼认标题手工切";完整流程见
references/06_Polish_Mode流程.md Step 0):
- 抽取:
python3 scripts/extract_headings.py --source '<整稿>' --text-out tmp/draft_import.md --out tmp/heading_manifest.json(一趟同产 draft_import.md + 标题真值;.md/.txt 认 #,.docx 走 styles.xml 反查 Word 标题样式,.pdf/无样式 → headings:[])。抽后 sanity check:<200 字硬 HALT(疑扫描件/漏页),先与用户解决再往下。
- 路径判定(读
tmp/heading_manifest.json):trusted = headings 非空 且 无 low-confidence。
- 有标题路(trusted):机械字节切
python3 scripts/split_headings.py --text tmp/draft_import.md --headings tmp/heading_manifest.json --atoms-dir sections --naming 'section_{major}_{标题简称}.md' --split-to-level <草稿最小标题层级> --manifest-out tmp/split_manifest.json(落 sections/,原子名反映实节标题,主会话 Bash 零上下文;不套国自然固定 P1-P4,基金语义名留模板驱动第1期)。
- 无标题路(headless:.pdf / 无 Word 标题样式的 .docx / 纯 .txt):HALT 兜底——不派拆分、不写任何 atom,提示用户"未检出可靠标题层级,请转成带
#/Word 标题样式的 .md/.docx 或补标题后重传"。绝不静默乱拆。
- Layer 1(确定性):
python3 scripts/split_audit.py --text tmp/draft_import.md --headings tmp/heading_manifest.json --manifest tmp/split_manifest.json --atoms-glob 'sections/*.md' --split-to-level <N> --root . --report tmp/split_audit_report.json。exit 0 才进 Layer 2;exit 1(漏/造/串/漂移,fail-closed)→ 回退重拆,禁手改文件蒙混。
- Layer 2(LLM 反向核验,恒跑):split_audit exit 0 后跑
split_boundary gate——delegate_review.py pack tmp/split_verify_ctx.md(标题树 + 各 atom 锚定行,不含全文正文)→ 独立子代理 → verify。verdict:[OK]→pass 前进 / [WRONG]→回退重切(先修 extract_headings 真值)/ [UNCERTAIN]→交用户裁决(不自动动)。
- 用户确认拆分表(两层皆绿后):展示 split map + audit 结果,等用户明确 "yes"/adjust。
- signoff 解锁:用户确认后跑
python3 scripts/structure_signoff_gate.py confirm --root . --note "<用户确认要点>" 落签字,解锁 Step 3 逐节 Write/Edit(否则 hook 拦每次改节写入)。铁律:confirm 只能在两层绿 + 用户对拆分表说 yes 之后跑,AI 不得代用户自行 confirm。 拆分脚本经 Bash 写 sections/*.md 不经 Write/Edit,故未签也能落盘拆分产物,真正被 signoff 门控的是 Step 3 逐节改写。
- Generate strict review report first ().
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:文献索引条目必填字段:
凡 used_in_sections 含 "P1"(或旧值 "P1_立项依据",只读兼容)的条目,若 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 字(上限以
word_counter.py check 输出为准;非国自然模板按结构真源 word_max / page_limit 声明)。
- ❌ 在任一 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.
failed_at=literature_index: 文献索引损坏——entries 里混入了非对象元素(字符串/列表/null 等),报告的 literature_index.error 会点名是第几条(0 基下标)、什么类型。按点名的下标人工修好 data/literature_index.json 里那些条目(补成完整对象或整条删掉),索引文件门禁没有动过、也不要指望 sync-all --auto-fix(它只修容器类型不清洗元素,不会替你删文献)。修完 re-run 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.
已知限制(非国自然项目的结构指纹保护是空白,本轮不补):结构签字门禁(structure_signoff_gate)的"大纲变了要重签"保护,靠 data/consistency_map.json 与 data/experimental_design.json 里的实体表建指纹。非国自然项目(funding_scheme: "other")通常不建这两份文件——两份都不是 dict 时指纹为 None,签字落成 outline_bound: false,此后改结构不会触发重签要求。这不是旧保护的丢失:改造前非国自然项目根本走不到签字(被科学问题属性卡死在 Phase 7 之前),这是新场景带来的空白。不补的原因:补它要把 structure_profile.json 纳入指纹投影,会让已签字的国自然项目被要求重签(红线禁止),且 structure_signoff_gate.py 在门禁写保护清单里。将来要补需单独授权的第 3 期工作(投影加"仅当签字时该文件已存在才计入"的条件迁移 + 用户亲手开门禁豁免),建议等真有人拿省基金本子跑完一轮再说。
已知限制(诊断提示在本技能里看不到,但请求照打):在线核验(不加 --offline,即默认)时,对每条没验过、带 DOI/PMID、标题≥3 个词的文献,底层核验会额外拿标题上网回查一次,本可给出「这条的 DOI/PMID 可能填错了,线上同名文章是这个」之类的提示;但 citation_validator.py 的 verification_details 只保留固定字段,这些提示会被直接丢掉——请求照打、结果照扔,白花一次网络往返和限流额度。判定结果完全不受影响(verified / 撤稿 / 硬失败一条都不会变),只是文献多时 verify-all 会慢一些。所以验不过的条目直接看 verification_details.failure_reasons 排查,别等诊断提示;网络紧张时可先 --offline 跑一遍粗筛(但终审 gate 仍须在线 + --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 核」
- 「用表格把'假设-目标-研究内容-科学问题'的对齐关系摆给我」