# Running the pipeline ## Contents 1. Setup and the reviewer subagent 2. Paths: Workflow tool, Agent tool, single session 3. Cost and batch size 4. Resume after interruption 5. Mode recipes ## 1. Setup and the reviewer subagent - **Plugin install** (skill + subagent): `/plugin marketplace add Imbad0202/academic-research-skills`, then `/plugin install academic-research-skills`. The reviewer subagent ships in the plugin's `agents/` folder and is listed with the plugin prefix: `academic-research-skills:screening-reviewer-agent`. - **Skills-copy install** (the `sr-screener` folder symlinked or copied into `~/.claude/skills/`): also copy `sr-screener/agents/screening_reviewer_agent.md` into `.claude/agents/` (this project) or `~/.claude/agents/` (all projects); it is then listed as `screening-reviewer-agent`. - Put the exact agent name shown in the session's agent list into `agent_type` in `screening_config.json`. A wrong name makes every call fail at once, which the pilot shows immediately. An empty `agent_type` uses the default workflow subagent: it works, but it carries more tools and more overhead per call. - Before #1037 the reviewer was named `screening_reviewer_agent`. A saved `academic-research-skills:screening_reviewer_agent` dispatches to the new plugin name. A bare `screening_reviewer_agent` is dispatched as written, because it names your own copy; after you copy the new agent file, change `agent_type` to `screening-reviewer-agent`. Changing between the two plugin names does not archive the decisions of a stage in progress; changing a bare name does, because the two names can be two different local files. - Python 3.9+ runs the scripts; `pip install openpyxl` gives an Excel log instead of CSV files. ## 2. Paths ### Workflow tool (preferred at scale) 1. `build_workflow.py ta --jobs pilot|all|pending|recheck ...` writes a script under `/runs/` and prints its path, job count, planned agent calls and models. 2. Show the user that estimate. The Workflow tool runs only when the user has opted into multi-agent orchestration; a request such as "run the screening workflow" is enough. 3. `Workflow({scriptPath: ""})`. Each batch runs Reviewer A and Reviewer B in parallel, retries missing IDs with a Grep subset call, and sends advance-vs-exclude conflicts to the adjudicator in the same run. 4. When it finishes, merge: the journal sits at `~/.claude/projects///subagents/workflows//journal.jsonl`. Pass that folder, or the whole `workflows` folder, to `merge_decisions.py --from`. 5. Never edit the generated script by hand; change `templates/prompts.md`, the protocol or the config and generate it again. Generated scripts are the audit trail of what each run used. ### Agent tool (no Workflow tool) 1. Add `--emit-prompts /prompts` to `build_workflow.py`; it writes one prompt file per call and `index.json` (label, prompt file, model). 2. For each entry: an Agent call with the reviewer subagent and the prompt "Read the file and follow its instructions exactly." Run a few at a time. 3. Save each returned JSON as `/decisions/