Skip to main content

Workflow

Review, debug and improve code

A structured pass over code you own: find the bug, review the change, add tests, tighten performance or security.

Inputs

Code
The file, diff or function. Paste only what you are allowed to share.
Goal
Fix a bug, review, test, speed up, secure, convert, document.
Error or symptom
Exact message or behavior.
Environment
Language, runtime, framework versions.

Context

Models are fast reviewers and unreliable judges. Use them to find candidates, then prove each one.

Constraints

  • Never paste secrets, keys or private customer data.
  • Each finding cites a line and says why it matters.
  • Proposed fixes keep behavior unless the goal says otherwise.
  • Every fix comes with a test or a reproduction step.

Output

  1. Findings ranked by impact, each with a line reference
  2. Proposed change as a diff
  3. Tests or reproduction steps
  4. What was not checked

How to judge it

Does the proposed test fail before the change and pass after?

Worked example

Input

CODE: a pagination function. GOAL: fix a bug. SYMPTOM: the last page repeats the previous page. ENV: TypeScript, Node 20.

Output

Finding: line 12 uses Math.round instead of Math.floor for the offset, so the last page rounds back.
Diff: Math.round to Math.floor.
Test: 23 items, page size 10; page 3 returns items 21 to 23.
Not checked: behavior when page size is 0.

What it will not do

  • Won't run your code or see your full repo.
  • Security review here doesn't replace a real audit.
  • Converted code still needs your test suite.

The prompt

Task: Review, debug and improve code.
Context: Models are fast reviewers and unreliable judges. Use them to find candidates, then prove each one.
Inputs:
- Code: [CODE]
- Goal: [GOAL]
- Error or symptom: [ERROR OR SYMPTOM]
- Environment: [ENVIRONMENT]
Constraints:
- Never paste secrets, keys or private customer data.
- Each finding cites a line and says why it matters.
- Proposed fixes keep behavior unless the goal says otherwise.
- Every fix comes with a test or a reproduction step.
Return, in this order:
1. Findings ranked by impact, each with a line reference
2. Proposed change as a diff
3. Tests or reproduction steps
4. What was not checked
Before you answer, check: Does the proposed test fail before the change and pass after?

Replaces these old prompts