Review a pull request using Google's code review principles. Takes a PR number or auto-detects from current branch. Use when the user wants to review a PR, check PR changes, or says "/review-pr 123".
Review a pull request following Google's engineering practices for code review.
Check we have a GitHub remote:
git remote -v
STOP if:
git remote add origin <url> first."If a PR number was provided as an argument, use that directly.
If no argument was provided, auto-detect from current branch:
gh pr view --json number,state,title
STOP if:
/review-pr 16) or switch to a feature branch with an open PR."Validate the PR exists and is open:
gh pr view <number> --json number,state,title,body
STOP if:
Get the PR description for context:
gh pr view <number>
Note the title and description—these explain the intent of the changes.
Get the actual code changes:
gh pr diff <number>
This is the code you will review. Focus only on changes in the diff, not unrelated code.
Extract the list of files changed in the PR from the diff:
gh pr diff <number> --name-only
Use the /review skill to review the changed files, providing PR context:
/review <space-separated list of changed files>
Context: This is a PR review for "<PR title>". Focus on the changes in the diff only, not entire file contents.
PR Description:
<PR description from Step 3>
This invokes the base review skill which applies Google's code review principles. The context ensures the review focuses on the PR changes rather than reviewing files in isolation.
After the review is complete, post it as a PR comment:
gh pr review <number> --comment --body "$(cat <<'EOF'
<review output from /review skill>
EOF
)"
Alternatively, if the verdict is clear:
gh pr review <number> --approve --body "<review>"gh pr review <number> --request-changes --body "<review>"DO:
/review to apply consistent review standardsDON'T:
/review on changed files