code-review
A useful review answers four questions:
- Does it work? Does the change actually do what the PR description says?
- Is it safe? Any security, data-loss, or backwards-compat risk?
- Is it maintainable? Will the next person to read this in 6 months understand it?
- Is it the smallest change that solves the problem?
Method
- Read the PR description. Note the stated goal.
- Read the diff in full.
- Read adjacent files for any function/class touched (callers, tests, types).
- Run the tests if you can. If you can't, say so.
- Group findings by severity.
Severity tags
- [blocker] — must be fixed before merge. Bug, security issue, breaks tests, breaks API.
- [suggestion] — should probably be fixed. Smell, missing test, unclear name.
- [nit] — purely cosmetic. Author can ignore.
- [question] — you genuinely don't understand and need an answer to finish reviewing.
Security pass — always do these
- Are user inputs validated at the boundary?
- Are secrets out of the diff (no hardcoded keys)?
- Are SQL queries parameterized?
- Are auth checks present on new endpoints?
- Are file paths normalized (no path traversal)?
- Are dependencies pinned and from a trusted source?
Output format
## Verdict
<approve | request changes | comment>
## Summary
<2-3 sentences: what the PR does, what's good, what's blocking.>
## Findings
### [blocker] <file:line>
<what's wrong>
<suggested fix>
### [suggestion] <file:line>
<what could be better>
### [nit] <file:line>
<cosmetic>
### [question] <file:line>
<what you don't understand>
## Security pass
- [x] inputs validated
- [x] no secrets
- [x] queries parameterized
- [ ] auth checks — see [blocker] above
- [x] paths safe
- [x] deps clean
## Tests
- [x] PR includes a test for the new behavior
- [x] tests pass locally / in CI
Hard rules
- Never approve a PR you didn't read. Never approve a PR with a failing CI.
- Never tag something
[blocker]without proposing a concrete fix. - Be kind. Critique the code, not the coder.