CodingIntermediate
Review my code like a senior engineer
A prompt that asks AI to review your code like a senior engineer, ranking bugs, security issues and readability problems with fixes, plus tips.
Last reviewedThe prompt
Act as a senior [language] engineer. Review this code for bugs, security issues and readability. Give a numbered list, most important first, with a fixed snippet for each issue. Code: [paste here]
Why it works: Ranking by importance keeps the review focused on what matters.
Works in ChatGPT, Claude and Gemini
When to use it
Use this before you ask a colleague to review a change, or when you work alone and want a second pair of eyes. It will not replace a human reviewer, but it often catches simple mistakes and unclear naming first.
How to use it
- Replace [language] with the language, and paste the code.
- Read the numbered list from the top. It is ordered by importance, so start there.
- Apply fixes one at a time, running your tests after each change.
A filled-in example
prompt
Act as a senior JavaScript engineer. Review this code for bugs, security issues and readability. Give a numbered list, most important first, with a fixed snippet for each issue.
Code:
app.get("/user", (req, res) => {
const user = db.query("SELECT * FROM users WHERE id = " + req.query.id);
res.send(user);
});Ways to adapt it
- Focus the review. "Only look at security" or "only look at performance" narrows the output.
- Add the context. "This runs in a public API with thousands of requests a day" changes what matters.
- Set the standard. "Follow our team's style guide: [paste key rules]".
- Ask for questions. "What would you ask the author about their intent?" can find design problems.
Mistakes to avoid
- Treating it as an approval. Passing an AI review does not mean the code is correct or safe.
- Sharing code you are not allowed to share. Check your employer's rules first. See what not to paste into a chatbot.
- Applying fixes without understanding them. If you cannot explain a change, do not merge it.
More prompts to try
- CodingWrite unit tests for a functionListing the case types gives you better coverage than just "write tests".
- CodingExplain this code like I am a beginnerIt asks for a level, a structure, and a useful extra step.
Keep reading
- GuidesAI hallucinations: why chatbots make things up4 min read
- GuidesWhat not to paste into ChatGPT: a privacy guide5 min read