You need a booking form for a client, so you ask your coding agent to build a booking system. It returns a pile of changes spanning the form, storage, scheduling, and settings, leaving you to work out what actually works. Smaller tasks give you checkpoints you can test and review before the next change builds on them.
Start with the smallest user action worth checking, then add behavior in slices that cross the parts of the app they need. For each slice, write what changes, what stays out, and how you’ll prove it works. Run the tasks in dependency order, review and commit each passing change, and stop to re-plan when the work no longer matches the brief.
Spot a task that needs slicing
“Build a booking system” leaves too many decisions open. What can a visitor book? Is the submission a request or a confirmed appointment? Where does it go? Who can see it? What happens if a slot is already taken?
A task is probably too broad for one agent run if:
- It touches several unrelated flows, such as booking, payments, and account settings.
- You can’t name a single outcome to check when it finishes.
- You’d need a long tour of the app to know whether it worked.
- The resulting diff is too large for you to review comfortably in one sitting.
That doesn’t mean every task must change only one file. A useful slice may touch the form, its server handler, and a test because those pieces work together. The boundary is the behavior you can demonstrate, not the number of files.
Before you start, establish the existing state. Run the project’s current checks, note failures already present, and identify the branch and files you’ll work on. If the baseline is broken, record that rather than treating an unrelated failure as evidence that your new slice failed.
Slice by user behavior, not by technical layer
A layer-based plan might say “build the database,” then “build the API,” then “build the form.” Each task can look complete while there’s still no working path to inspect.
A vertical slice connects enough pieces to demonstrate one behavior. It can start with a safe fixture or a temporary response, then replace that limitation in a later task. The important part is being clear about what the slice proves and what it does not.
For the following fictional example, a freelancer wants visitors to request a fixed appointment slot. The owner needs to see requests privately. There’s no payment or email in scope, and nothing goes public until the required slices are complete.
Slice: show and submit the form in a test environment. Add a page with name, email, and slot fields. Submit to a test handler that returns a visible “test request received” response; it does not save or confirm anything. Done-check: fill in the form, submit it, and see that response.
Slice: reject invalid input. Add validation in the form and server handler. Done-check: submit a blank name or invalid email and see an error; send the same invalid data directly to the handler and confirm it is rejected there too.
Slice: save a request. Replace the test response with storage in a test database and show “request received,” not “booking confirmed.” Done-check: submit valid details, then inspect the test record for the same name, email, and slot.
Add the risky behavior deliberately
Continue the same example with slices that build on the saved request:
Slice: prevent duplicate slot requests. For this example, slots are fixed and identified by an exact slot ID. Make accepting a request and reserving that ID atomic in the database. Done-check: send simultaneous requests for the same slot against an isolated test database; one is accepted and the other receives an unavailable response.
Slice: show requests to the owner. Add a protected page that lists saved requests. Done-check: submit a test request and see it while signed in as the owner; a signed-out visitor cannot view the page or retrieve its data directly.
These are example checks, not a complete specification for every booking system. Overlapping time ranges, cancellations, time zones, notifications, and privacy requirements need their own agreed behavior and tests. Don’t imply they work because the fixed-slot example passes.
The order matters. Saving a request gives the duplicate-slot check something real to protect; storing requests also gives the owner’s page something to display. If a later slice reveals that the data structure is wrong, pause and revise the plan before adding more features.
Give every slice a done-check
A done-check is an observable result, not “the agent says it’s finished.” Use the project’s existing test command when it covers the behavior. Otherwise, write a specific click path or add a focused test.
A useful check names the starting state, action, and expected result:
With an empty test database, submit a valid request for an available slot; the page shows “request received” and a matching record exists.
A vague check such as “booking works” leaves you deciding what “works” means after the code has been written. It also makes failures harder to reproduce.
Include a negative case where it matters: invalid input is rejected, a taken slot is not accepted, or a signed-out visitor cannot access private data. Test with fixtures or accounts made for the job, not real client details.
Run the project’s relevant checks after the slice, then inspect the changes. Review tracked changes with git diff, staged changes with git diff --cached, and untracked files with git status --short. Git explains the comparisons in its diff documentation and how status reports untracked files in its status documentation.
Once the checks pass and you understand the diff, stage only the intended changes and make a local commit with a descriptive message. Git’s commit documentation explains that a commit records the staged contents. A local commit is a checkpoint, not a release.
Stop when the plan stops fitting
Don’t ask the agent to continue merely because the previous task produced code. Stop if a check fails, an expected file appears unrelated, a dependency needs new permissions, or the agent changes requirements to make a test pass.
Also stop when the slice uncovers a decision the brief didn’t settle. For example, if the client wants recurring appointments rather than fixed slots, the duplicate-slot approach above is no longer enough. Write down the question, get the answer, and adjust the affected tasks.
When a test fails, capture the command, output, and steps to reproduce it. Ask for a focused fix to the current slice, then rerun the failed check and any relevant earlier checks. If the fix expands into a larger redesign, split that work before proceeding.
Keep the feature private or disabled until its required slices are complete. The early test form in the example accepts no real booking, and the saved-request slice alone does not protect against duplicate slots. A passing slice proves its stated behavior, not the readiness of the whole feature.
Copy this prompt before the next feature
Give the agent the actual brief and any known constraints. Ask it to plan first, so you can correct a bad assumption before it changes files. This works in any coding agent; if you want one with a built-in terminal and Git commits in the same workspace, you can try the ZCode agent harness free (our invite link; the app is free, though you still need a model plan or API key, according to the ZCode FAQ).
Feature: [describe the user outcome]
Existing app and constraints: [stack, relevant files, deadline, limits]
Already working: [current behavior and checks]
Out of scope: [what must not change]
Break this feature into small vertical slices that can each be
finished and reviewed in one sitting. Order them by dependency.
For each slice, give me:
- The user-visible or observable behavior
- What is included and excluded
- The files or areas likely to change
- A specific done-check, including a failure case where relevant
- Any prerequisite or unanswered decision
Do not change code yet. Flag assumptions and ask about decisions
that would change the implementation.
Turn each agreed slice into a task using this line:
[Behavior] | Depends on: [prerequisite] | Out of scope: [boundary] | Done when: [action and expected result]
Run the first task, check it, review it, and commit it before handing over the next. If you need to change the plan, update the task list so the next run starts with the current decision, not an outdated assumption.
Slicing does mean more, smaller agent runs. If you'd rather cover them with one subscription than a per-request meter, our referral link gives a referral discount on GLM coding plans on a first subscription; Z.ai’s terms explain eligibility, and we may receive referral credits if the conditions are met.
For more practical build notes, see more on our blog. Before you hand over the first slice, Test first, then let the agent code (and prove it) shows how to turn a done-check into a test.
If this made your next feature easier to check, a small tip on the post helps keep these guides coming.






Latest comments
0