Strict code review that ignores style
codingReviews a diff for correctness, edge cases, and regressions — and refuses to comment on formatting.
Extracts or restructures code while proving the public behavior stays identical.
When a function has grown past reading size but is covered by tests you cannot afford to rewrite.
Refactor the code below without changing its observable behavior.
Constraints:
- Public signatures stay identical.
- No new dependencies.
- No behavior changes, including error types, ordering, and side effects.
- If you cannot preserve behavior with confidence, stop and say which line makes it unsafe.
Before writing code, list:
1. The observable contract (inputs, outputs, errors, side effects).
2. Which existing tests cover it, if any are shown.
3. The single riskiest line for behavior preservation.
Then output the refactored code, followed by a one-paragraph note on what a reviewer should check.
Code:
<code>
If there are no tests, say so explicitly — the model will then write thin characterisation checks first instead of refactoring blind.
Asking for the contract before the code forces the model to read the function instead of pattern-matching it. The 'riskiest line' question surfaces exactly where a silent regression would hide.
Reviews a diff for correctness, edge cases, and regressions — and refuses to comment on formatting.
Writes the failing test first, then the fix, and refuses to skip the reproduction.
Produces a map of responsibilities, data flow, and the parts that look dangerous to change.