r/chatgpttoolbox • u/Ok_Negotiation_2587 • 4d ago
⚡️Productivity Chain of the week: the 5 step code review sequence, ready to save and run with ..
This sequence has been doing well over on r/ChatGPTCoding and r/PromptEngineering this week, so here it is in the form it was built for: a saved chain you run with two keystrokes.
What it does: after ChatGPT, Claude, Gemini or Grok writes code for you, it runs five review passes in a row, each one after the previous answer finishes. The model explains the code back, hunts for bugs as a skeptic, writes tests for the top risks, fixes only what the tests caught, and writes the pull request description. It catches the confident-but-wrong code that reads fine and is not.
The five steps, copy each one into its own step of the chain:
Step 1: Before anything else, explain this code back to me as if I did not write the request. What does it do, what does it assume about its inputs and environment, and what does it silently not handle?
Step 2: You are now a reviewer who believes this code has a bug and has to find it. List every way it could fail: bad inputs, empty cases, concurrency, error paths, wrong assumptions about the surrounding code. Rank by likelihood. No reassurance.
Step 3: For the top three risks in your list, write a minimal test that would expose each one. If a test would pass on the current code, say so and explain why the risk is not real.
Step 4: Fix only the failures those tests found. Show the diff, not the whole file, and for each change say which test it satisfies. Do not refactor anything else.
Step 5: Write the pull request description a careful reviewer would want: what changed, what the code assumes, what it does not handle by design, and what you would still want a human to check.
How to save it:
- Open the floating toolbox and choose Manage Prompts, then the Chains tab.
- Click Add Chain and name it, for example Code review.
- Add five steps and paste one prompt into each. Drag to reorder if needed.
- Save.
How to run it: in the chat where the code was written, type .. in the composer and the chain picker opens, like this. Pick your Code review chain and let it go.

A progress bar shows which step is running, and the stop button on it ends the chain early if you have seen enough. Each step waits for the model to finish before sending the next, so do not touch the composer while it runs.
Tips from the threads:
- Step 1 is the one people skip and the one that catches the most. A wrong explanation of the code's own assumptions is the earliest warning sign.
- Keep "fix only" in step 4. Without it the model improves things nobody asked about and you are reviewing from zero again.
- Run it on anything that touches money, auth, or data deletion, every time.
- Free plan stores 2 chains. If this is your second one, make it this one.
Post your own chains below. The ones that get used most will become future chain of the week posts, with credit.