Prompts for code review
A bare 'review this code' tends to return generic style comments. A good review prompt says what matters (bugs, security, performance), what to ignore, and how to report findings so you can act on them quickly.
Before and after
Rough request
review my function
Becomes
Act as a senior engineer reviewing a pull request. Review the function below for bugs, unhandled edge cases and security problems first, readability second. Ignore formatting and naming nitpicks. Return a list ordered by severity; for each item give the line, the problem and a suggested fix.
Illustrative example; your results will vary.
Why this prompt works
- It gives the AI a role and a priority order, so serious problems come before style notes.
- It says what to ignore, which cuts the noise.
- It fixes the output format (severity, line, problem, fix), so the result is a checklist instead of an essay.
Tips
- Include the language, framework and what the code is supposed to do.
- Paste the surrounding types or interfaces if the function depends on them.
- Ask for severity levels so you can fix the worst items first.
- Treat the output as a second opinion, not a replacement for tests.
Want to know what each part of a prompt does? Read the six-part structure or compare prompt frameworks.
Turn your own rough idea into a prompt
VegaPrompts builds this structure for you. Three prompts free, no account.
Open the app