Initial PR Review
Sequencing Checklist
Perform a structured first-pass review of a pull request, checking for the things the team has agreed matter most. This is not a nitpick pass — it's a "catch real problems early" pass.
Prerequisites
IMPORTANT: Check every prerequisite below BEFORE doing any work. If any check fails, stop immediately, tell the user which prerequisite is not met, and ask them to fix it. Do NOT proceed, improvise, or attempt workarounds.
- The
gh CLI must be installed and authenticated (gh auth status must succeed)
- You must be given a PR number, URL, or be on a branch with an open PR (
gh pr view must succeed for the target PR)
Steps
1. Gather context
gh pr view <pr> --json title,body,baseRefName,headRefName,files,additions,deletions
gh pr diff <pr>
Read the PR title, description, and full diff. Understand what the PR is trying to accomplish before reviewing any code.
2. Run the checklist
Work through each section below. For each item, note whether it passes, has concerns, or is not applicable. Only flag things that are genuine problems — do not manufacture issues.
Review Checklist
Correctness
- Does the code do what the PR description says it does?
- Are there logic errors, off-by-one mistakes, or unhandled edge cases?
- Are error paths handled? Will failures surface clearly or fail silently?
Security
- Is user input validated/sanitized before use?
- Are there hardcoded secrets, tokens, or credentials?
- Are new dependencies from trusted sources and pinned to specific versions?
- Does the change introduce any OWASP Top 10 risks (injection, broken auth, XSS, etc.)?
Breaking changes
- Does this change modify a public API, database schema, config format, or wire protocol?
- If so, is it backward-compatible or is there a migration path?
- Are existing callers/consumers updated?
Tests
- Are new code paths covered by tests?
- Do existing tests still make sense after this change, or do some need updating?
- Are tests testing behavior (what) rather than implementation (how)?
Naming and clarity
- Are new functions, variables, and files named so that a reader unfamiliar with the PR can follow the code?
- Is there anything confusing enough that it needs a comment, but doesn't have one?
Complexity and scope
- Is the PR doing more than one thing? Should it be split?
- Is there unnecessary abstraction, over-engineering, or speculative generality?
- Could any part of this be simpler while still being correct?
Operational impact
- Are there new environment variables, feature flags, or config changes required?
- Could this change affect performance, memory usage, or latency at scale?
- Are there new log lines, metrics, or alerts that should accompany this change?
3. Write the review
Produce a review comment with this structure:
## Summary
One or two sentences on what this PR does and the overall impression.
## Issues
Items that should be fixed before merging. Reference specific files and lines.
## Suggestions
Non-blocking improvements the author could consider.
## Questions
Anything that wasn't clear from the code or description alone.
If the PR looks good, say so plainly. Do not pad the review with filler.
4. Post the review (if requested)
Only post to GitHub if explicitly asked. Use:
gh pr review <pr> --comment --body "$(cat <<'EOF'
<review content here>
EOF
)"
Use --approve or --request-changes in place of --comment when appropriate.
1---2name: initial-pr-review3description: Run a structured first-pass code review on a PR. Use this skill when asked to review a PR, when opening a PR that should be sanity-checked before requesting human review, or when picking up someone else's PR to understand what changed and whether it's ready to merge.4---56# Initial PR Review78## Sequencing Checklist910- [ ] Verify prerequisites (`gh auth status`, PR is accessible)11- [ ] Gather PR context (`gh pr view`, `gh pr diff`)12- [ ] Review: Correctness13- [ ] Review: Security14- [ ] Review: Breaking changes15- [ ] Review: Tests16- [ ] Review: Naming and clarity17- [ ] Review: Complexity and scope18- [ ] Review: Operational impact19- [ ] Write the review (Summary, Issues, Suggestions, Questions)20- [ ] Post the review to GitHub (only if explicitly requested)2122Perform a structured first-pass review of a pull request, checking for the things the team has agreed matter most. This is not a nitpick pass — it's a "catch real problems early" pass.2324## Prerequisites2526**IMPORTANT: Check every prerequisite below BEFORE doing any work. If any check fails, stop immediately, tell the user which prerequisite is not met, and ask them to fix it. Do NOT proceed, improvise, or attempt workarounds.**2728- The `gh` CLI must be installed and authenticated (`gh auth status` must succeed)29- You must be given a PR number, URL, or be on a branch with an open PR (`gh pr view` must succeed for the target PR)3031## Steps3233### 1. Gather context3435```bash36gh pr view <pr> --json title,body,baseRefName,headRefName,files,additions,deletions37gh pr diff <pr>38```3940Read the PR title, description, and full diff. Understand what the PR is trying to accomplish before reviewing any code.4142### 2. Run the checklist4344Work through each section below. For each item, note whether it passes, has concerns, or is not applicable. Only flag things that are genuine problems — do not manufacture issues.4546---4748## Review Checklist4950<!-- ===========================================================51 ADD NEW CHECKLIST SECTIONS HERE5253 Each section should follow this format:5455 ### Section Name56 - **What to check**: one-line description57 - **How to check**: concrete steps or commands58 - **Common mistakes**: patterns to watch for5960 Keep sections focused on one concern. A section with more61 than 4-5 bullets is probably two sections.62 =========================================================== -->6364### Correctness6566- Does the code do what the PR description says it does?67- Are there logic errors, off-by-one mistakes, or unhandled edge cases?68- Are error paths handled? Will failures surface clearly or fail silently?6970### Security7172- Is user input validated/sanitized before use?73- Are there hardcoded secrets, tokens, or credentials?74- Are new dependencies from trusted sources and pinned to specific versions?75- Does the change introduce any OWASP Top 10 risks (injection, broken auth, XSS, etc.)?7677### Breaking changes7879- Does this change modify a public API, database schema, config format, or wire protocol?80- If so, is it backward-compatible or is there a migration path?81- Are existing callers/consumers updated?8283### Tests8485- Are new code paths covered by tests?86- Do existing tests still make sense after this change, or do some need updating?87- Are tests testing behavior (what) rather than implementation (how)?8889### Naming and clarity9091- Are new functions, variables, and files named so that a reader unfamiliar with the PR can follow the code?92- Is there anything confusing enough that it needs a comment, but doesn't have one?9394### Complexity and scope9596- Is the PR doing more than one thing? Should it be split?97- Is there unnecessary abstraction, over-engineering, or speculative generality?98- Could any part of this be simpler while still being correct?99100### Operational impact101102- Are there new environment variables, feature flags, or config changes required?103- Could this change affect performance, memory usage, or latency at scale?104- Are there new log lines, metrics, or alerts that should accompany this change?105106---107108## 3. Write the review109110Produce a review comment with this structure:111112```113## Summary114One or two sentences on what this PR does and the overall impression.115116## Issues117Items that should be fixed before merging. Reference specific files and lines.118119## Suggestions120Non-blocking improvements the author could consider.121122## Questions123Anything that wasn't clear from the code or description alone.124```125126If the PR looks good, say so plainly. Do not pad the review with filler.127128## 4. Post the review (if requested)129130Only post to GitHub if explicitly asked. Use:131132```bash133gh pr review <pr> --comment --body "$(cat <<'EOF'134<review content here>135EOF136)"137```138139Use `--approve` or `--request-changes` in place of `--comment` when appropriate.