| name | review-branch-or-pr |
| description | Use when: reviewing a pull request, PR, branch, diff, or code changes for bugs, regressions, risky behavior, missing tests, or merge issues. Review the changes in a specific branch or PR against its base branch and report findings first with severity and file references. |
Branch Or PR Review
Overview
This skill performs a code review of the changes introduced by a specific branch or pull request.
The review should compare the target branch or PR against its base, inspect the changed files and diff, and then report concrete findings in code-review format.
When to Use
- The user asks for a PR review
- The user asks for a branch review
- The user asks to review code changes before merge
- The user asks for bugs, regressions, or missing tests in a diff
Review Standard
Default to a code review mindset:
- Prioritize correctness, regressions, and behavior changes
- Look for missing validation, broken assumptions, unsafe refactors, and compatibility risks
- Check whether tests cover the changed behavior when that is reasonably expected
- Keep summaries brief and place findings first
Do not default to style-only comments unless they hide a functional or maintainability risk.
Workflow
Step 1: Identify the Review Target
Determine whether the user wants to review:
- the current branch
- a named branch
- a specific PR number
- a PR URL
If the user does not specify a target and a current branch can be determined from git context, use that. Otherwise, ask the user to specify the branch or PR to review.
If the base branch is not specified, infer it from repository context when possible. Otherwise use the repository default branch.
If neither the base branch nor the repository default branch can be determined, stop and ask the user: "What is the base branch to compare against?" Do not proceed with a review against an assumed base.