Code review

Reviews code like a demanding pull request: findings by severity, fixes and suggested tests.

Fill in the fields to adapt this prompt to your case and copy it in one click. Works with ChatGPT, Claude, Gemini and other AI tools.

  • code review
  • code
  • pull request
  • bugs
  • security
  • refactoring
  • best practices

Generate your prompt

Details to fill in:

  • Language or framework
  • What it does and where it's used
  • Project priorities
  • Code
Act as a senior developer who's an expert in [language or framework] and review this code as you would in a demanding but constructive pull request. Context: - What it does and where it's used: [short description of the code] - Project priorities: [for example security, performance or maintainability] Code: """ [paste the code here] """ Task: 1. Review, in this order: logic errors, security (input validation, injections, permissions and exposed secrets), error handling and edge cases, concurrency and resources, performance, and readability or design. 2. For each finding, include severity (critical, high, medium or low), your confidence level, where it is (function or line), what problem it causes in practice and how to fix it, with the corrected snippet. 3. Suggest the tests you'd add to cover the riskiest cases. Response format: first a one-line verdict (approve, approve with changes or reject); then the findings ordered by severity; then, in a short separate list, minor style details; finally, what's done well and should be kept. Rules: - Report only real problems: if something is fine, say so instead of inventing remarks. - Propose minimal, justified changes, not a full rewrite. - If the behavior depends on code I haven't shown you, state your assumption or ask about it.
See all prompts

How to use this prompt

  1. Fill in the form. Anything you leave empty stays in brackets.
  2. Copy the prompt and paste it into a new chat with your AI.
  3. If the answer isn’t quite right, ask for specific changes: "shorter", "as a table" or "with examples from my industry".

Have your own prompt? Improve it with the prompt optimizer.