| name | code-review |
| description | Structured code review skill. Use when asked to "review this code", "review this PR", "check this diff", or when acting as a Hydra reviewer. Runs a multi-pass review with specialist focus areas and confidence-gated findings. |
Code Review
Structured multi-pass review. Read the full diff before commenting on anything.
Phase 1: Orient
- Determine the review scope:
- If reviewing a PR:
git diff <base>..HEAD
- If reviewing staged changes:
git diff --cached
- If reviewing a file: read the file
- Understand the intent: read the commit messages, PR description, or
task description to understand what the change is supposed to do
- Identify the change type: feature, bugfix, refactor, config, dependency update
Phase 2: Critical Pass
Read the diff line by line. Flag only real issues:
Always check:
- Logic errors (wrong conditions, off-by-one, missing null checks on external data)
- SQL injection, XSS, command injection, path traversal
- Race conditions in concurrent code
- Resource leaks (unclosed handles, missing cleanup)
- Missing error handling at system boundaries (network, file I/O, user input)
- Breaking API contract changes without version bump
Never flag:
- Style preferences (naming, formatting) unless they cause confusion
- Missing comments on self-explanatory code
- Hypothetical edge cases that cannot happen given the invariants
- "I would have done it differently" without a concrete defect
Phase 3: Specialist Focus
Based on the change type, apply the relevant specialist lens:
If the diff touches tests:
- Do tests actually test behavior, or just assert mock return values?