7 prompts that turn your AI from a yes-man into a real code reviewer
Ask an AI "is this code good?" and you'll get "Looks good! A few minor suggestions..." almost every time. That's not a review. That's politeness. The model isn't lying. You asked a yes/no question with a friendly tone,
Ask an AI "is this code good?" and you'll get "Looks good! A few minor suggestions..." almost every time. That's not a review. That's politeness.
The model isn't lying. You asked a yes/no question with a friendly tone, and it gave you a friendly yes. Change the question and you get a different tool. Here are seven prompts I use every day.
1. Ask how it breaks, not whether it's good
What are the 3 most likely ways this code breaks in production? Rank them by impact and give a fix for each.
This forces the model to look for failure modes instead of confirming your work. Ranking by impact stops it from burying the one real bug under five style nits.
2. Paste three things before asking for a fix
Most "the AI gave me wrong code" complaints come from missing context. Before asking, paste:
- The exact error. Copied, not paraphrased.
- The function that throws it. Not the whole repo.
- What you expected to happen. This is the one people skip, and it's the one that matters most.
3. Ask for a plan before the code
Before writing any code, list the files you'd change and why. Wait for my OK.
A wrong plan is cheap to fix. A wrong 200-line diff is not.
4. Make it explain its own diff
Explain this diff line by line. Point out anything you're unsure about.
If the model can't explain a change clearly, the change is probably wrong. This catches hallucinated APIs fast.
5. Give it a role with a grudge
Review this as a senior engineer who has been paged at 3 a.m. by this service twice this month.
Sounds silly, works well. It shifts the review from style to reliability: timeouts, retries, logging, error handling.
6. Ask for the result, not for permission
Compare:
Could you maybe help me write a migration for this table?
and
Write a migration that adds a nullable
archived_attimestamp toorders. Output only the SQL.
The second one gets you working output on the first try. Hedged prompts get hedged answers.
7. Reset when it starts "forgetting"
After a long session the model mixes up old decisions and repeats itself. Don't fight it. Open a new chat and paste a five-line summary:
- Goal
- Constraints
- Decisions made so far
- Current state
- Next step
Fresh context beats a long, polluted one every time.
What's your go-to review prompt? Drop it in the comments. I'm collecting the good ones.
Disclosure: I work on MadGPT, an AI workspace with 7 models and a VS Code agent. The prompts above work with any assistant. This article was drafted with AI assistance and edited by a human.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.