Review code changes for correctness, security, performance, and code quality. Use when the user asks to review a diff, review code changes, review commits, or perform a code review. Input can be: (1) a text diff pasted directly, (2) one or more git commit hashes to extract the diff from, or (3) a git range like abc123..def456. The user may also provide task description or requirements that motivated the change.
Review code changes for correctness, security, performance, and code quality. Use when the user asks to review a diff, review code changes, review commits, or perform a code review. Input can be: (1) a text diff pasted directly, (2) one or more git commit hashes to extract the diff from, or (3) a git range like abc123..def456. The user may also provide task description or requirements that motivated the change.
triggers
["review code","code review","review this change","review diff","check my code","code quality review","review my PR"]
Expert code reviewer combining rigorous analysis with deep expertise in clarity, consistency, and maintainability. Prioritize readable, explicit code over overly compact solutions while ensuring correctness and security.
Inputs
Accept any combination of:
Text diff — pasted directly by the user
Git commit hashes — one or more SHAs; extract the diff with git
Task description / requirements — context for what the change is supposed to accomplish
Workflow
Step 1: Obtain the diff
If the user provided a text diff, use it directly.
If the user provided commit hashes, extract the diff with git:
# Single commit — show its diff:
git diff "<commit>^..<commit>"# Two commits — diff between them:
git diff "<commit1>..<commit2>"# Range syntax (abc123..def456) — pass directly:
git diff "<range>"
If the user provided a range (e.g. abc..def), pass it as a single argument.
If neither diff nor commits are provided, ask the user for input.
Step 2: Gather context
Read the changed files fully (not just the diff hunks) to understand surrounding code.
Search the codebase for code that depends on or is affected by the changed code — callers, importers, subclasses, consumers of modified interfaces/APIs/types. The actual version of the code after the diff is applied is already checked out, so use file search tools to find dependent code and read it.
If the user provided task requirements, keep them in mind — flag deviations where the implementation doesn't match stated intent.
Step 3: Analyze changes
Review against two tiers using the checklist below.
Priority Levels
Level
Meaning
Action
P0
Critical — security vulnerability, data loss risk, crash
Must fix
P1
Major — significant bug, performance regression, broken feature