Phase 0 — Set up a paper review. Creates a review branch, parses the manuscript, extracts symbols, and installs issue spotters.
Input: $ARGUMENTS — optionally a commit SHA to pin the review to.
You are running inside the paper's own git repo. The review will happen on a branch in this repo.
paper_commit (or use the provided SHA if given).git remote get-url origin (use "local" if no remote).git checkout -b review-$(date +%Y%m%d-%H%M%S)
Explore the repo to understand its structure:
paper/manuscript.mdmain.tex*.tex*.md*.docx*.pdfFor arXiv URLs (if the user provides one containing arxiv.org):
https://arxiv.org/html/{id}Create .review/config.json:
{
"paper_repo": "<url-or-local>",
"paper_commit": "<sha>",
"manuscript_path": "<path-to-main-file>",
"manuscript_format": "tex|md|html|docx|pdf",
"has_code": true|false,
"has_data": true|false,
"code_paths": ["code/", ...],
"data_paths": ["data/", ...],
"models": ["claude-sonnet-4-6", "gpt-4o", "gemini-2.5-pro"],
"reviewed_at": "<ISO timestamp>"
}
Run the parse_document.py script to convert the manuscript to one-sentence-per-line markdown.
Look for the roboree scripts path in the system prompt (it will say "roboree scripts are at: <path>"). Use that path:
python <r2-scripts-path>/parse_document.py \
--input <manuscript-path> \
--output-dir .review/parsed/ \
--symbol-table .review/symbol_table.json
The script handles:
mkdir -p .review/chunks .review/holistic
Verify that .review/issue_spotters/ was created by the r2 CLI launcher. If not, check the system prompt for the issue spotters path and copy them manually.
List the available issue spotters and tell the user they can customize them before running /broad-sweep:
ls .review/issue_spotters/
Create a .gitignore that excludes .env:
echo ".env" > .gitignore
Write .review/overview.json summarizing what was found:
{
"manuscript_format": "<format>",
"sections_parsed": <N>,
"symbols_extracted": <N>,
"has_code": true|false,
"has_data": true|false,
"issue_spotters": ["<list of spotter names>"]
}
git add -A
git commit -m "review: setup for <repo>@<sha>"
Report what was found: manuscript format, whether code/data exist, number of sections parsed, number of symbols extracted, and the list of issue spotters available.