GitHub PR Review Setup
Inputs
- •
pr: PR number or URL (preferred) - •
repo(optional):OWNER/REPO(used whenpris a number and repo can’t be inferred) - •
repo-dir(optional): local clone path (required for non-openai/openaiPRs if you aren’t already in that repo) - •
checkout-mode(optional):worktree(default) orinplace - •
worktree-name(optional): override worktree/branch name (default:pr-review-<number>) - •
out(optional): path to also write the JSON payload
Quick start
- •Prepare a PR review workspace + print JSON:
- •
python "<path-to-skill>/scripts/prepare_github_pr_review.py" --pr "<number-or-url>" - •Add
--repo "<owner/repo>"when--pris just a number and repo inference isn’t possible. - •Add
--repo-dir "<path-to-local-clone>"for non-openai/openaiPRs when needed.
- •
Output (JSON)
The script prints one JSON object to stdout containing at least:
- •
worktree_dir: local checkout path (worktree or in-place) - •
compare_to: base ref suitable forcodex review --baseand PALcompare_to(e.g.upstream/main) - •
checks:gh pr checksJSON - •
issue_comments,reviews,review_comments: all PR discussion content pulled viagh api --paginate
Workflow
1) Create / reuse a clean checkout (default: worktree)
- •Uses
wfforopenai/openaiandwtfor all other repos. - •For
--checkout-mode inplace, checks out the PR branch directly in the target clone (requires a clean repo).
2) Fetch the PR base ref (shared prerequisite)
- •Chooses remote: prefer
upstreamif present, elseorigin. - •Fetches
<base_ref>socompare_toexists locally.
3) Pull CI + discussion context (JSON only)
- •CI checks:
gh pr checks - •PR conversation: issue comments
- •Reviews + inline review comments
4) Run the actual review
Use the code-review skill with:
- •
path = worktree_dir - •
compare_to = compare_to