research-literature-review

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Research Literature Review

Research Literature Review

定位与检索依赖

Positioning and Retrieval Dependencies

  • 目标:在一个隔离工作目录内完成“检索 → 去重 → 评分 → 选文 → 写作 → 校验 → PDF/Word 导出”的完整综述流水线。
  • 适用:用户明确要系统综述、文献综述、related work、文献调研,并希望得到 LaTeX + BibTeX + PDF/Word 产物。
  • 不适用:只想补单条参考文献、只想润色已有正文、只想写普通摘要或与综述无关的文章。
  • 最高原则:以最佳可用证据和写作质量完成综述;不确定时说明处理方式,不为赶进度牺牲可信度。
  • research-literature-search
    是阶段 1/2 的必需依赖(contract
    rls.v1
    )。review 只消费其 manifest、canonical candidates 和 provenance,不再内嵌 provider 或执行第二套 canonical 去重。
  • 旧名
    systematic-literature-review
    仅作为 prompt 兼容别名保留;
    .systematic-literature-review/
    仍是稳定历史工作区名。
  • Objective: Complete the full review pipeline of "Retrieval → Deduplication → Scoring → Paper Selection → Writing → Verification → PDF/Word Export" within an isolated working directory.
  • Applicable: Users explicitly request systematic literature review, literature review, related work, literature research, and expect to get LaTeX + BibTeX + PDF/Word deliverables.
  • Not applicable: Only want to supplement a single reference, only want to polish existing text, only want to write a regular abstract or articles unrelated to reviews.
  • Highest principle: Complete the review with the best available evidence and writing quality; when uncertain, explain the processing method, and do not sacrifice credibility for progress.
  • research-literature-search
    is a required dependency for Phase 1/2 (contract
    rls.v1
    ). The review only consumes its manifest, canonical candidates and provenance, and no longer embeds providers or executes a second set of canonical deduplication.
  • The old name
    systematic-literature-review
    is retained only as a prompt compatibility alias;
    .systematic-literature-review/
    remains the stable historical workspace name.

输入

Input

最少需要:
  1. {主题}
    :一句话主题。
  2. 可选范围:时间、语言、研究类型、数据库偏好等。
  3. 档位:
    Premium
    /
    Standard
    /
    Basic
    ;未指定时读取
    config.yaml
    默认值。
  4. 目标字数与参考文献范围:未指定时按
    config.yaml.scoring.default_*_range
  5. 输出目录或安全化前缀:未指定时使用安全化主题名。
  6. 查询输入:阶段 1 前必须提供符合公开 schema 的多查询 JSON;推荐用
    --query-file
    ,也可填写当前 run 的
    input/queries.json
Minimum requirements:
  1. {Topic}
    : One-sentence topic.
  2. Optional scope: Time, language, research type, database preference, etc.
  3. Tier:
    Premium
    /
    Standard
    /
    Basic
    ; if not specified, read the default value from
    config.yaml
    .
  4. Target word count and reference range: If not specified, follow
    config.yaml.scoring.default_*_range
    .
  5. Output directory or sanitized prefix: If not specified, use the sanitized topic name.
  6. Query input: Before Phase 1, multi-query JSON conforming to the public schema must be provided; it is recommended to use
    --query-file
    , or fill in
    input/queries.json
    of the current run.

流程

Process

输入

Input

按用户请求和配置文件提供必要输入;缺失信息应明确列出并停止依赖该输入的步骤。
Provide necessary input according to user requests and configuration files; if information is missing, list it clearly and stop the steps that depend on this input.

执行步骤

Execution Steps

  • 当用户环境中出现因本 skill 设计缺陷导致的 bug 时,优先使用
    bensz-collect-bugs
    按规范记录到
    ~/.bensz-skills/bugs/
    ,严禁直接修改用户本地 Claude Code / Codex 中已安装的 skill 源码。
  • 若 AI 仍可通过 workaround 继续完成用户任务,应先记录 bug,再继续完成当前任务。
  • 当用户明确要求“report bensz skills bugs”等公开上报动作时,调用本地
    gh
    bensz-collect-bugs
    ,仅上传新增 bug 到
    huangwb8/bensz-bugs
    ;不要 pull / clone 整个 bug 仓库。
  • When a bug caused by the design flaw of this skill occurs in the user's environment, prioritize using
    bensz-collect-bugs
    to record it in
    ~/.bensz-skills/bugs/
    according to specifications. It is strictly forbidden to directly modify the source code of the skill installed in the user's local Claude Code / Codex.
  • If the AI can still complete the user's task through a workaround, record the bug first, then continue to complete the current task.
  • When the user explicitly requests actions such as "report bensz skills bugs" for public reporting, call the local
    gh
    and
    bensz-collect-bugs
    , and only upload new bugs to
    huangwb8/bensz-bugs
    ; do not pull / clone the entire bug repository.

准备

Preparation

  • 记录主题、档位、字数/参考范围与输出目录。
  • 先读取
    references/ai_query_generation_prompt.md
    ,生成查询 JSON。公开 schema 支持以下三种形态:
    • {"queries": [{"query": "...", "rationale": "..."}]}
    • [{"query": "...", "rationale": "..."}]
    • ["query 1", "query 2"]
  • 剔除空查询后,有效数量必须满足
    config.yaml:query_input.min_queries/max_queries
    (默认 5–25)。
  • 已知工作目录时,直接将文件保存到
    <work-dir>/input/queries.json
    ,或用
    --query-file <path>
    让 runner 将显式输入复制到该位置。工作目录尚未建立时,先运行
    --prepare-only
    ,填充打印出的
    input/queries.json
    ,再以
    --resume ... --resume-from 1
    继续。
  • 开始前优先阅读:
    • references/ai_query_generation_prompt.md
    • references/ai_scoring_prompt.md
    • references/expert-review-writing.md
    • references/review-tex-section-templates.md
    • 涉及翻译时再读
      references/multilingual-guide.md
  • Record the topic, tier, word count/reference range and output directory.
  • First read
    references/ai_query_generation_prompt.md
    to generate query JSON. The public schema supports the following three forms:
    • {"queries": [{"query": "...", "rationale": "..."}]}
    • [{"query": "...", "rationale": "..."}]
    • ["query 1", "query 2"]
  • After removing empty queries, the valid number must meet
    config.yaml:query_input.min_queries/max_queries
    (default 5–25).
  • When the working directory is known, directly save the file to
    <work-dir>/input/queries.json
    , or use
    --query-file <path>
    to let the runner copy the explicit input to this location. When the working directory has not been established, run
    --prepare-only
    first, fill in the printed
    input/queries.json
    , then continue with
    --resume ... --resume-from 1
    .
  • Prioritize reading the following before starting:
    • references/ai_query_generation_prompt.md
    • references/ai_scoring_prompt.md
    • references/expert-review-writing.md
    • references/review-tex-section-templates.md
    • Read
      references/multilingual-guide.md
      when translation is involved

多查询检索(调用 research-literature-search)

Multi-Query Retrieval (Call research-literature-search)

  • 查询来源优先级固定为:显式
    --query-file
    → 当前 run 的
    input/queries.json
    input/queries_{stem}.json
    output/artifacts/queries_{stem}.json
    → 当前 run 内唯一历史兼容文件。
  • 自动发现多个候选时停止并报告冲突;发现文件但 schema/数量无效时停止并给出修复提示。不得跨 run 猜测查询路径。
  • 启动阶段先发现并校验
    research-literature-search
    (顺序:
    --search-skill-root
    → 项目内
    skills/research-literature-search
    → 环境变量 → 用户 Skill 根目录);缺失或 contract 不兼容时 fail-closed,并给出安装提示。
  • 调用 search 的
    run
    入口生成 manifest bundle;review 将其作为只读输入包保存并记录 manifest/candidate hash、contract version 和 source path。
  • Search Log 的
    search_mode/query_source/requested_query_count/accepted_query_count/fallback_reason
    由 manifest 单向生成;AI 不手写 provider 次数、候选数量或去重结论。
  • 单查询只作为显式后备:传
    --allow-single-query-fallback
    ,可用
    --fallback-reason
    写明原因;日志必须标记
    search_mode=single_query
    和醒目警告。
  • Query source priority is fixed as: Explicit
    --query-file
    input/queries.json
    of current run →
    input/queries_{stem}.json
    output/artifacts/queries_{stem}.json
    → the only historical compatible file in current run.
  • Stop and report conflicts when multiple candidates are automatically discovered; stop and give repair prompts when the file is found but the schema/quantity is invalid. Do not guess query paths across runs.
  • During the startup phase, first discover and verify
    research-literature-search
    (order:
    --search-skill-root
    → in-project
    skills/research-literature-search
    → environment variables → user Skill root directory); fail-closed if missing or contract incompatible, and give installation prompts.
  • Call the
    run
    entry of search to generate the manifest bundle; the review saves it as a read-only input package and records the manifest/candidate hash, contract version and source path.
  • search_mode/query_source/requested_query_count/accepted_query_count/fallback_reason
    in Search Log is generated unidirectionally by the manifest; the AI does not manually write the number of providers, candidate quantity or deduplication conclusions.
  • Single query is only used as an explicit fallback: pass
    --allow-single-query-fallback
    , and use
    --fallback-reason
    to specify the reason; the log must mark
    search_mode=single_query
    and a prominent warning.

去重(契约验证,不重复去重)

Deduplication (Contract Verification, No Repeated Deduplication)

  • 验证 manifest、artifact hash、
    rls.paper.v1
    candidates_deduped.jsonl
    ;保留
    2_dedupe
    checkpoint 名称以兼容 resume。
  • 新运行不得再次执行旧
    dedupe_papers.py
    或改变 canonical 顺序;旧文件/旧 checkpoint 仅通过显式 legacy adapter 读取,并标记
    legacy_adapted
  • 所有后续流程只读取 search bundle 的 canonical 候选集。
  • Verify manifest, artifact hash,
    rls.paper.v1
    and
    candidates_deduped.jsonl
    ; retain the
    2_dedupe
    checkpoint name for resume compatibility.
  • New runs must not re-execute the old
    dedupe_papers.py
    or change the canonical order; old files/old checkpoints are only read through explicit legacy adapters and marked
    legacy_adapted
    .
  • All subsequent processes only read the canonical candidate set of the search bundle.

AI 评分与数据抽取

AI Scoring and Data Extraction

  • AI 按
    references/ai_scoring_prompt.md
    逐篇阅读标题与摘要,输出
    scored_papers.jsonl
  • 每篇至少包含:
    score
    subtopic
    rationale
    alignment
    extraction
  • 评分范围固定为 1-10 分;仅对
    >=5
    分文献分配子主题,避免弱相关论文污染子主题规划。
  • 自检分布是否健康:高分约 20-40%,中分 40-60%,低分 10-30%。
  • The AI reads the title and abstract of each paper according to
    references/ai_scoring_prompt.md
    and outputs
    scored_papers.jsonl
    .
  • Each entry must include at least:
    score
    ,
    subtopic
    ,
    rationale
    ,
    alignment
    ,
    extraction
    .
  • The scoring range is fixed at 1-10 points; only papers with a score >=5 are assigned subtopics to avoid weak-related papers polluting subtopic planning.
  • Self-check whether the distribution is healthy: about 20-40% high scores, 40-60% medium scores, 10-30% low scores.

选文与 Bib 生成

Paper Selection and Bib Generation

  • select_references.py
    按目标参考范围和高分优先比例选出最终集合。
  • 生成
    selected_papers.jsonl
    references.bib
    selection_rationale.yaml
  • Bib 清洗必须保留:大小写无关去重 key、LaTeX 特殊字符转义、缺失字段警告。
  • 摘要缺失或过短的条目标记
    do_not_cite
    ,并在报告中提示摘要覆盖率风险。
  • select_references.py
    selects the final set according to the target reference range and high-score priority ratio.
  • Generate
    selected_papers.jsonl
    ,
    references.bib
    ,
    selection_rationale.yaml
    .
  • Bib cleaning must retain: case-insensitive deduplicated keys, LaTeX special character escaping, missing field warnings.
  • Entries with missing or too short abstracts are marked
    do_not_cite
    , and prompt the risk of abstract coverage in the report.

子主题与配额规划

Subtopic and Quota Planning

  • AI 基于评分结果规划 3-7 个子主题,并给出段落配额。
  • 默认思路:引言约 1.5k、讨论/展望各约 1k、结论约 0.6k,其余分给子主题段。
  • 结果写入工作条件与数据抽取表,作为写作锚点。
  • The AI plans 3-7 subtopics based on the scoring results and provides paragraph quotas.
  • Default approach: Introduction is about 1.5k words, discussion/prospects are about 1k words each, conclusion is about 0.6k words, and the rest are allocated to subtopic paragraphs.
  • The results are written into the working conditions and data extraction table as writing anchors.

字数预算

Word Count Budget

  • plan_word_budget.py
    生成 3 份预算 CSV,再汇总为
    word_budget_final.csv
  • 引用段与无引用段预算均需覆盖;总字数误差必须控制在
    config.yaml.word_budget.tolerance
    内。
  • Use
    plan_word_budget.py
    to generate 3 budget CSVs, then summarize into
    word_budget_final.csv
    .
  • Both quoted and non-quoted paragraph budgets must be covered; the total word count error must be controlled within
    config.yaml.word_budget.tolerance
    .

写作

Writing

  • 正文章节固定为:摘要、引言、子主题段、讨论、展望、结论。
  • 写作前读取
    word_budget_final.csv
    ,按文献综/述预算组织证据。
  • 默认采用单篇引用优先;引用要紧跟所支撑的观点,避免段末堆砌。
  • 如需详细写作规范,直接遵循:
    • references/expert-review-writing.md
    • references/review-tex-section-templates.md
  • Fixed sections of the main text: Abstract, Introduction, Subtopic Paragraphs, Discussion, Prospects, Conclusion.
  • Read
    word_budget_final.csv
    before writing, and organize evidence according to the literature review budget.
  • Single-paper citation priority is adopted by default; citations must follow the viewpoints they support, and avoid stacking at the end of paragraphs.
  • For detailed writing specifications, directly follow:
    • references/expert-review-writing.md
    • references/review-tex-section-templates.md

有机扩写与验证

Organic Expansion and Verification

  • 若字数不足,只允许在最短或证据不足的子主题段内做增量扩写,不新增子主题,不改原主张和引用。
  • 依次运行:
    • validate_counts.py
    • validate_review_tex.py
    • 可选
      validate_word_budget.py
    • generate_validation_report.py
  • If the word count is insufficient, only allow incremental expansion in the shortest or evidence-insufficient subtopic paragraphs, do not add new subtopics, and do not modify original claims and citations.
  • Run in sequence:
    • validate_counts.py
    • validate_review_tex.py
    • Optional
      validate_word_budget.py
    • generate_validation_report.py

导出与多语言

Export and Multi-Language

  • 通过
    compile_latex_with_bibtex.py
    生成 PDF。
  • 通过
    convert_latex_to_word.py
    生成 Word。
  • 如用户要求多语言版本,使用
    multi_language.py
    翻译正文并智能编译;失败时保留错误报告与 broken 文件,并优先支持恢复备份。
bash
undefined
  • Generate PDF via
    compile_latex_with_bibtex.py
    .
  • Generate Word via
    convert_latex_to_word.py
    .
  • If the user requests multi-language versions, use
    multi_language.py
    to translate the main text and compile intelligently; if it fails, retain the error report and broken files, and prioritize supporting backup recovery.
bash
undefined

查询文件已准备好:推荐主入口

查询文件已准备好:推荐主入口

python3 scripts/run_pipeline.py --topic "{主题}" --query-file ./queries.json --publish-dir ./review-deliverables
python3 scripts/run_pipeline.py --topic "{主题}" --query-file ./queries.json --publish-dir ./review-deliverables

两步式:先生成模板,再填充 input/queries.json 并恢复阶段 1

两步式:先生成模板,再填充 input/queries.json 并恢复阶段 1

python3 scripts/pipeline_runner.py --topic "{主题}" --work-dir <work-dir> --prepare-only python3 scripts/pipeline_runner.py --resume <work-dir> --resume-from 1 --publish-dir ./review-deliverables
python3 scripts/pipeline_runner.py --topic "{主题}" --work-dir <work-dir> --prepare-only python3 scripts/pipeline_runner.py --resume <work-dir> --resume-from 1 --publish-dir ./review-deliverables

临时兼容外部编排器:显式、可审计的单查询后备

临时兼容外部编排器:显式、可审计的单查询后备

python3 scripts/run_pipeline.py --topic "{主题}" --allow-single-query-fallback --fallback-reason "外部编排器暂未提供查询文件"
python3 scripts/run_pipeline.py --topic "{主题}" --allow-single-query-fallback --fallback-reason "外部编排器暂未提供查询文件"

旧入口 / resume

旧入口 / resume

python3 scripts/pipeline_runner.py --topic "{主题}" --domain general --query-file ./queries.json --publish-dir ./review-deliverables
python3 scripts/pipeline_runner.py --topic "{主题}" --domain general --query-file ./queries.json --publish-dir ./review-deliverables

显式指定 search Skill(独立安装环境)

显式指定 search Skill(独立安装环境)

python3 scripts/pipeline_runner.py --topic "{主题}" --query-file ./queries.json
--search-skill-root /path/to/research-literature-search python3 scripts/pipeline_runner.py --resume .bensz-api/task-{yyyymmdd-hhmm}-{简短描述}/research-literature-review/{run-id} --publish-dir ./review-deliverables
python3 scripts/pipeline_runner.py --topic "{主题}" --query-file ./queries.json
--search-skill-root /path/to/research-literature-search python3 scripts/pipeline_runner.py --resume .bensz-api/task-{yyyymmdd-hhmm}-{简短描述}/research-literature-review/{run-id} --publish-dir ./review-deliverables

阶段 3 评分后,从第 4 阶段继续

阶段 3 评分后,从第 4 阶段继续

python3 scripts/pipeline_runner.py --resume .bensz-api/task-{yyyymmdd-hhmm}-{简短描述}/research-literature-review/{run-id} --resume-from 4

`--resume-from` 只决定继续执行的阶段,不会绕过已有 `pipeline_state.json`。状态文件损坏时先备份或修复,禁止用空 state 覆盖历史 checkpoint。

- 运行环境:Python 3.9+、LaTeX(`xelatex`/`bibtex`)、pandoc。
- 关键脚本:
  - 检索:`multi_query_search.py`、`openalex_search.py`
  - 去重:`dedupe_papers.py`
  - 选文:`select_references.py`、`build_reference_bib_from_papers.py`
  - 数据抽取:`update_working_conditions_data_extraction.py`
  - 字数预算:`plan_word_budget.py`、`validate_word_budget.py`
  - 校验:`validate_counts.py`、`validate_review_tex.py`、`generate_validation_report.py`
  - 导出:`compile_latex_with_bibtex.py`、`convert_latex_to_word.py`

- 初始化:`python3 research-literature-review/scripts/pipeline_cost.py init`
- 抓取定价:`python3 research-literature-review/scripts/pipeline_cost.py fetch-prices`
- 记录 token:`pipeline_cost.py log ...`
- 汇总:`pipeline_cost.py summary`
- 所有成本数据写到内部 `output/cost/`(旧运行仍可显式使用 legacy 目录)。

- `references/ai_query_generation_prompt.md`
- `references/ai_scoring_prompt.md`
- `references/expert-review-writing.md`
- `references/review-tex-section-templates.md`
- `references/multilingual-guide.md`
- `references/development-validation-guide.md`
python3 scripts/pipeline_runner.py --resume .bensz-api/task-{yyyymmdd-hhmm}-{简短描述}/research-literature-review/{run-id} --resume-from 4

`--resume-from` only determines the phase to continue execution, and will not bypass the existing `pipeline_state.json`. When the state file is damaged, back up or repair it first, and prohibit overwriting historical checkpoints with empty state.

- Runtime environment: Python 3.9+, LaTeX (`xelatex`/`bibtex`), pandoc.
- Key scripts:
  - Retrieval: `multi_query_search.py`, `openalex_search.py`
  - Deduplication: `dedupe_papers.py`
  - Paper selection: `select_references.py`, `build_reference_bib_from_papers.py`
  - Data extraction: `update_working_conditions_data_extraction.py`
  - Word count budget: `plan_word_budget.py`, `validate_word_budget.py`
  - Verification: `validate_counts.py`, `validate_review_tex.py`, `generate_validation_report.py`
  - Export: `compile_latex_with_bibtex.py`, `convert_latex_to_word.py`

- Initialization: `python3 research-literature-review/scripts/pipeline_cost.py init`
- Fetch pricing: `python3 research-literature-review/scripts/pipeline_cost.py fetch-prices`
- Record tokens: `pipeline_cost.py log ...`
- Summary: `pipeline_cost.py summary`
- All cost data is written to internal `output/cost/` (old runs can still explicitly use the legacy directory).

- `references/ai_query_generation_prompt.md`
- `references/ai_scoring_prompt.md`
- `references/expert-review-writing.md`
- `references/review-tex-section-templates.md`
- `references/multilingual-guide.md`
- `references/development-validation-guide.md`

输出

Output

默认发布以下核心文件(通过
--publish-dir
指定正式目录时复制):
  • {主题}_review.pdf
  • {主题}_review.docx
可选支持性文件(使用
--include-supporting
发布)包括
{主题}_工作条件.md
{主题}_review.tex
{主题}_参考文献.bib
{主题}_验证报告.md
。字数预算、候选文献、评分、选文、摘要补齐和证据卡始终属于内部中间产物,不进入正式发布目录。
必要中间产物包括:
  • papers*.jsonl
  • scored_papers.jsonl
  • selected_papers.jsonl
  • selection_rationale.yaml
  • 可选
    evidence_cards_{主题}.jsonl
The following core files are published by default (copied when specifying the official directory via
--publish-dir
):
  • {Topic}_review.pdf
  • {Topic}_review.docx
Optional supporting files (published using
--include-supporting
) include
{Topic}_Working_Conditions.md
,
{Topic}_review.tex
,
{Topic}_References.bib
and
{Topic}_Verification_Report.md
. Word count budgets, candidate papers, scores, paper selections, abstract supplements and evidence cards are always internal intermediate products and do not enter the official publication directory.
Necessary intermediate products include:
  • papers*.jsonl
  • scored_papers.jsonl
  • selected_papers.jsonl
  • selection_rationale.yaml
  • Optional
    evidence_cards_{Topic}.jsonl

输出管理

Output Management

本 Skill 的新任务中间文件统一写入
./.bensz-api/task-{yyyymmdd-hhmm}-{简短描述}/{skill名}/input|output|log/
。同一任务复用一个任务根目录;多 Skill 协作才创建
shared/
。正式交付物不写入该目录,历史隐藏目录只允许显式兼容读取、迁移或清理。
  • 默认
    run_pipeline.py
    将运行目录放在
    .bensz-api/task-{yyyymmdd-hhmm}-{简短描述}/research-literature-review/<run-id>/
    ;查询输入位于
    input/
    ,内部状态和产物位于
    output/
    下的
    artifacts/
    reference/
    cache/
    scripts/
    deliverables/
    (支持性文件单独位于
    deliverables/supporting/
    )。
  • 正式交付目录必须通过
    --publish-dir
    显式指定,并且只接收 PDF/Word(或显式开启的支持性文件)。不要把正式目录作为
    --work-dir
  • AI 临时脚本必须放到内部
    output/scripts/
    ;不要把临时文件写到运行目录根部,不要使用绝对路径写
    /tmp/*
    ,也不要读写其他 run 目录。
  • 以环境变量
    SYSTEMATIC_LITERATURE_REVIEW_SCOPE_ROOT
    SYSTEMATIC_LITERATURE_REVIEW_SCRIPTS_DIR
    为准。
  • search bundle 位于当前 review run 的
    output/artifacts/search_bundle_{stem}/
    ,review 只读消费其 manifest 指向的相对路径;不得跨 run 猜测或直接信任外部绝对 artifact 路径。
Intermediate files of new tasks for this Skill are uniformly written to
./.bensz-api/task-{yyyymmdd-hhmm}-{short-description}/{skill-name}/input|output|log/
. The same task reuses a single task root directory;
shared/
is created only for multi-Skill collaboration. Official deliverables are not written to this directory, and historical hidden directories only allow explicit compatible reading, migration or cleaning.
  • By default,
    run_pipeline.py
    places the running directory in
    .bensz-api/task-{yyyymmdd-hhmm}-{short-description}/research-literature-review/<run-id>/
    ; query input is located in
    input/
    , and internal state and products are located under
    output/
    in
    artifacts/
    ,
    reference/
    ,
    cache/
    ,
    scripts/
    ,
    deliverables/
    (supporting files are separately located in
    deliverables/supporting/
    ).
  • The official delivery directory must be explicitly specified via
    --publish-dir
    , and only accepts PDF/Word (or supporting files explicitly enabled). Do not use the official directory as
    --work-dir
    .
  • AI temporary scripts must be placed in internal
    output/scripts/
    ; do not write temporary files to the root of the running directory, do not use absolute paths to write
    /tmp/*
    , and do not read or write other run directories.
  • Follow the environment variables
    SYSTEMATIC_LITERATURE_REVIEW_SCOPE_ROOT
    and
    SYSTEMATIC_LITERATURE_REVIEW_SCRIPTS_DIR
    .
  • The search bundle is located in
    output/artifacts/search_bundle_{stem}/
    of the current review run; the review reads only the relative path pointed to by its manifest in read-only mode; do not guess across runs or directly trust external absolute artifact paths.

校验

Verification

完成后执行 Skill 已有的静态检查、脚本验证或人工复核,并记录通过标准。
After completion, perform the existing static checks, script verification or manual review of the Skill, and record the passing standards.

失败与恢复

Failure and Recovery

保留错误证据和已完成产物;仅在输入、环境或外部依赖恢复后从最近的失败步骤重试。
Retain error evidence and completed products; only retry from the nearest failed step after input, environment or external dependencies are restored.

约束

Constraints

  • 强制导出 PDF 与 Word;只有明确失败并记录原因时才允许缺失。
  • 正文字数与参考文献数必须落在当前档位范围内;可由用户覆盖,默认值以
    config.yaml
    为准。
  • 正文固定包含:摘要、引言、至少 1 个子主题段、讨论、展望、结论。
  • \cite{key}
    必须与 BibTeX key 一致;缺失即报错。
  • 正文禁止泄露 AI 工作流,例如“检索/去重/评分/选文/字数预算”等元叙事只能写入
    {主题}_工作条件.md
  • 摘要必须为单段,避免方法学流水账;表格宽度与样式约束见
    references/review-tex-section-templates.md
  • 不为凑引用而堆砌低分文献;无法确认时优先不改、不引。
  • 多查询 JSON 缺失、冲突、不可解析、有效查询少于配置下限或超过上限时,阶段 1 必须 fail-closed;不得以成功退出码伪装成多查询完成。
  • 只有调用方显式传入
    --allow-single-query-fallback
    时才允许执行一次单查询,并在 state 与 Search Log 中记录模式、来源、原因和警告。
  • Mandatory export of PDF and Word; missing is only allowed when explicitly failed and the reason is recorded.
  • The number of main text words and references must fall within the current tier range; it can be overwritten by the user, and the default value is based on
    config.yaml
    .
  • The main text must include: Abstract, Introduction, at least 1 subtopic paragraph, Discussion, Prospects, Conclusion.
  • \cite{key}
    must be consistent with the BibTeX key; an error is reported if missing.
  • The main text is prohibited from disclosing the AI workflow; for example, meta-narratives such as "retrieval/deduplication/scoring/paper selection/word count budgeting" can only be written into
    {Topic}_Working_Conditions.md
    .
  • The abstract must be a single paragraph, avoiding methodological flowcharts; table width and style constraints are specified in
    references/review-tex-section-templates.md
    .
  • Do not stack low-score papers to meet citation requirements; when unsure, prioritize not modifying or citing.
  • When multi-query JSON is missing, conflicting, unparseable, or the number of valid queries is less than the configuration lower limit or exceeds the upper limit, Phase 1 must fail-closed; do not pretend to complete multi-query with a successful exit code.
  • Only when the caller explicitly passes
    --allow-single-query-fallback
    is single query allowed to be executed once, and the mode, source, reason and warning are recorded in the state and Search Log.

公共硬约束

Common Hard Constraints

  • 任务需要落盘时,使用唯一的
    ./.bensz-api/task-{yyyymmdd-hhmm}-{简短描述}/
    根目录;共享材料放入
    shared/
    ,Skill 专属材料放入该 Skill 的
    input/
    output/
    log/
  • 正式交付物、源代码和正式计划按项目约定保存,不写入任务工作区;未经授权不覆盖、删除、迁移或远程写入。
  • 项目维护变更检查 BAC 可用性并记录需求、AI 产出、工具结果、文件改动和验证摘要;BAC 只做过程审计,不替代署名、责任或合规判断。
  • 不记录 API Key、访问令牌、密码、Cookie、环境/凭据文件、私有 Prompt、身份信息、本地用户名、主机名或不必要的大体积原始数据。
  • 文件路径必须规范化并限制在授权项目范围内;外部 URL、子进程和网络访问遵循最小权限,防止路径遍历、SSRF 和命令注入。
  • Skill 版本唯一记录在自身
    config.yaml:skill_info.version
    ;公开 API、协议、目录或配置变更同步文档与
    CHANGELOG.md
  • 仅将 Skill 或 Bensz 基础设施本身的设计缺陷交给
    bensz-collect-bugs
    ;先脱敏写入
    ~/.bensz-skills/bugs/
    ,当前任务不中断,只有用户明确要求才公开上报,禁止直接修改用户已安装的 Skill 源码。
<!-- End of canonical common constraints. -->
  • When the task needs to be persisted to disk, use a unique
    ./.bensz-api/task-{yyyymmdd-hhmm}-{short-description}/
    root directory; shared materials are placed in
    shared/
    , and Skill-specific materials are placed in the Skill's
    input/
    ,
    output/
    ,
    log/
    .
  • Official deliverables, source code and official plans are saved according to project agreements, and are not written to the task workspace; do not overwrite, delete, migrate or remotely write without authorization.
  • Project maintenance changes check BAC availability and record requirements, AI output, tool results, file changes and verification summaries; BAC only performs process audits and does not replace signature, responsibility or compliance judgments.
  • Do not record API Keys, access tokens, passwords, Cookies, environment/credential files, private Prompts, identity information, local usernames, hostnames or unnecessary large-volume raw data.
  • File paths must be normalized and restricted within authorized project scopes; external URLs, subprocesses and network access follow the principle of least privilege to prevent path traversal, SSRF and command injection.
  • Skill version is uniquely recorded in its own
    config.yaml:skill_info.version
    ; public API, protocol, directory or configuration changes are synchronized with documents and
    CHANGELOG.md
    .
  • Only design defects of the Skill or Bensz infrastructure itself are submitted to
    bensz-collect-bugs
    ; first desensitize and write to
    ~/.bensz-skills/bugs/
    , do not interrupt the current task, and only report publicly when the user explicitly requests it. It is strictly forbidden to directly modify the source code of the Skill installed by the user.
<!-- End of canonical common constraints. -->

Skill 专属约束

Skill-Specific Constraints

不得超出本 Skill description 和上方流程所声明的范围;不将未验证的信息伪装成确定结论。
Do not exceed the scope stated in this Skill description and the above process; do not disguise unverified information as definite conclusions.