Skill: willoscar/chapter-skeleton (version 1.0.0)

--- name: chapter-skeleton description: 'Build a retrieval-informed chapter skeleton (`outline/chapter_skeleton.yml`) from taxonomy/core scope before stable H3 decomposition. **Trigger**: chapter skeleton, chapter-level outline, H2 skeleton, section-first survey, 章节骨架, 章级骨架. **Use when**: survey structure should stabilize chapter-level intent before subsection mapping and writing cards. **Skip if**: `outline/chapter_skeleton.yml` already exists and is refined. **Network**: none. **Guardrail**: NO PROSE; do not invent papers; keep output chapter-level only.' version: 0.1.0 metadata: openclaw: requires: anyBins: - python3 - python --- # Chapter Skeleton ## Load Order Always read: - `references/overview.md` Use `scripts/run.py` only for deterministic materialization: - load taxonomy / scope hints - emit `outline/chapter_skeleton.yml` - preserve existing non-placeholder user work ## Inputs - `outline/taxonomy.yml` - Optional: `GOAL.md` ## Outputs - `outline/chapter_skeleton.yml` ## Asset contract - `assets/output_contract.json` ## Script ### Quick Start - `python scripts/run.py --workspace <workspace_dir>`

path: AGENTS.md
content: # AGENTS.md

This exported skill uses `AGENTS.md` only as a local repo-root marker for bundled helper scripts.
Source skill: `chapter-skeleton` from `research-units-pipeline-skills`.
Export slug: `chapter-skeleton`.


path: assets/output_contract.json
content: {
  "artifact": "outline/chapter_skeleton.yml",
  "required_fields": [
    "id",
    "title",
    "rationale",
    "seed_topics",
    "target_h3_count"
  ]
}


path: pipelines/arxiv-survey-latex.pipeline.md
content: ---
name: arxiv-survey-latex
version: 3.8
variant_of: arxiv-survey
variant_overrides:
  routing_hints: [latex, pdf, tex, 可编译, 编译]
  routing_default: false
  routing_priority: 20
  units_template: templates/UNITS.arxiv-survey-latex.csv
  target_artifacts:
    __append__:
      - latex/main.tex
      - latex/main.pdf
      - output/LATEX_BUILD_REPORT.md
  stages:
    C5:
      title: Draft + PDF
      required_skills:
        __append__:
          - latex-scaffold
          - latex-compile-qa
      optional_skills:
        __remove__:
          - latex-scaffold
          - latex-compile-qa
      produces:
        __append__:
          - latex/main.tex
          - latex/main.pdf
          - output/LATEX_BUILD_REPORT.md
---

# Pipeline: arXiv survey / review (MD-first + LaTeX/PDF)

Variant of `arxiv-survey`.

Use this pipeline only when the default deliverable must include:

- `latex/main.tex`
- `latex/main.pdf`
- `output/LATEX_BUILD_REPORT.md`

All non-PDF survey behavior, defaults, checkpoints, and earlier stages inherit from `arxiv-survey`.


path: pipelines/idea-brainstorm.pipeline.md
content: ---
name: idea-brainstorm
version: 4.0
profile: idea-brainstorm
routing_hints: [idea, ideation, brainstorm, 点子, 选题, 找方向, 找 idea]
routing_priority: 30
target_artifacts:
  - STATUS.md
  - UNITS.csv
  - CHECKPOINTS.md
  - DECISIONS.md
  - GOAL.md
  - queries.md
  - output/trace/IDEA_BRIEF.md
  - papers/papers_raw.jsonl
  - papers/papers_dedup.jsonl
  - papers/core_set.csv
  - papers/retrieval_report.md
  - outline/taxonomy.yml
  - papers/paper_notes.jsonl
  - papers/evidence_bank.jsonl
  - output/trace/IDEA_SIGNAL_TABLE.md
  - output/trace/IDEA_SIGNAL_TABLE.jsonl
  - output/trace/IDEA_DIRECTION_POOL.md
  - output/trace/IDEA_DIRECTION_POOL.jsonl
  - output/trace/IDEA_SCREENING_TABLE.md
  - output/trace/IDEA_SCREENING_TABLE.jsonl
  - output/trace/IDEA_SHORTLIST.md
  - output/trace/IDEA_SHORTLIST.jsonl
  - output/REPORT.md
  - output/APPENDIX.md
  - output/REPORT.json
  - output/DELIVERABLE_SELFLOOP_TODO.md
  - output/QUALITY_GATE.md
  - output/RUN_ERRORS.md
  - output/CONTRACT_REPORT.md
default_checkpoints: [C0,C1,C2,C3,C4,C5]
units_template: templates/UNITS.idea-brainstorm.csv
contract_model: pipeline.frontmatter/v1
query_defaults:
  draft_profile: idea_brainstorm
  max_results: 1800
  core_size: 100
  evidence_mode: abstract
  direction_pool_min: 12
  direction_pool_max: 24
  idea_screen_top_n: 10
  idea_shortlist_size: 5
  report_top_n: 3
overridable_query_fields:
  - keywords
  - exclude
  - max_results
  - core_size
  - evidence_mode
  - direction_pool_min
  - direction_pool_max
  - idea_screen_top_n
  - idea_shortlist_size
  - report_top_n
  - time_window.from
  - time_window.to
quality_contract:
  memo_bundle:
    required_outputs: [output/REPORT.md, output/APPENDIX.md, output/REPORT.json]
  signal_policy:
    min_rows: 10
  direction_policy:
    shortlist_min: 3
    shortlist_max: 5
    keep_min: 3
    cluster_diversity_min: 2
    lead_diversity_target: 3
    lead_diversity_axes: [cluster, direction_type, program_kind]
  screening_policy:
    keep_rank_max: 7
    maybe_rank_max: 12
    score_weights:
      discussion_worthiness: 0.24
      academic_value: 0.22
      evidence_grounding: 0.18
      direction_distinctness: 0.16
      first_probe_clarity: 0.10
      thesis_potential: 0.10
loop_policy:
  stage_retry_budget:
    C1: 2
    C3: 1
    C4: 1
  max_reroutes: 4
  require_human_on_retry_after_approval: true
stages:
  C0:
    title: Init + idea brief
    mode: no_prose
    required_skills: [workspace-init, pipeline-router, idea-brief, human-checkpoint]
    optional_skills: []
    produces: [STATUS.md, UNITS.csv, CHECKPOINTS.md, DECISIONS.md, GOAL.md, queries.md, output/trace/IDEA_BRIEF.md, output/QUALITY_GATE.md, output/RUN_ERRORS.md]
    human_checkpoint:
      approve: brainstorm brief
      write_to: DECISIONS.md
  C1:
    title: Retrieval + core set
    mode: no_prose
    required_skills: [literature-engineer, dedupe-rank]
    optional_skills: []
    produces: [papers/papers_raw.jsonl, papers/papers_dedup.jsonl, papers/core_set.csv, papers/retrieval_report.md]
  C2:
    title: Idea landscape / focus
    mode: no_prose
    required_skills: [taxonomy-builder, pipeline-router, human-checkpoint]
    optional_skills: []
    produces: [outline/taxonomy.yml, DECISIONS.md]
    human_checkpoint:
      approve: focus clusters / lenses + exclusions
      write_to: DECISIONS.md
  C3:
    title: Evidence signals
    mode: no_prose
    required_skills: [paper-notes, idea-signal-mapper]
    optional_skills: []
    produces: [papers/paper_notes.jsonl, papers/evidence_bank.jsonl, output/trace/IDEA_SIGNAL_TABLE.md, output/trace/IDEA_SIGNAL_TABLE.jsonl]
  C4:
    title: Direction pool + screening
    mode: short_prose_ok
    required_skills: [idea-direction-generator, idea-screener]
    optional_skills: []
    produces: [output/trace/IDEA_DIRECTION_POOL.md, output/trace/IDEA_DIRECTION_POOL.jsonl, output/trace/IDEA_SCREENING_TABLE.md, output/trace/IDEA_SCREENING_TABLE.jsonl]
  C5:
    title: Shortlist + memo synthesis + self-loop
    mode: prose_allowed
    required_skills: [idea-shortlist-curator, idea-memo-writer, deliverable-selfloop, artifact-contract-auditor]
    optional_skills: []
    produces: [output/trace/IDEA_SHORTLIST.md, output/trace/IDEA_SHORTLIST.jsonl, output/REPORT.md, output/APPENDIX.md, output/REPORT.json, output/DELIVERABLE_SELFLOOP_TODO.md, output/CONTRACT_REPORT.md]
---

# Pipeline: research idea brainstorm (signals -> directions -> memo)

Goal: produce a **discussion-ready research-idea memo** for PI / PhD readers.

This pipeline is for “找 research idea / brainstorm / 选题 / 找方向”.
It is **not** for writing a survey draft and **not** for generating execution-grade project specs.

The terminal deliverable is a single default entrypoint:
- `output/REPORT.md`

That memo should feel like a mature brainstorm artifact:
- grounded in literature,
- small enough to discuss,
- clear about what is promising,
- honest about uncertainty,
- and rich enough to guide the next discussion round.

Artifact policy:
- Reader-facing terminal artifacts:
  - `output/REPORT.md`
  - `output/APPENDIX.md`
  - `output/REPORT.json`
- Trace artifacts stay under `output/trace/`.
- The run is only shareable when both layers exist and pass contract audit.

Default profile:
- Retrieval route: `literature-engineer`
- `core_size=100`
- Evidence mode: `abstract`
- Signal table: 10-20 rows
- Direction pool: 12-24
- Shortlist: 3-5
- Final memo lead directions: 3

## Stage 0 - Init + idea brief (C0)
required_skills:
- workspace-init
- pipeline-router
- idea-brief
- human-checkpoint
produces:
- STATUS.md
- UNITS.csv
- CHECKPOINTS.md
- DECISIONS.md
- GOAL.md
- queries.md
- output/trace/IDEA_BRIEF.md

Notes:
- The brief is the single source of truth for topic, audience, constraints, exclusions, targets, and query buckets.
- Default behavior: block once at C0 for human approval of the brief before retrieval.

## Stage 1 - Retrieval + core set (C1)
required_skills:
- literature-engineer
- dedupe-rank
produces:
- papers/papers_raw.jsonl
- papers/papers_dedup.jsonl
- papers/core_set.csv
- papers/retrieval_report.md

Notes:
- Use multi-query buckets from `queries.md`.
- If recall is too low/noisy, fix it upstream and rerun C1.

## Stage 2 - Idea landscape / focus (C2) [NO PROSE]
required_skills:
- taxonomy-builder
- pipeline-router
- human-checkpoint
produces:
- outline/taxonomy.yml
- DECISIONS.md

human_checkpoint:
- approve: focus clusters / lenses + exclusions
- write_to: DECISIONS.md

Notes:
- Taxonomy is an idea landscape, not a paper outline.
- Default behavior: pause at C2 so the human can choose a few promising focus lenses.

## Stage 3 - Evidence signals (C3) [table-first]
required_skills:
- paper-notes
- idea-signal-mapper
produces:
- papers/paper_notes.jsonl
- papers/evidence_bank.jsonl
- output/trace/IDEA_SIGNAL_TABLE.md
- output/trace/IDEA_SIGNAL_TABLE.jsonl

Notes:
- The signal table should capture tensions, missing pieces, and academically meaningful axes rather than proposal-ready wedges.
- Keep this stage compact and table-first; no long prose.

## Stage 4 - Direction pool + screening (C4)
required_skills:
- idea-direction-generator
- idea-screener
produces:
- output/trace/IDEA_DIRECTION_POOL.md
- output/trace/IDEA_DIRECTION_POOL.jsonl
- output/trace/IDEA_SCREENING_TABLE.md
- output/trace/IDEA_SCREENING_TABLE.jsonl

Notes:
- Expansion should generate discussion-worthy research directions, not an operator cartesian product.
- Screening should score discussion value, distinctness, evidence grounding, and thesis potential.

## Stage 5 - Shortlist + memo synthesis + self-loop (C5)
required_skills:
- idea-shortlist-curator
- idea-memo-writer
- deliverable-selfloop
- artifact-contract-auditor
produces:
- output/trace/IDEA_SHORTLIST.md
- output/trace/IDEA_SHORTLIST.jsonl
- output/REPORT.md
- output/APPENDIX.md
- output/REPORT.json
- output/DELIVERABLE_SELFLOOP_TODO.md
- output/CONTRACT_REPORT.md

Notes:
- `output/trace/IDEA_SHORTLIST.md` is an internal convergence layer, not the user-facing final answer.
- `output/REPORT.md` is the terminal deliverable and should read like a discussion-ready research idea brainstorm memo.
- `deliverable-selfloop` should evaluate the full memo bundle plus its trace chain.


path: pipelines/lit-snapshot.pipeline.md
content: ---
name: lit-snapshot
version: 2.3
profile: lit-snapshot
routing_hints: [snapshot, 快照, one-page, one page, 48h]
routing_priority: 30
target_artifacts:
  - STATUS.md
  - UNITS.csv
  - CHECKPOINTS.md
  - DECISIONS.md
  - GOAL.md
  - queries.md
  - papers/papers_raw.jsonl
  - papers/papers_dedup.jsonl
  - papers/core_set.csv
  - outline/taxonomy.yml
  - outline/outline.yml
  - output/SNAPSHOT.md
  - output/DELIVERABLE_SELFLOOP_TODO.md
  - output/QUALITY_GATE.md
  - output/RUN_ERRORS.md
  - output/CONTRACT_REPORT.md
default_checkpoints: [C0,C1,C2,C3]
units_template: templates/UNITS.lit-snapshot.csv
---

# Pipeline: literature snapshot (24-48h) [bullets-first]

Goal: a compact, reader-facing snapshot (`output/SNAPSHOT.md`) with a small but usable paper set and a paper-like structure. This is intentionally lighter than `arxiv-survey*` (no evidence packs, no BibTeX, no LaTeX).

## Stage 0 - Init (C0)
required_skills:
- workspace-init
- pipeline-router
produces:
- STATUS.md
- UNITS.csv
- CHECKPOINTS.md
- DECISIONS.md
- GOAL.md
- queries.md

## Stage 1 - Retrieval & core set (C1)
required_skills:
- arxiv-search
- dedupe-rank
optional_skills:
- keyword-expansion
produces:
- papers/papers_raw.jsonl
- papers/papers_dedup.jsonl
- papers/core_set.csv

Notes:
- Snapshot default: aim for a smaller but diverse set (e.g., core_set ~20-40) rather than a survey-scale pool.
- Practical retrieval loop (multi-query, then refine):
  - Start broad with multiple query buckets (synonyms/acronyms/subtopics) and merge the results.
  - If too few: add buckets + widen time window; if too noisy: rewrite keywords + add exclusions; rerun C1.
- If the snapshot feels generic, the fix is almost always upstream: broaden `queries.md` (more synonyms, fewer excludes, wider time window) and rerun C1.

## Stage 2 - Structure (C2) [NO PROSE]
required_skills:
- taxonomy-builder
- outline-builder
optional_skills:
- outline-budgeter
produces:
- outline/taxonomy.yml
- outline/outline.yml
human_checkpoint:
- approve: scope + outline (snapshot ToC)
- write_to: DECISIONS.md

Notes:
- Paper-like default: prefer fewer, thicker sections. For snapshots, avoid H3 explosion; treat H2 as the main organizing unit.
- If the outline is over-fragmented, use `outline-budgeter` (NO PROSE) to merge adjacent nodes and keep the ToC readable before writing.

## Stage 3 - Snapshot (C3) [SHORT PROSE OK]
required_skills:
- snapshot-writer
- deliverable-selfloop
- artifact-contract-auditor
optional_skills:
- prose-writer
produces:
- output/SNAPSHOT.md
- output/DELIVERABLE_SELFLOOP_TODO.md
- output/CONTRACT_REPORT.md

Notes:
- The deliverable is bullets-first and pointer-heavy: every non-trivial claim should attach 1-2 concrete paper pointers from `papers/core_set.csv`.
- Avoid outline narration (e.g., `This section surveys ...`); write content claims + why-it-matters + pointers.


path: pipelines/peer-review.pipeline.md
content: ---
name: peer-review
version: 2.3
profile: peer-review
routing_hints: [peer review, review report, referee, 审稿]
routing_priority: 30
target_artifacts:
  - STATUS.md
  - UNITS.csv
  - CHECKPOINTS.md
  - DECISIONS.md
  - GOAL.md
  - queries.md
  - output/PAPER.md
  - output/CLAIMS.md
  - output/MISSING_EVIDENCE.md
  - output/NOVELTY_MATRIX.md
  - output/REVIEW.md
  - output/DELIVERABLE_SELFLOOP_TODO.md
  - output/QUALITY_GATE.md
  - output/RUN_ERRORS.md
  - output/CONTRACT_REPORT.md
default_checkpoints: [C0,C1,C2,C3]
units_template: templates/UNITS.peer-review.csv
---

# Pipeline: peer review / referee report

Goal: produce an actionable referee report (`output/REVIEW.md`) that is traceable to the submitted paper’s claims and evidence (no free-floating advice, no invented comparisons).

## Stage 0 - Init (C0)
required_skills:
- workspace-init
- pipeline-router
produces:
- STATUS.md
- UNITS.csv
- CHECKPOINTS.md
- DECISIONS.md
- GOAL.md

## Stage 1 - Claims (C1)
required_skills:
- manuscript-ingest
- claims-extractor
produces:
- output/PAPER.md
- output/CLAIMS.md

Notes:
- Input expectation: you must have the manuscript text available as `output/PAPER.md` (or equivalent extracted text) before running this stage.
- Contract: every claim must include a source pointer (section/page/quote) so later critique is auditable.

## Stage 2 - Evidence audit (C2)
required_skills:
- evidence-auditor
- novelty-matrix
produces:
- output/MISSING_EVIDENCE.md
- output/NOVELTY_MATRIX.md

Notes:
- Evidence-auditor should write gaps/risks/verification steps, not “fix the paper”.
- Novelty-matrix should be conservative: compare against cited/known related work; if you lack sources, record that limitation explicitly.

## Stage 3 - Rubric write-up (C3)
required_skills:
- rubric-writer
- deliverable-selfloop
- artifact-contract-auditor
produces:
- output/REVIEW.md
- output/DELIVERABLE_SELFLOOP_TODO.md
- output/CONTRACT_REPORT.md

Notes:
- Prefer concrete, minimal fixes (what experiment/ablation/analysis would resolve the concern) over generic “needs more experiments”.


path: pipelines/systematic-review.pipeline.md
content: ---
name: systematic-review
version: 2.3
profile: systematic-review
routing_hints: [systematic review, systematic, prisma, 系统综述]
routing_priority: 30
target_artifacts:
  - STATUS.md
  - UNITS.csv
  - CHECKPOINTS.md
  - DECISIONS.md
  - GOAL.md
  - queries.md
  - output/PROTOCOL.md
  - papers/papers_raw.jsonl
  - papers/retrieval_report.md
  - papers/papers_dedup.jsonl
  - papers/core_set.csv
  - papers/screening_log.csv
  - papers/extraction_table.csv
  - output/SYNTHESIS.md
  - output/DELIVERABLE_SELFLOOP_TODO.md
  - output/QUALITY_GATE.md
  - output/RUN_ERRORS.md
  - output/CONTRACT_REPORT.md
default_checkpoints: [C0,C1,C2,C3,C4,C5]
units_template: templates/UNITS.systematic-review.csv
---

# Pipeline: systematic review (PRISMA-style)

## Stage 0 - Init (C0)
required_skills:
- workspace-init
- pipeline-router
produces:
- STATUS.md
- UNITS.csv
- CHECKPOINTS.md
- DECISIONS.md
- GOAL.md
- queries.md

## Stage 1 - Protocol (C1)
required_skills:
- protocol-writer
produces:
- output/PROTOCOL.md
human_checkpoint:
- approve: protocol locked (query, inclusion/exclusion, databases, time window)
- write_to: DECISIONS.md

## Stage 2 - Retrieval & candidate pool (C2)
required_skills:
- literature-engineer
- dedupe-rank
optional_skills:
- keyword-expansion
- arxiv-search
produces:
- papers/papers_raw.jsonl
- papers/retrieval_report.md
- papers/papers_dedup.jsonl
- papers/core_set.csv

Notes:
- Systematic-review contract: keep the candidate pool auditable. Prefer dedupe (good) over aggressive ranking/filtering (dangerous).
- `dedupe-rank` default: for this pipeline, it keeps the full deduped pool in `papers/core_set.csv` unless you explicitly set `queries.md:core_size` (screening should not silently drop papers).

## Stage 3 - Screening (C3)
required_skills:
- screening-manager
produces:
- papers/screening_log.csv

Notes:
- Use `papers/papers_dedup.jsonl` (or `papers/core_set.csv`) as the candidate list; `papers/screening_log.csv` must include protocol-grounded reasons for every decision.
- Practical auditability: number protocol clauses (`I1..` / `E1..`) and require screening rows to cite them (e.g., `reason_codes=E3`).

## Stage 4 - Extraction (C4)
required_skills:
- extraction-form
- bias-assessor
produces:
- papers/extraction_table.csv

Notes:
- Extraction is schema-driven: do not write narrative synthesis here; keep all fields consistent and fill bias fields (low/unclear/high + notes).

## Stage 5 - Synthesis (C5) [PROSE ALLOWED]
required_skills:
- synthesis-writer
- deliverable-selfloop
- artifact-contract-auditor
produces:
- output/SYNTHESIS.md
- output/DELIVERABLE_SELFLOOP_TODO.md
- output/CONTRACT_REPORT.md


path: references/overview.md
content: # Chapter Skeleton — Overview

Goal:
- stabilize chapter-level structure before the run commits to H3 ids

Output expectations:
- one record per core chapter
- chapter ids and titles are stable
- include a short rationale and a small seed topic list
- include a target H3 count, but do not emit H3 ids yet

Guardrails:
- chapter-level only
- no reader-facing prose
- do not encode full subsection writing plans here


path: tooling/__init__.py
content: 


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (CRITICAL)