Sub topic 2
What a useful plan contains
This chapter assumes you have used a coding agent on a repository, can read a diff, and can run a project's tests. It covers what a plan should contain so you can judge one before approving it.
Why the contents matter
A plan is only useful if you can check it. A vague plan such as "add rate limiting and write tests" tells you nothing you could disagree with. A good plan is specific enough that you can find a mistake in it before any code exists.
A useful plan has four parts:
- The files expected to change, and why.
- Ordered implementation steps.
- Risks and assumptions.
- A way to verify the result.
You can ask for these four sections by name in your planning request. The next chapters cover how to write that request. Here the focus is on what each section should look like.
The four parts
Files and reasons
The plan lists each file it expects to change or create, with a one-line reason. This is your scope check. If a file you did not expect appears, ask why. If a file you expected is missing, the agent may have misunderstood the task.
Ordered steps
Steps should be small and in dependency order. Each step should be something you can review on its own. "Add the limiter module" is reviewable. "Implement the feature" is not.
Risks and assumptions
An assumption is something the plan treats as true without having confirmed it. Plans often depend on facts the agent cannot see, such as how many server processes run in production. Writing assumptions down gives you a chance to correct them. Risks are things that could go wrong even if the assumptions hold.
Verification
The plan should say how you will know the change works: which tests to run, which new tests to add, and what behavior they cover. A plan with no verification step leaves you to invent your own check later.
A worked example
Suppose you asked for rate limiting on a /login endpoint: reject more than 5 failed attempts per IP address in 10 minutes, with no new dependencies. A plan that contains all four parts looks like this:
## 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.Notice what you can check here:
- Every file has a reason, and none is unrelated to login.
- Step 2 mentions the existing error format, which matches your constraint.
- The first assumption is something only you know. If you run several processes, the plan is wrong and you can say so now.
- Verification names concrete tests, including the boundary cases (at the limit, after expiry).
Weak plans and strong plans
| Part | Weak | Strong |
|---|---|---|
| Files | "Some auth files" | Each path, with a reason |
| Steps | "Implement and test" | Small steps in dependency order |
| Risks | Missing, or "none" | Named assumptions you can confirm or reject |
| Verification | "Make sure it works" | Specific tests and the behavior they cover |
Exercise
A plan for adding a feature lists three steps and the files to change, but has no risks section and no verification section. Which two things can you not check before approving it, and what should you ask for?
Show answer
You cannot check which assumptions the plan depends on, and you cannot check how the result will be verified. Ask the agent to add a risks and assumptions section, and a verification section that names the tests to run and the behavior they cover.