review
Code review skill. Use when reviewing changes, commits, branches, or pull requests. Focuses on bugs, structure, performance with actionable feedback.
When & Why to Use This Skill
This Claude skill automates and enhances the code review process by analyzing git diffs, specific commits, and pull requests. It provides actionable, high-context feedback focused on identifying critical bugs, improving software structure, and flagging performance bottlenecks while adhering to project-specific conventions.
Use Cases
- Pre-commit Quality Assurance: Review local uncommitted changes or staged files to catch logic errors and edge cases before they are committed to the repository.
- Pull Request Auditing: Integrate with GitHub CLI to perform objective reviews of PRs, ensuring new code follows established architectural patterns and security standards.
- Branch Comparison: Compare feature branches against the main codebase to identify structural inconsistencies, unreachable paths, or potential integration issues.
- Historical Commit Analysis: Analyze specific past commits using SHA hashes to debug regressions or evaluate the impact of specific changes on system performance.
| name | review |
|---|---|
| description | Code review skill. Use when reviewing changes, commits, branches, or pull requests. Focuses on bugs, structure, performance with actionable feedback. |
Review Skill
Review code changes. Focus: bugs first, then structure, performance.
What to Review
User input determines review type:
Default (no target): Uncommitted changes
git diff- unstagedgit diff --cached- staged
Commit hash (SHA or short): Specific commit
git show <commit>
Branch name: Compare current to branch
git diff <branch>...HEAD
PR (github.com/pull or PR number): Pull request
gh pr view <pr>- contextgh pr diff <pr>- diff
Use best judgement.
Gather Context
Diffs alone insufficient. After diff, read full file(s) modified. Understand context.
- Diff identifies changed files
- Read full files for patterns, flow, error handling
- Check conventions: CONVENTIONS.md, AGENTS.md, .editorconfig
Focus Areas
Bugs - Primary.
- Logic errors, off-by-one, wrong conditionals
- Missing/incorrect guards, unreachable paths
- Edge cases: null/empty/undefined, errors, races
- Security: injection, auth bypass, data exposure
- Broken error handling: swallowed failures, unexpected throws, uncaught error types
Structure - Fits codebase?
- Follows existing patterns/conventions?
- Misses established abstractions?
- Excessive nesting (flatten with early returns/extract)
Performance - Flag only if obvious.
- O(n²) on unbounded, N+1 queries, blocking I/O hot paths
Before Flagging
Be certain. Bug claim requires confidence.
- Review changes only - ignore pre-existing code
- Don't flag if unsure - investigate first
- No hypothetical problems - explain realistic scenario if edge case matters
- Get more context if needed
Don't be a style zealot.
- Verify actual violation. Don't complain about
elseif early returns correct. - Some "violations" acceptable if simplest option.
letfine if alternative convoluted. - Excessive nesting always concern.
- Don't flag style preferences unless clearly violates project conventions.
Tools
Use to inform review:
- Explore agent - Check existing code patterns, conventions, prior art
- Exa Code Context - Verify library/API usage before flagging
- Exa Web Search - Research best practices if unsure
If uncertain + can't verify with tools: say "Not sure about X" rather than definite issue.
Output
- Bugs: direct, clear why it's a bug
- Clearly communicate severity. Don't overstate
- Critiques explicitly communicate scenarios/environments/inputs necessary for bug. Severity depends on these
- Matter-of-fact tone. Not accusatory, not overly positive. Helpful AI assistant
- Write for quick understanding
- NO flattery. No "Great job", "Thanks". Helpful comments only.