Skip to main content
MethodTechnology & DevelopmentCode qualityIntermediate

Review code with AI

A structured code review for correctness, security, performance and readability, with concrete fixes.

This is a practical, copy-paste process for before merging changes.. Use it when you want a clear structure, then add your own details and the linked evidence.

Published by Deepstory Research. Reviewed Sep 2026.

How to use this method

  1. 1. Copy or downloadCopy the prompt below, or download the method file and attach it to your chat.
  2. 2. Paste into any AIChatGPT, Claude, Gemini or Copilot. Replace each [PLACEHOLDER] with your details, or let the AI ask you.
  3. 3. Add evidenceAttach the evidence files listed on this page so the AI works from sourced numbers, not guesses.

The prompt

Paste it as-is. The AI will ask for anything still in [BRACKETS].

Download .md
# Review code with AI
Method by Deepstory Research: deepstoryresearch.com/method/code-review

You are a meticulous senior engineer reviewing a pull request. Follow the method below step by step. Goal: A structured code review for correctness, security, performance and readability, with concrete fixes.

## My inputs
- Code or diff: [CODE_OR_DIFF]  (example: paste)
- Language and framework: [LANGUAGE_AND_FRAMEWORK]  (example: TypeScript/React)
- What the change is meant to do: [WHAT_THE_CHANGE_IS_MEANT_TO_DO]  (example: describe)

Before you start: if any input above is still in [BRACKETS] or missing, ask me for it in one short numbered list and wait. Do not guess. If I attached files (data, briefs, Deepstory evidence files), treat them as the primary source.

## Steps to follow
1. Summarise what the change does.
2. Check correctness and edge cases.
3. Check security (injection, auth, secrets, input validation).
4. Check performance and resource use.
5. Check readability and tests.
6. Rank findings by severity with suggested code.

## Deliver the output in this structure
- Summary
- Findings table (severity, location, issue, fix)
- Suggested patches
- Missing tests

## Quality rules
- Only report issues you can point to in the code.
- Label every number as FACT (with source and date), ESTIMATE (show the calculation) or ASSUMPTION.
- If a Deepstory evidence file is attached, use its figures as the reference values and cite its source references; tag claims that are not from it as [UNVERIFIED].
- End with: the 3 assumptions that matter most, what would change the answer, and the single best next step.

What you need to give the AI

InputPlaceholderExample
Code or diff[CODE_OR_DIFF]paste
Language and framework[LANGUAGE_AND_FRAMEWORK]TypeScript/React
What the change is meant to do[WHAT_THE_CHANGE_IS_MEANT_TO_DO]describe

Use it when

  • Before merging changes.
  • Learning from your own code.

Best with: AI coding assistants with repository access, or paste the diff.

What you get

  • Summary
  • Findings table (severity, location, issue, fix)
  • Suggested patches
  • Missing tests

The procedure, step by step

Read this before you run it, so you can check the AI actually followed the method.

  1. 1

    Summarise what the change does.

  2. 2

    Check correctness and edge cases.

  3. 3

    Check security (injection, auth, secrets, input validation).

  4. 4

    Check performance and resource use.

  5. 5

    Check readability and tests.

  6. 6

    Rank findings by severity with suggested code.

Quality checks built into the prompt

  • • Only report issues you can point to in the code.
  • • Every number labelled FACT, ESTIMATE or ASSUMPTION; claims outside attached evidence tagged [UNVERIFIED].

Evidence for this method

This method runs on your own material: your files, brief or code. If your task needs market or economic numbers, attach a sourced context file from the evidence library alongside the prompt.

Browse evidence

Run next

Methods that chain well after this one.

Deepstory methods are process guidance for AI tools. Review AI output before relying on it; legal, tax, medical and investment decisions need a qualified professional.