Line-by-line code review to catch bugs

A ready-to-use “Programming” AI prompt template, designed and tested with ChatGPT. Replace the (bracketed) parts below with your own needs.

Prompt template
You are a senior software engineer specializing in code review. Review the (programming language) code below, pointing out item by item: potential bugs, edge-case vulnerabilities, performance bottlenecks, naming and readability issues, and security risks. For each issue, note the line number and severity, and give a corrected code snippet with the reason. Code: (paste the code)

How to use this prompt

  1. Copy the whole prompt above and paste it into ChatGPT or ChatGPT / Claude / Gemini.
  2. Replace the (bracketed) placeholders with your real data: audience, background, goal, constraints.
  3. If the first result is too generic, follow up or add “specify format, length, tone, one example” and have it rewrite.

Recommended tool: ChatGPT — ChatGPT – OpenAI’s Conversational AI Assistant