The safest unit of AI-assisted development is a change you can explain, inspect, and verify in one sitting.
Large prompts hide several decisions inside one request. The model has to guess their order, carry assumptions across files, and decide when the work is finished. A plausible answer can still leave the repository in a mixed state.
Start with a verifiable slice
Split work by behavior, not by file count. “Add password reset” is a feature. “Return the same response for known and unknown email addresses” is one testable slice of that feature.
A useful slice has four properties:
- one visible outcome;
- a small set of relevant files;
- a known verification command;
- an obvious stopping point.
The slice can cross a controller, service, and test. What matters is that it proves one behavior. Asking for “the backend first” often creates a larger and less testable boundary.
Give the agent a task contract
Before asking for code, write a compact contract:
Goal: Return 202 when a password-reset request is accepted.
Scope: auth controller, reset service, and their tests.
Constraints: Do not reveal whether the email exists.
Proof: Run the focused auth tests and show the diff.
Stop: Do not add email delivery yet.
This is short, but it removes the expensive guesses. The goal defines the behavior. Scope limits the blast radius. Constraints protect system rules. Proof tells both of you what “done” means.
Close the loop before the next change
Review the result while the task is still small. Start with the diff. Look for unrelated edits, duplicated logic, changed public contracts, and tests that only prove the happy path.
Then run the cheapest useful checks first:
- formatter and static analysis;
- focused unit or integration tests;
- the broader test suite if shared behavior changed;
- a manual check for UI, network, or persistence behavior.
Do not stack a second request on top of an unverified first one. Every unchecked change becomes context the model may misunderstand later.
Notice when the task is too large
The loop is too large when the model keeps rediscovering requirements, edits distant modules without a clear reason, or reports success without one command that proves it.
Split again. Ask for the failing test, the interface change, or the migration separately. Small commits make the same boundary visible in version control.
Keep the human decision points
The model can propose code and run tools. I still choose the boundary, accept tradeoffs, inspect security consequences, and decide whether the evidence is enough.
That division of work is the useful part of AI-assisted coding. The model accelerates execution. Short feedback loops keep the engineering under control.