Sibling of [[pr-review]] (local pre-push) and [[pr-ready]] (merge-ready gate). Shared review rules + output format live in [[pr-review]] — don't duplicate them, follow that skill's Review dimensions section.
-
Resolve the PR — accept a number (123), #123, or full URL:
gh pr view <ref> --json number,title,headRefName,baseRefName,author,state,mergeable,statusCheckRollup,url
Refuse if state ≠ OPEN. Stash the JSON; you'll need number and url later.
-
Fetch the diff — gh pr diff <number>. Do not check out the branch: review is read-only and shouldn't touch local state. (If a finding genuinely requires running code on the PR branch, flag it in Notes as "verify locally" rather than checking out unilaterally.)
-
Skip bun check — CI runs it on the PR. Surface check status from statusCheckRollup:
- Any failing check → must-fix entry referencing the check name + URL.
- Pending checks → Notes section, not blocking the review.
-
Walk the diff applying the [[pr-review]] Review dimensions. Same severities: must-fix / should-fix / nit. Same finding shape: file:line + quoted rule.
-
Produce the report in the [[pr-review]] Output format, with the header adapted: # PR review: #<num> "<title>" by <author> and a link line Branch: <head> → <base> | <url>.
-
Offer to post the review — ask:
Post this on PR #N? (approve / request-changes / comment / no)
Mapping:
| Choice | Command | When |
|---|
approve | gh pr review <num> --approve --body-file <tmp> | Only if zero must-fix. Refuse otherwise and ask the user to confirm comment instead. |
request-changes | gh pr review <num> --request-changes --body-file <tmp> | Any must-fix items present |
comment | gh pr review <num> --comment --body-file <tmp> | Discussion / nits-only |
no | (skip) | Default |
Write the report body to a tempfile first (mktemp → --body-file); never pass a multi-line body inline.
-
After posting, echo the PR URL back so the user can verify the review landed.