Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Um comando direto ignora o prompt de revisão. Verifique a origem antes de executá-lo.
Instruções da origem · Visualização somente leitura
name
revise-sci
version
2.30.2
description
退稿/返修全管道,同时出逐条回复信+修改后正文docx+Patch修订。触发词:改稿、修改稿子、修订正文、退稿改进、返修、revise manuscript、major revision、minor revision、revise and resubmit、point-by-point response、revised manuscript。路由说明:与reviewer-response-sci区分,本技能同时改主稿+出回复包,后者只出回复不改稿;与gsw区分,gsw写新稿,本技能专处理已有稿子的审稿意见驱动修改。
Revise-Sci
Overview
Use this skill to turn reviewer comments, the original manuscript, SI, and attachments into two deliverables: a revised manuscript and a structured Response to Reviewers. Both come out in Markdown and Word.
The workflow is script-gated. Do not skip steps. Do not fabricate experiments, data, statistics, or references.
The comment parser accepts both atomic comment-unit HTML and reviewer-simulator style report HTML with critique lists.
The manuscript atomizer recognizes numbered section headings such as 1, 1.1, and 2.3.4 even when the source Word paragraph style is not a formal heading style.
When the user provides a comments_path, a manuscript_docx_path, or both, do not jump straight into run_pipeline.py.
First, env precheck (soft gate, before any pipeline run): python scripts/env_preflight.py <project_root> --cli esearch --py docx; it writes env_status.json, and the last line prints PRECHECK: OK|ASK|BLOCKED. BLOCKED (Python too old) → stop and guide upgrade; ASK (missing optional tools like esearch/python-docx) → ask the user per tool whether to install, give guidance, continue only after the user answers installed/skip; OK → continue. Rollback uses state_manager.py snapshot + Patch-hash (no git checkpoints).
Before any substantive revise work, report to the user:
which comments_input_mode was detected;
which branch-specific workflow will be used next;
that the workflow preserves the same atomicization, fragment-only rewrite, anti-AI polish, state-window, anti-forgetfulness, and hard-gate rules;
then ask the user to confirm that routing decision together with the desired project_root / output path.
If the input does not match any supported branch:
do not proceed silently;
ask the user whether to map the input to an existing branch or create a new branch;
any new branch must still preserve the same atomicization, fragment-only rewrite, anti-AI polish, state-window, anti-forgetfulness, and hard-gate rules.
If the user has no reviewer comments and only provides the manuscript:
run python scripts/intake_router.py --manuscript <manuscript_docx_path>;
ask whether to use reviewer-simulator first to generate reviewer comments;
check global availability using python scripts/ensure_global_skill.py --skill-name reviewer-simulator;
if the skill is missing and the user confirms installation, install it from your own skills backup repository (reviewer-simulator subdirectory) before invoking that branch.
Comment Input Modes
docx-review-comments: ordinary reviewer comments exported from email or web into a .docx. The parser expects reviewer / major-minor / numbered-comment structure and keeps multiline comments inside one unit.
docx-review-letter: ordinary decision-letter style .docx files where the structure is usually editor email -> Reviewer #N overall statement -> numbered comments. The parser now distinguishes editor statements, reviewer overall statements, and actionable numbered comments instead of collapsing them into a single comment stream.
reviewer-simulator-html: HTML generated by reviewer-simulator. The parser reads critique-section / critique-list blocks and preserves comment_title, problem_description, evidence_anchor, root_cause, and author_strategy.
reviewer-response-sci-html: HTML generated by reviewer-response-sci. The parser extracts the original reviewer comment plus seeded response_en/zh, original_excerpt, revised_excerpt, and revision_location, then feeds those seeds back into localization and response drafting.
atomic-comment-html: already-atomic HTML with comment-unit nodes. Existing comment_id values are preserved.
no-comments-manuscript-only: manuscript exists but reviewer comments are not provided yet. This is not a revise branch by itself; it is an intake state that must first ask whether to bootstrap comments via reviewer-simulator.
For docx-review-letter, the workflow must:
distinguish top-of-letter editor statements from numbered editor action items;
capture reviewer-level Overall statement / General assessment / Reviewer statement text as reviewer-summary seeds, not as the first numbered comment;
preserve those statement seeds into downstream response rendering so the exported response package can still show editor/reviewer context explicitly.
For reviewer-response-sci-html, do not trust the incoming response package at face value:
treat seeded response/revision content as structured hints rather than auto-approved final output;
prioritize seeded location/original-excerpt hints when localizing the target paragraph;
still rerun revise -> polish -> literature/reference checks -> strict_gate before delivery.
--expected-comments-mode is strongly recommended after the user confirms the branch chosen by intake_router.py. preflight.py will block execution if the confirmed mode and the detected mode do not match.
revise-sci does not load the entire manuscript and all comments into one context window. It uses the same approach as article-writing, review-writing, and sci2doc, adapted for revise work:
Intake-first routing: route the comment source first, then lock the branch before loading anything large.
Section-paragraph atomicization: only the target section and target paragraph are used for rewrite scope.
Comment-scoped state windows: every processed comment_id gets its own context package under state/comment_windows/<comment_id>.json.
Section digests, not full reloads: cross-section consistency uses state/section_digests.json, which stores only headings, paragraph counts, and key sentences, rather than full section text.
Token budget compaction: state_manager.py write-cycle estimates token load and compacts related digests / reviewer context / neighboring paragraphs if the bundle exceeds the configured budget.
Cycle log persistence: every revise action appends to state/comment_cycle_log.json and state/comment_memory/<comment_id>.md, so a future agent does not need to reconstruct local history from scratch.
Snapshot safety: state_manager.py snapshot writes state snapshots so runs can be resumed with smaller context and lower drift risk.
This command is the revise-sci equivalent of the section-scoped state loading in article-writing, review-writing, and sci2doc. It is the preferred context entry before any manual or AI-assisted change to a specific comment-linked paragraph.
Patch 修订协议(可选的确定性修订路径)
This is an optional, additive deterministic path for applying scope-locked edits. It does not replace the atomize -> issue-matrix -> revise_units -> strict_gate flow. Use it when you need a hard guarantee that only the touched blocks can change and every other block stays byte-for-byte identical, rather than having the model regenerate whole sections (the main source of scope creep and drift).
Protocol (four phases):
anchorize: split the target draft into blank-line blocks, assign each a stable anchor id (block-NNNN-<hash8>), and write a block manifest (anchor -> exact original bytes + sha256 + byte offsets):
patch: for each reviewer comment that needs a block changed, author a patch entry {anchor_id, expected_hash, new_content} where expected_hash is the block's sha256 from the manifest. Patch only the blocks that must change; never touch other anchors. The patch file is a JSON array of such entries.
apply (deterministic, fail-closed): locate each block by anchor id, verify its current sha256 equals the patch's expected_hash, then splice only the patched byte-spans:
If any entry's hash does not match (the block already changed) or the source draft drifted since anchorize, the whole patch set is rejected, nothing is written, and the script exits non-zero. There is no silent partial apply.
finalizer: apply_revision_patch.py reassembles the full draft from the original source, copying every unpatched byte verbatim (blocks, separators, and trailing-newline state preserved). Feed <revised.md> back into the normal polish -> literature/reference checks -> strict_gate flow before delivery.
Rules:
The patch path is fail-closed: a hash mismatch or source drift must abort and write nothing; never coerce or auto-relocate a patch onto a changed block.
The patch path is an increment on top of the existing pipeline, not a replacement: atomize_comments.py, build_issue_matrix.py, the state-window protocol, and strict_gate.py all still apply to the resulting draft.
optional ## Editor Statement when the decision letter contains editor-only overall instructions but no numbered editor comments
optional # Editor when there are numbered editorial action items
# Reviewer #N
## Major / Minor
### Comment k
Each comment must contain:
审稿意见与中文理解
Response to Reviewer(中英对照)
可能需要修改的正文/附件内容(中英对照)
修改说明(中文)
Evidence Attachments
Rules
Missing information must be written as Not provided by user or 需作者确认.
If a reviewer asks for new literature, only paper-search is allowed as the external provider family.
paper_search_results_path may be used to ingest confirmed paper-search results into citation-oriented comment handling.
paper_search_results_path is not trusted directly. It must first pass citation_guard.py, which performs dual verification using provider trace and identifier/title consistency evidence before citations can auto-complete a comment.
Applies to all newly written or rewritten content (revised fragments, new sentences, response-letter prose). These inline markers are rendered into real Word character formatting by scripts/export_docx.py (bold/italic/superscript/subscript runs). This contract governs the markers you emit when authoring new text. Reading the original docx now preserves run-level formatting too: read_docx_paragraphs(..., inline_format=True)(仅 atomize_manuscript.py 开启)把原稿 run 的 italic/bold/sup/sub 序列化成同一套行内标记进 section text/current_text,所以未改片段的原格式经 revise→export 往返不丢;被改片段也按同一套标记在 in-place 写出时重建 run。默认读取器仍为纯文本(inline_format=False),数值/引用/AI 风格红线比对不受标记污染。
Italic via *...* for: species Latin names (*E. coli*, *Staphylococcus aureus*), gene names (*TP53*, *BRCA1*), single-letter statistical symbols (*p*, *t*, *n*, *F*, *r*), and Latin abbreviations (*in vitro*, *in vivo*, *et al.*, *e.g.*, *i.e.*).
Superscript via <sup>...</sup>: exponents and powers (10<sup>6</sup>, cm<sup>2</sup>, mg·kg<sup>-1</sup>). Subscript via <sub>...</sub>: chemical subscripts and indexed terms (H<sub>2</sub>O, CO<sub>2</sub>, IC<sub>50</sub>, T<sub>max</sub>). Never emit bare H2O / CO2 / IC50.
Bold via **...** only for headings and inline labels (e.g. **Limitations.**), never for emphasis inside running scientific prose.
中文回复部分:句内标点全角(,。:;),英文与数字保持半角,中英文之间不强制空格但须一致。
These inline markers are load-bearing and carry the same status as citation markers [n]: when rewriting a locked fragment, do not add, drop, or mis-pair them. Adding */<sup>/<sub> where the source had none, or stripping existing ones, is a meaning/format drift and is subject to the same fragment-only and scope-lock rules as [n].
Commonsense sanity (🟡 soft report, non-blocking): the blind-review subagent also scans rewritten fragments for obvious commonsense/factual errors (absurd unit magnitudes, physiology/mechanism mistakes, internal numeric contradictions) introduced by the rewrite. Report only, never block delivery, never auto-edit content. Distinct from the citation/reference verification gates (RV-G1/RV-G2) and from reviewer-simulator's full scientific audit.
build_literature_index.py must convert validated citation support into review-writing style canonical artifacts: data/literature_index.json and data/revision_claims.json.
build_literature_index.py accepts an optional --seed-index <path> to reuse the writing project's existing literature_index.json (produced by gsw/review-writing) as a seed. Seed entries keep their original global_id; revision-found references that match a seed entry (dedup key: normalized DOI > PMID > normalized title) reuse the seed number instead of getting a new one, and truly new references continue numbering from max(seed global_id) + 1. The seed is read-only; the merged result is written only to revise-sci's own data/literature_index.json, never back to the writing project (seed-extension semantics). The seed reader tolerates the looser gsw schema (global id under any of global_id/citation_number/id/number/ref_number, back-filled by array order when absent) and a seed located either at the project root or under data/. Omitting --seed-index keeps the original rebuild-from-1 behavior unchanged.
matrix_manager.py must derive data/synthesis_matrix.json from the canonical literature index and emit data/synthesis_matrix_audit.json before delivery.
build_reference_registry.py must extract the final manuscript reference list into canonical data/reference_registry.json and audit body-to-reference coverage into data/reference_coverage_audit.json.
build_reference_registry.py may import a fallback reference seed from references_source_path when the manuscript reference list is empty or absent.
If a manuscript already has a partial numeric References section, build_reference_registry.py should try to merge missing numbered entries from the detected legacy reference source instead of failing immediately.
If unresolved reference gaps still remain after registry rebuild, build_reference_registry.py must emit reference_recovery_request.md so the author knows exactly which source formats to provide next.
If no original or legacy reference source is available, ask the user whether to start a new literature-search-and-fill cycle; default state is reference_search_decision=ask, not silent auto-search.
If the user approves new reference search, the search-and-fill path must follow the review-writing discipline: paper-search retrieval only, immediate citation_guard.py after each import batch, update canonical data/literature_index.json, then refresh data/synthesis_matrix.json / data/synthesis_matrix_audit.json before any new references can enter the manuscript.
If reference_search_decision=approved and reference gaps still exist, the skill must generate reference_search_manifest.json and reference_search_task.md so the approved search cycle is executable and auditable rather than implicit.
The approved search cycle should also emit reference_search_strategy.json and reference_search_status.json so search scope, provider policy, round model, and step status remain explicit and machine-checkable.
The approved search cycle should also emit reference_search_rounds.json, containing concrete query batches for Round 1 / Round 2 / Round 3 under review-writing governance.
The approved search cycle must explicitly declare workflow=review-writing, allowed_provider_families=["paper-search"], forbidden_provider_families containing websearch, and verification_policy.dual_verification_required=true.
The approved search cycle must keep a three-round structure in both reference_search_manifest.json and reference_search_strategy.json, and must record citation_guard.py as the mandatory verification command.
build_reference_registry.py should audit both numeric citations and author-year citations; unresolved gaps in either style must block delivery.
Confirmed citation support must include an explicit anchor such as target_section_heading, target_paragraph_index, or target_text; otherwise the item stays in needs_author_confirmation.
If current materials are insufficient, keep the item in needs_author_confirmation instead of inventing a resolution.
Treat completed as a narrow state: only conservative text-only clarification or limitation edits with reliable paragraph localization may be auto-completed.
If paragraph localization is ambiguous and multiple candidates score similarly, fall back to needs_author_confirmation rather than selecting a paragraph aggressively.
If a comment contains an explicit structured section hint such as Section 4.2 or 4.2 节 but that hint cannot be matched to an existing section, do not fall back to lexical matching; keep the item in needs_author_confirmation.
For Chinese-source reviewer comments, keep the original Chinese comment as the authoritative source block and render a separate English working summary instead of mislabeled bilingual fields.
preflight.py must record comments_input_mode so downstream steps and audit reports know whether the current run came from raw reviewer comments, reviewer-simulator HTML, reviewer-response-sci HTML, or already-atomic HTML.
preflight.py must also record expected_comments_mode, context_token_budget, and context_tail_lines; these values become part of the resume fingerprint.
preflight.py must fail fast when the user runs the full pipeline on an unsupported or unclassified comments source, rather than silently guessing a branch.
reviewer-response-sci HTML inputs must be treated as response-rich seeds: atomize_comments.py should preserve the seeded response/revision fields, and revise_units.py should reuse them conservatively for localization and draft response blocks without bypassing manuscript rewrite constraints or hard gates.
Citation-only comments may be auto-completed only when confirmed paper-search results and formatted citation text are explicitly provided.
Citation-only comments may be auto-completed only when the row is confirmed, the citation guard marks it guard_verified=true, and the target anchor is explicit.
After manuscript merge, reference_sync.py must append or update the References/参考文献 section using canonical data/literature_index.json and emit reference_sync_report.json.
When author_confirmation_reason is rendered into English, the translated reason must remain fully English with no leftover Chinese fragments.
For substantive requests such as new mechanism explanations, new evidence, new figures, or unresolved section matches, stop at needs_author_confirmation and do not auto-complete.
strict_gate.py must verify comment coverage, response/manuscript/edit-plan consistency, atomic location completeness, provider-family policy, and per-comment evidence blocks before delivery.
📢 交付前半成品提醒(非阻断):strict_gate.py 每次运行都统计最终 response 正文里 需作者确认 的出现次数、以及非默认的 Not provided(排除每个 unit 的 Image/Table 默认模板行 Not provided by user,避免狼来了);命中就打印醒目 banner「还有 N 处待你处理」。这不判 FAIL(需作者确认 是合法输出),只响亮提醒,防止半成品被当成成品直接投稿。
strict_gate.py must verify that every auto-completed citation comment is covered by reference_sync_report.json; otherwise delivery fails.
strict_gate.py must verify that every auto-completed citation comment is present in both data/literature_index.json and data/synthesis_matrix.json, and that data/synthesis_matrix_audit.json reports no unresolved matrix gaps.
strict_gate.py must fail delivery when data/reference_coverage_audit.json reports unresolved numeric citation gaps, even if the comment-level workflow itself completed.
strict_gate.py must parse response_to_reviewers.docx and verify that comment headings, response-section headings, and evidence-section headings are present for every comment block.
strict_gate.py must verify that reference_search_manifest.json, reference_search_strategy.json, and reference_search_status.json are internally consistent with actual approved-search artifacts such as paper_search_validated.json, paper_search_guard_report.json, data/literature_index.json, data/synthesis_matrix_audit.json, and reference_sync_report.json.
references_source_path is optional. If not provided explicitly, the pipeline may auto-detect likely sources such as a same-title sibling manuscript docx with a populated References block, <comments_dir>/data/literature_index.json, attachment files named like reference*/bibliography*, or project-local seed files.
references_source_path auto-discovery should also inspect nearby versioned manuscript docx files inside shallow subdirectories of the manuscript folder when they share the same title and contain a usable References block.
references_source_path may also be a .ris file exported from a reference manager.
Keep Evidence Attachments in every comment block, even when no image or table is available.
--resume skips already-materialized upstream artifacts so a rerun does not silently overwrite previously curated units.
--resume also checks stored input fingerprints; if comments/manuscript/SI/attachments/reference/paper-search inputs changed, the rerun fails fast instead of trusting stale artifacts. 失败提示里会引导用户改用 --resume-keep-unaffected。
--resume-keep-unaffected:返修一作常天天改稿,一处改动即触发上面的全量重建、丢弃已 curated units。加此 flag 后,若本次改动仅涉及内容输入(comments/manuscript/SI)且未触及任何已定位的 comment unit(重新原子化到临时目录后比对:无 comment 文本增删改、且没有 unit 锚定的 section 正文变化),则保留全部 curated units、更新输入指纹后续跑;若有 unit 受影响则列出受影响的 comment_id 并 fail(curation 与原子化耦合,无法只重生成受影响 units 而不清空其它 curation,须重新 curation 后 --force-rebuild);若改动涉及非内容输入(journal_style/runner/文献/预算等全局项)也 fail(无法按 unit 局部化)。注:即便保留续跑,若原稿段落发生插入/删除导致全局段落索引漂移,最终 in-place 导出仍会在身份校验处硬停(见 export_docx P1),属预期 fail-safe。
--resume must also fail fast when the stored skill signature differs from the current script tree signature.
--resume-from <step> must clear the selected step and all downstream generated artifacts, then rebuild only from that step onward under the same verified input fingerprint.
--force-rebuild clears generated project artifacts, including data/ and citation intermediate files, and reruns the pipeline from scratch inside the same project_root.
state_manager.py refresh must materialize state/section_digests.json and state/comment_registry.json before revise_units.py starts.
revise_units.py must write state/comment_windows/<comment_id>.json and state/write_cycle_reports/<comment_id>.json for every comment unit, then append state/comment_cycle_log.json.
--live-citation-verify enables online title/identifier verification when paper-search results are provided; pipeline mode should be recorded in preflight output.
final_consistency_report.md should list each needs_author_confirmation item with a blocker type and the exact stored reason.
final_consistency_report.md should also summarize reference coverage status, including detected numeric citations, reference entry count, and missing reference numbers when present.
final_consistency_report.md should also report whether reference_search_required=true and the current reference_search_decision.
final_consistency_report.md should also summarize intake mode, expected mode, state-window budget, section digest counts, and comment-window counts.
Word export should render common markdown emphasis and list markers as real Word formatting instead of leaving raw **...** and list prefixes in the document body.
response_to_reviewers.docx should include a visible heading hierarchy plus a TOC field, centered header text, and footer page-number field so the exported package is review-ready rather than plain-text only.
export_docx.py should support profile-based manuscript export via --journal-style, with distinct body/title/heading/reference/table styles for at least journal-manuscript, nature-review, cell-press, and lancet-review.
Markdown pipe tables in manuscript or response markdown should be rendered as actual Word tables rather than plain paragraphs.
Response block labels such as Text / Image / Table should be rendered with a dedicated Word paragraph style so exported reviewer-response documents keep a consistent block structure.
If reference_search_decision=approved and --auto-run-reference-search is enabled, the pipeline should invoke a local runner hook via execute_reference_search.py; this runner must still obey review-writing governance and may only emit paper-search rows.
If approved auto-run is requested but no local runner is configured, the pipeline must fail explicitly and write reference_search_execution_request.md instead of pretending that search has already been executed.
The local runner contract must remain machine-checkable: --rounds-json <path> --output <path> --project-root <path>, with output saved to project_root/paper_search_results.json.
Approved search auto-execution must rerun citation_guard.py, revise_units.py, literature-index/matrix steps, reference_sync.py, and build_reference_registry.py before export and gate.
If no explicit local runner is provided but opencode is available, the workflow may fall back to an internal opencode run driver that still writes the same paper_search_results.json schema under review-writing governance.
The opencode fallback must write a preserved prompt file (reference_search_opencode_prompt.md) and an execution report (reference_search_execution.json) so the retrieval path remains auditable.
strict_gate.py and final_consistency_report.md should surface reference_search_execution.json state instead of hiding the actual execution mode.
Query hints for approved search should come not only from missing reference coverage but also from pending citation-oriented review comments that still point to paper-search as a required evidence source.
Lexical paragraph localization should use structured fields with low-signal-token filtering and heading-weighted scoring; if the best lexical candidate is still low-confidence, keep the item in needs_author_confirmation.
Reviewer-response Word export should use dedicated body, reviewer-heading, label, and comment-heading styles, with improved spacing and Word-native table header shading, rather than leaving all blocks as generic paragraphs.
Automatic manuscript rewriting must stay at the changed-fragment level. revise_units.py should replace only the targeted sentence, or append only the new limitation sentence, rather than rewriting the entire paragraph.
A dedicated polish stage must run after revise and before literature/reference merge. This stage consumes only revision_plan.raw_fragment, never untouched original sentences.
The polishing stage must follow article-writing, review-writing, and humanizer-zh constraints together: direct evidence-bounded wording, no invented claims, no new citations, no banned AI phrases, no decorative transitions, and no paragraph-wide rewrite unless the new content is itself a new paragraph.
The polishing stage must emit revision_polish_manifest.json, revision_polish_prompt.md, and revision_polish_execution.json so the anti-AI prompt, driver mode, and candidate coverage remain auditable.
strict_gate.py must verify that completed revised fragments with a non-empty revision_plan.scope have polish state, a valid polish_driver_mode, and no residual banned AI-style markers.
The polishing prompt must be layered, not flat. It must include: role definition, non-negotiable edit/evidence/citation/length constraints, deep anti-AI rewriting protocol, and a JSON-only output contract.
禁比喻与连续同式排比(比喻软/新写禁,排比硬):原稿作者已有的比喻("如同/犹如/像…一样"及"…的桥梁/基石"类、like…/as if…/serves as a bridge/cornerstone)标为软提示交作者定夺、不自动删改;但改写时模型自己新写的句子禁止新增比喻。禁连续≥3句相同起始词或句式框架的排比(parallel structure repeated across 3+ consecutive sentences)——合并或改写变换句式。
revision_plan should carry locked_prefix, locked_suffix, evidence_boundary_note, and citation_strings so the polishing step can preserve untouched context explicitly rather than infer it.
The polishing output schema should include edit_decision, meaning_changed, scope_respected, ai_style_flags_removed, and notes.
strict_gate.py must fail if a polished revision reports meaning_changed=true, scope_respected=false, or if reconstructed paragraph text no longer preserves the locked prefix/suffix context.
strict_gate.py must also fail if comments_input_mode is unsupported, expected_comments_mode and detected mode diverge, or the required state-window artifacts are missing.
RV-R8
结构完整性:改后稿件结构完整(原结构无破坏、参考文献编号连续、response 各 unit 三要素齐全);退稿信每条意见在 edit_plan 中有落点无遗漏