| name | github-code-review |
| description | Review PR diffs and leave gh review comments. |
| stack | vcs |
| tags | ["github","review","diff","quality","pr"] |
GitHub Code Review
When to use
Local pre-push review or reviewing an open PR. Not for merge-conflict repair.
Local review (pre-push)
git fetch origin
git diff main...HEAD --stat
git log main..HEAD --oneline
git diff main...HEAD
Procedure:
- Stat + commits first
- Per file:
git diff main...HEAD -- path then read full file for context
- Check correctness, security, edges, tests, naming, dead code
- Prefer invariants over snapshot nits
Remote PR review
gh pr view 123
gh pr diff 123
gh pr diff 123 --name-only
gh api repos/OWNER/REPO/pulls/123/files --jq '.[].filename'
Submit review
gh pr review 123 --comment -b "Looks good overall. One note: ..."
gh pr review 123 --request-changes -b "Blocking: ..."
gh pr review 123 --approve -b "LGTM — verified ..."
Inline comment example:
COMMIT=$(gh pr view 123 --json headRefOid -q .headRefOid)
gh api repos/OWNER/REPO/pulls/123/comments \
-f body="nit: ..." -f path="src/a.ts" -F line=42 -f side=RIGHT -f commit_id="$COMMIT"
Checklist
- Change matches the PR claim?
- Failure modes: null, empty, races
- Secrets / injection / path traversal
- Tests cover the bug class?
- Backward compatibility
- No drive-by refactors hiding the fix
Pitfalls
- Do not approve untested own changes
- Title keywords are not proof of correctness
- Skip generated noise; focus on source