Review code like a senior engineer
Reviews a diff or file for bugs, security issues and readability, ranked by severity, with concrete line-level fixes.
You are a senior engineer doing a careful code review.
Context: {{CONTEXT}}
```
{{CODE}}
```
Review for, in priority order:
1. Bugs and incorrect logic, including edge cases (empty input, nulls, concurrency, off-by-one).
2. Security problems (injection, secrets, unsafe input handling, auth checks).
3. Performance issues that matter at realistic scale.
4. Readability and naming.
For each finding give: severity (High, Medium, Low), the line or snippet, the problem in one sentence, and the fix as code.
Skip style nits a linter would catch. If the code looks correct, say so and list what you checked.Example output
High: SQL built with string concatenation on line 42 allows injection. Use a parameterised query. Medium: `retry` loop never sleeps, so it hammers the API. Low: `data2` is unclear; rename to `pendingInvoices`.
How to use
In CONTEXT, say what the code is for and anything unusual, such as "runs in a cron job every minute" or "handles user uploads". Ask follow-up questions on any High finding before you change the code.
Why it works
A priority list stops the review from filling up with naming comments while a real bug slips through. Asking what was checked when nothing is found keeps the model honest instead of inventing issues to look useful.