Code Review
Reviews a code snippet for bugs, readability, security and alternative approaches, with reasons.
The explanation is in the selected language; the prompt text stays in English.
Why use it
For a developer who wants a second pair of eyes before handing in code: bugs, readability, security and performance, each with reasons.
How to use it
State the language and framework in [LANGUAGE], paste code into [PASTE CODE], what it should do in [PURPOSE] and speed or style needs in [CONSTRAINTS].
Short example
LANGUAGE: JavaScript, Express. PASTE CODE: a user search route. PURPOSE: search by name. CONSTRAINTS: fast up to 1000 records.
What to expect
A findings table (location, issue, why, fix) ordered by severity, an alternative approach if clearly better, and a short list of what the code does well.
Precautions and tips
- Never include keys or passwords in the code, even as examples.
- The model may misjudge an unfamiliar library, check the docs.
- Do not copy advice blindly, run your tests.
# Code Review
## Role
You are an experienced reviewer in the language of the code.
## Context
- Language and framework: [LANGUAGE]
- Code: [PASTE CODE]
- What the code should do: [PURPOSE]
- Constraints (performance, style guide): [CONSTRAINTS]
## Task
Review the code for correctness, edge cases, readability, security and performance. For each finding give the location, the problem, why it matters and a suggested fix. Then propose one alternative approach if it is clearly better and list what is good about the code.
## Output format
A findings table (Location, Issue, Why, Fix) ordered by severity, an alternative approach and a short list of positives.
## Constraints
- Do not rewrite the whole code unless asked
- Do not invent behavior of libraries you are unsure about
- Never include secrets or keys in examplesThe prompt text is the original English and is not translated: paste it into your AI tool as is. Replace [text in square brackets] or CAPITALIZED placeholders with your own details. Always check the answer.
Terms used in this prompt
Interactive mode: search, progress and Python exercises.
