Sub topic 7
Review the plan like a design proposal
This chapter assumes you can read a diff, run a project's tests, and have already asked an agent for a plan that lists files, steps, risks, and a verification method. Here you will review that plan before anything is edited.
Why review like a design proposal
A plan is a cheap place to find mistakes. Changing a sentence costs nothing. Changing code that has already been written costs a revert, a re-run of the tests, and your attention. Treat the plan the way you would treat a colleague's design proposal: read it critically, check it against what you know about the project, and send it back if it is wrong.
The agent can only plan from what it read. You know things it may not: how the service is deployed, which module is about to be rewritten, and which conventions the team follows. Review is where that knowledge enters.
Check the plan against six questions
Use this checklist on every plan. Each item catches a different kind of error.
- [ ] Does the plan solve the problem I described, not a nearby one?
- [ ] Are all listed files ones I expect to change?
- [ ] Is anything changed that I did not ask for?
- [ ] Are the assumptions true for this project?
- [ ] Is there a concrete way to verify the result?
- [ ] Are the steps small enough to review one by one?The table below links each question to the failure it catches.
| Question | Failure it catches |
|---|---|
| Right problem? | The agent solved a similar but different task |
| Expected files? | Hidden scope, such as edits to unrelated modules |
| Anything unrequested? | Extra refactors or new dependencies |
| Assumptions true? | A plan built on a wrong fact about your system |
| Verifiable? | "It should work" with no test or command to prove it |
| Small steps? | One large step that cannot be reviewed in pieces |
Worked example
Suppose the agent returned this plan for the /login rate limit.
## Plan: rate limit /login
### Files
- `auth/routes.py`: call the limiter before checking credentials
- `auth/limiter.py` (new): in-memory counter keyed by IP
- `tests/test_login_limit.py` (new): tests for the limit
### Steps
1. Add the limiter module with a function that records a failure and reports whether the limit is exceeded.
2. Call it from the login route and return the existing error format when exceeded.
3. Add tests for under the limit, at the limit, and after the window expires.
### Risks and assumptions
- Assumes a single server process; an in-memory counter is not shared across processes.
- Assumes the client IP is available from the request object.
### Verification
- Run the new tests and the existing auth tests.Go through the checklist.
- Right problem. The goal was to reject more than 5 failed attempts per IP in 10 minutes. The plan's step 3 tests the window, so it matches.
- Files. All three are plausible. Nothing outside
auth/andtests/is touched. - Unrequested changes. None. No new dependencies, which respects the constraint.
- Assumptions. Here is the problem. If your deployment runs several processes, an in-memory counter lets an attacker multiply the limit by the number of processes. The agent was honest about the assumption, but the assumption is false for this project.
- Verification. Tests are named, but nothing says how to simulate several processes. Note that gap.
- Step size. Three steps, each small enough to inspect.
The review found one wrong assumption and one weak test. Both go back to the agent in a single message.
The plan looks good with two changes:
- Use the shared Redis client instead of an in-memory counter, since we run several processes.
- Add the limit values to the existing config file instead of hard-coding them.
Please update the plan. Do not edit any files until I reply "approved".Notice that the message states the correct fact and the reason. It also repeats the no-edits rule, so a revision cannot turn into an implementation.
Exercise
A plan lists auth/routes.py, auth/limiter.py, and billing/invoice.py, and its steps never mention billing. Which checklist question flags this, and what should you do?
Show answer
"Are all listed files ones I expect to change?" and "Is anything changed that I did not ask for?" both flag it. Ask the agent why billing/invoice.py is listed. If there is no good reason, tell it to remove the file from the plan and ask for a revised plan before approving.