Code Review
Review the changes described in the task. Follow this structure:
Phase 1: Identify Changes
Run git diff (or git diff HEAD if there are staged changes) to see what changed.
If there are no git changes, review the files mentioned in the task.
Phase 2: Review
For each change, check:
- Correctness: Could this change introduce bugs? Are edge cases handled?
- Regressions: Could this break existing behavior? Check callers and dependents.
- Test gaps: Are there tests covering the changed code? Are new tests needed?
- Security: Any risk of injection, path traversal, unsafe deserialization?
- Error handling: Are exceptions caught appropriately? Are error messages clear?
Phase 3: Report
Return findings ordered by severity:
- [P1] Critical — likely bug or security issue
- [P2] Important — missing test, error handling gap
- [P3] Nice-to-have — naming, style, minor improvements
Include:
- Findings: each with severity, file, line reference, and explanation
- Open Questions: things you couldn't determine
- Summary: overall assessment (safe / needs fixes / blocked)
- Test Gaps: what should be tested
Do NOT modify files unless the task explicitly asks you to fix issues.