Your agent is set up and the app skeleton runs. You type a request and it takes off, writing files faster than you can read them. Dictate every keystroke and you lose the speed you came for; say "build my app" and walk away and you get something confident and wrong. This chapter is the middle path: point the agent at the goal, and steer it before it drifts.
5.2.1Give the goal, not the keystrokes
The agent is strongest when you hand it intent and boundaries, not a step-by-step procedure. You are the one who knows what "done" means and what must not break. It knows a thousand ways to get there, so describe the destination and let it pick the road.
| Keystrokes (don't) | Goal + constraints (do) |
|---|---|
"Add a role prop to UserCard, then map over it" | "Show each user's role on their card" |
| "Write a for-loop that sums the items" | "Total the cart, and handle an empty cart" |
5.2.2Work one slice at a time
Hand the agent one slice, one small self-contained change that either works or does not, never the whole feature at once. A slice is small enough that you can check it in a couple of minutes, and small enough that the agent still has room to do it well.
Turning each finished slice into a save point you can roll back to is its own discipline, and the chapter on working in small steps covers it. Here the rule is only about size: keep the task small enough to steer.
5.2.3Check its work before accepting
Before you accept a slice, look at what it changed and confirm it does what you asked. Running without an error is not the same as correct, and the agent will happily report success on the wrong thing.
Reading the agent's code closely is a skill of its own, covered when we get to reviewing what it wrote. For now the rule is blunt: never accept a slice you have not looked at.
5.2.4Steer early, before it drifts
The cost of a wrong turn grows with every line built on top of it. Catch it at the first sign and one sentence corrects it. Catch it after five hundred lines and you are untangling. So watch the first file the agent touches and the plan it proposes, not just the finished result.
Rule of thumb: correct the agent on its first wrong turn, not its tenth. A nudge now is a rewrite later.
5.2.5Turn any task into a steering brief
This prompt makes the agent slow down at the one moment that matters, before it writes code:
Act as a senior engineer. Before writing any code
for the task below, do this in order:
1. Restate the goal in your own words.
2. List the constraints and what must not break.
3. Propose the smallest first slice, one change
I can verify in a couple of minutes.
4. Stop and wait for my OK before coding.
After I approve, build only that slice, then show
me exactly what you changed and why.
My next feature:
Do this now: take the next thing you want built, paste the prompt above, and make the agent restate the goal and propose one slice before it writes a single line.