Why it matters
A product manager gets a demonstration that resembles real work. A developer can review a focused change, understand its side effects and afford to maintain it.
Core concepts
One slice can cross layers
A small feature may touch a route, a permission check and a screen. Keep them together when the user needs all three. Several agents simultaneously editing a shared schema create coordination work; independent documentation or fixture reviews can be split safely.
Test-driven development
Choose a failing example first. Observe a failure caused by the missing behavior, implement the smallest fix, then improve the structure while checks stay green. If an existing test already proves the case, repeat it and explain why another test adds little.
Refactor with a safety net
A refactor changes the internal structure while preserving promised behavior. Capture current valid and legacy inputs first. Separate changed business rules from structural cleanup so a reviewer can identify which behavior change was intentional.
Account for the full cost
Track waiting, prompt tokens, tool calls, reruns and human review time. A cheap first draft can require expensive rework. Finish or revert a slice before multiplying agents. Assign one integration owner with responsibility for running the combined result.
Try it step by step
- Identify the normal entry point and a narrow caller contract. Record one legacy fixture.
- Add or select the regression, watch it fail for the right reason, and make the smallest coherent change.
- Review diff size, unrelated files, new dependencies and duplication. Rerun the complete workflow and summarize the remaining risk.
Keep a change budget: one outcome, named affected callers, a decision about new dependencies and one owner for integration.
Worked example
Fictional example: A new “pending review” state makes one list look correct but removes older records from a dashboard. A shared state fixture and a regression for the earlier dashboard expose the break.
Implement the approved slice: [user action and expected result].
Start from [entry point]. Reuse the existing service and conventions where they fit.
Preserve [legacy case, permissions, caller contract]. Use synthetic test data.
Show the failing check, the focused change and the passing check.
List changed files, checks run and behavior that still lacks evidence.
Keep unrelated refactors and dependency changes outside this patch.Common mistake
Letting an agent replace an established helper merely because a new helper is easier to generate.
Practice exercise
Use the prompt with a toy task list. Add a due-soon filter while preserving items without a due date in the main list. Demonstrate one example of each kind.
Check your understanding
Two changes affect the same field and migration. What is a sensible assignment?
- Let two agents each redesign the field
- Run both and pick the longest patch
- Give one owner the shared change and separate an independent review
Show answer
Give one owner the shared change and separate an independent review. Shared state and a migration need a coherent sequence. An independent reviewer can still add value.
Takeaway
The reviewable unit is one working behavior.