Code Review
Goals
- •Find correctness bugs, edge cases, security issues, and behavior regressions.
- •Flag missing or inadequate tests and suggest targeted additions.
- •Keep feedback concrete, actionable, and tied to files/lines when possible.
Workflow
- •Identify the scope: files touched, feature intent, and expected behavior.
- •Read the diff first; then inspect surrounding code for context.
- •Focus on high-risk areas: input validation, error handling, concurrency, resource cleanup, and boundary conditions.
- •Check API contracts, data schemas, and invariants for violations or mismatches.
- •Validate tests: coverage of new paths, failure cases, and backward compatibility.
Output Format
- •Start with findings ordered by severity (blocker, high, medium, low).
- •For each finding, include: file path, location hint, impact, and recommended fix.
- •If no issues are found, state that explicitly and note any remaining risk or untested paths.
Practical Heuristics
- •Prefer small, surgical changes over large rewrites when proposing fixes.
- •If a finding depends on assumptions, state them clearly.
- •If the intent is ambiguous, ask one focused question.
If Tests Are Available
- •Recommend the smallest test that proves the fix.
- •Mention whether the current tests would fail before the fix and pass after.