Review a teammate's PR and produce draft comments for your approval before posting. Use when asked to review a PR, look at a PR, or give feedback on someone's code.
Review a pull request and produce draft comments for human approval before posting anything to GitHub. Nothing gets posted without your explicit go-ahead.
Accept PR input as:
https://github.com/org/repo/pulls/123)gh pr view 123)gh pr list)Fetch PR details:
gh pr view <number> --json title,body,author,baseRefName,headRefName,files,additions,deletions,commits
gh pr diff <number>
gh pr checks <number>
Present a summary:
## PR #<number>: <title>
Author: <author>
Base: <base> ← <head>
Files changed: <count> (+<additions>/-<deletions>)
CI: <passing/failing/pending>
<PR description summary>
Read-only setup rules:
git rebase, git merge, git cherry-pick, git reset, or similar
branch-mutating commands unless the user explicitly asked for branch surgerygh pr view, gh pr diff, gh pr checks, and targeted local reads
over "cleaning up" the checkout firstReview the diff systematically. For each changed file, assess:
Correctness
Security
Design
Error Handling
Testing
Style & Conventions
For each finding, draft a comment. Categorize:
For each draft comment, include:
Show all draft comments grouped by category:
## Draft Review: PR #<number>
### Overall Assessment: <APPROVE / REQUEST CHANGES / COMMENT>
### Blocking (<count>)
**<file>:<line>**
> <the code being commented on>
Draft comment: "<your comment>"
---
### Suggestions (<count>)
**<file>:<line>**
> <the code>
Draft comment: "<your comment>"
---
### Questions (<count>)
...
### Nits (<count>)
...
Then ask:
Post all as-is (Recommended): Submit the review with all commentsEdit first: Let me modify comments before postingPost without nits: Submit blocking + suggestions + questions, skip nitsDon't post: Just show me the review, I'll handle it manuallyBased on the overall assessment:
# If APPROVE (no blocking issues):
gh pr review <number> --approve --body "<summary>"
# If REQUEST CHANGES (blocking issues exist):
gh pr review <number> --request-changes --body "<summary>"
# If COMMENT (questions only, no judgment):
gh pr review <number> --comment --body "<summary>"
For inline comments, post each as a review comment on the specific file/line. Use the GitHub review API to batch them into a single review submission.
## Review Posted: PR #<number>
Decision: <APPROVE / REQUEST CHANGES / COMMENT>
Comments posted: <count>
- Blocking: <count>
- Suggestions: <count>
- Questions: <count>
- Nits: <count>