Literature Engineer (evidence collector)
Triggers & routing
- Trigger: evidence collector, literature engineer, 文献扩充, 多路召回, snowballing, cited by, references, 元信息增强, provenance.
- Use when: Workflow 需要按锁定的 retrieval policy 扩充候选文献并补齐可追溯 metadata。
Goal: build a large, verifiable candidate pool for downstream dedupe/rank, mapping, notes, citations, and drafting.
This skill is intentionally evidence-first: if you can't reach the target size with verifiable IDs/provenance, the correct behavior is to block and ask for more exports / enable network, not to fabricate.
Load Order
Always read:
references/domain_pack_overview.md — how domain packs drive topic-specific behavior
Domain packs (loaded by topic match):
assets/domain_packs/llm_agents.json — pinned classic/survey arXiv IDs for LLM agent topics
Script Boundary
Use scripts/run.py only for:
- multi-route offline import, normalization, and provenance tagging
- online arXiv/Semantic Scholar API retrieval
- snowball expansion and deduplication
- retrieval report generation
Do not treat run.py as the place for:
- hardcoded pinned arXiv ID lists (use domain packs)
- hardcoded topic detection logic (use domain packs)
Inputs
queries.md
keywords, exclude, max_results, time window
- Optional offline sources (any combination; all are merged):
papers/import.(csv|json|jsonl|bib)
papers/arxiv_export.(csv|json|jsonl|bib)
papers/imports/*.(csv|json|jsonl|bib)
- Optional snowball exports (offline):
papers/snowball/*.(csv|json|jsonl|bib)
Outputs
papers/papers_raw.jsonl
- 1 record per line; minimum fields:
title (str), authors (list[str]), year (int|""), url (str)
- stable identifier(s):
arxiv_id and/or doi
abstract (str; may be empty in offline mode)
source (str) + provenance (list[dict])
papers/papers_raw.csv (human scan)
papers/retrieval_report.md (route counts, missing-meta stats, next actions)
Workflow (multi-route)
- Offline-first merge: ingest all available offline exports (and label provenance per file).
- Online retrieval (optional): if enabled, run arXiv API retrieval for each keyword query.
- Snowballing (optional): expand from seed papers via references/cited-by (online), or merge offline snowball exports.
- Normalize + dedupe: canonicalize IDs/URLs, merge duplicates while unioning
provenance.
- Report: write a concise retrieval report with coverage buckets and missing-meta counts.
Quality checklist
Script
Quick Start
uv run python .codex/skills/literature-engineer/scripts/run.py --help
All Options
- See
uv run python .codex/skills/literature-engineer/scripts/run.py --help.
- Reads retrieval config from
queries.md.
- Offline inputs (merged if present):
papers/import.(csv|json|jsonl|bib), papers/arxiv_export.(csv|json|jsonl|bib), papers/imports/*.(csv|json|jsonl|bib).
- Optional offline snowball inputs:
papers/snowball/*.(csv|json|jsonl|bib).
- Online expansion requires network: use
--online and/or --snowball.
- Online retrieval is best-effort: arXiv API can be flaky in some environments; the script will also attempt a Semantic Scholar route when needed.
- For LLM-agent topics, the script also performs a best-effort pinned arXiv id_list fetch (canonical classics like ReAct/Toolformer/Reflexion/Voyager/Tree-of-Thoughts + a small prior-survey seed set) so
ref.bib can include must-cite anchors even when keyword search misses them.
- If HTTPS/TLS to external domains is unstable, the Semantic Scholar route is fetched via the
r.jina.ai proxy so the pipeline can still self-boot without manual exports.
- When an online run returns
0 records due to transient network errors, a simple rerun is often sufficient (the pipeline should not fabricate).
Examples
Offline imports only:
- Put exports under
papers/imports/ then run:
uv run python .codex/skills/literature-engineer/scripts/run.py --workspace <workspace>
Explicit offline inputs (multi-route):
uv run python .codex/skills/literature-engineer/scripts/run.py --workspace <workspace> --input path/to/a.bib --input path/to/b.jsonl
Online arXiv retrieval (needs network):
uv run python .codex/skills/literature-engineer/scripts/run.py --workspace <workspace> --online
Snowballing (needs network unless you provide offline snowball exports):
uv run python .codex/skills/literature-engineer/scripts/run.py --workspace <workspace> --snowball
Troubleshooting
Issue: cannot reach the active Workflow's candidate-pool target
Symptom:
papers/papers_raw.jsonl is below the explicit or profile-derived minimum declared by the locked Workflow.
Causes:
- Only a small offline export was provided.
- Network is blocked so online retrieval/snowballing can't run.
Solutions:
- Provide additional exports under
papers/imports/ (multiple routes/queries).
- Provide snowball exports under
papers/snowball/.
- Enable network and rerun with
--online --snowball.
Issue: many records missing stable IDs
Symptom:
- Report shows many entries with empty
arxiv_id and doi.
Solutions:
- Prefer arXiv/OpenReview/ACL exports that include stable IDs.
- If you have network, rerun with
--online to backfill arXiv IDs.
- Filter out ID-less entries before downstream citation generation.
1---2name: literature-engineer3description: "Multi-route literature expansion + metadata normalization for evidence-first surveys."4---56# Literature Engineer (evidence collector)78## Triggers & routing910- **Trigger**: evidence collector, literature engineer, 文献扩充, 多路召回, snowballing, cited by, references, 元信息增强, provenance.11- **Use when**: Workflow 需要按锁定的 retrieval policy 扩充候选文献并补齐可追溯 metadata。121314Goal: build a **large, verifiable candidate pool** for downstream dedupe/rank, mapping, notes, citations, and drafting.1516This skill is intentionally **evidence-first**: if you can't reach the target size with verifiable IDs/provenance, the correct behavior is to **block** and ask for more exports / enable network, not to fabricate.1718## Load Order1920Always read:21- `references/domain_pack_overview.md` — how domain packs drive topic-specific behavior2223Domain packs (loaded by topic match):24- `assets/domain_packs/llm_agents.json` — pinned classic/survey arXiv IDs for LLM agent topics2526## Script Boundary2728Use `scripts/run.py` only for:29- multi-route offline import, normalization, and provenance tagging30- online arXiv/Semantic Scholar API retrieval31- snowball expansion and deduplication32- retrieval report generation3334Do not treat `run.py` as the place for:35- hardcoded pinned arXiv ID lists (use domain packs)36- hardcoded topic detection logic (use domain packs)3738## Inputs3940- `queries.md`41 - `keywords`, `exclude`, `max_results`, `time window`42- Optional offline sources (any combination; all are merged):43 - `papers/import.(csv|json|jsonl|bib)`44 - `papers/arxiv_export.(csv|json|jsonl|bib)`45 - `papers/imports/*.(csv|json|jsonl|bib)`46- Optional snowball exports (offline):47 - `papers/snowball/*.(csv|json|jsonl|bib)`4849## Outputs5051- `papers/papers_raw.jsonl`52 - 1 record per line; minimum fields:53 - `title` (str), `authors` (list[str]), `year` (int|""), `url` (str)54 - stable identifier(s): `arxiv_id` and/or `doi`55 - `abstract` (str; may be empty in offline mode)56 - `source` (str) + `provenance` (list[dict])57- `papers/papers_raw.csv` (human scan)58- `papers/retrieval_report.md` (route counts, missing-meta stats, next actions)5960## Workflow (multi-route)61621. **Offline-first merge**: ingest all available offline exports (and label provenance per file).632. **Online retrieval (optional)**: if enabled, run arXiv API retrieval for each keyword query.643. **Snowballing (optional)**: expand from seed papers via references/cited-by (online), or merge offline snowball exports.654. **Normalize + dedupe**: canonicalize IDs/URLs, merge duplicates while unioning `provenance`.665. **Report**: write a concise retrieval report with coverage buckets and missing-meta counts.6768## Quality checklist6970- [ ] Candidate pool meets the active Workflow's declared retrieval floor **without fabrication**. For Workflows with `retrieval_policy.minimum_records`, use that value; survey profiles may instead derive a stricter pool target from `core_size`.71- [ ] Each record has a stable identifier (`arxiv_id` or `doi`, plus `url`).72- [ ] Each record has provenance: which route/file/API produced it.7374## Script7576### Quick Start7778- `uv run python .codex/skills/literature-engineer/scripts/run.py --help`798081### All Options8283- See `uv run python .codex/skills/literature-engineer/scripts/run.py --help`.84- Reads retrieval config from `queries.md`.85- Offline inputs (merged if present): `papers/import.(csv|json|jsonl|bib)`, `papers/arxiv_export.(csv|json|jsonl|bib)`, `papers/imports/*.(csv|json|jsonl|bib)`.86- Optional offline snowball inputs: `papers/snowball/*.(csv|json|jsonl|bib)`.87- Online expansion requires network: use `--online` and/or `--snowball`.88- Online retrieval is best-effort: arXiv API can be flaky in some environments; the script will also attempt a Semantic Scholar route when needed.89- For LLM-agent topics, the script also performs a best-effort **pinned arXiv id_list fetch** (canonical classics like ReAct/Toolformer/Reflexion/Voyager/Tree-of-Thoughts + a small prior-survey seed set) so `ref.bib` can include must-cite anchors even when keyword search misses them.90- If HTTPS/TLS to external domains is unstable, the Semantic Scholar route is fetched via the `r.jina.ai` proxy so the pipeline can still self-boot without manual exports.91- When an online run returns `0` records due to transient network errors, a simple rerun is often sufficient (the pipeline should not fabricate).929394### Examples9596- Offline imports only:97 - Put exports under `papers/imports/` then run:98 - `uv run python .codex/skills/literature-engineer/scripts/run.py --workspace <workspace>`99100- Explicit offline inputs (multi-route):101 - `uv run python .codex/skills/literature-engineer/scripts/run.py --workspace <workspace> --input path/to/a.bib --input path/to/b.jsonl`102103- Online arXiv retrieval (needs network):104 - `uv run python .codex/skills/literature-engineer/scripts/run.py --workspace <workspace> --online`105106- Snowballing (needs network unless you provide offline snowball exports):107 - `uv run python .codex/skills/literature-engineer/scripts/run.py --workspace <workspace> --snowball`108109## Troubleshooting110111### Issue: cannot reach the active Workflow's candidate-pool target112113**Symptom**:114- `papers/papers_raw.jsonl` is below the explicit or profile-derived minimum declared by the locked Workflow.115116**Causes**:117- Only a small offline export was provided.118- Network is blocked so online retrieval/snowballing can't run.119120**Solutions**:121- Provide additional exports under `papers/imports/` (multiple routes/queries).122- Provide snowball exports under `papers/snowball/`.123- Enable network and rerun with `--online --snowball`.124125### Issue: many records missing stable IDs126127**Symptom**:128- Report shows many entries with empty `arxiv_id` and `doi`.129130**Solutions**:131- Prefer arXiv/OpenReview/ACL exports that include stable IDs.132- If you have network, rerun with `--online` to backfill arXiv IDs.133- Filter out ID-less entries before downstream citation generation.