---
type: method
slug: code-review
title: "Review code with AI"
category: "Technology & Development"
subcategory: "Code quality"
level: intermediate
source: https://deepstoryresearch.com/method/code-review
publisher: Deepstory Research
---

> **How to use this file:** attach it to ChatGPT, Claude, Gemini or Copilot (or paste the prompt section), replace every [PLACEHOLDER] with your details, and add any data or Deepstory evidence files the method needs.

## When to use this method
- Before merging changes.
- Learning from your own code.

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

## Prompt

# 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.

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