How to break a feature into implementation chunks for TDD workflow.
Trace the feature through the application layers:
User action
-> UI handler
-> Domain service / use case
-> Data layer (DB, API, file)
If changing file A requires changing file B to compile:
Data layer (no deps) -> Domain layer -> UI layer -> Verification
For each chunk, define acceptance criteria — explicit pass/fail conditions that determine whether the chunk is done. These are the “sprint contract” agreed before implementation begins.
Good acceptance criteria are:
Then write compact resume instructions that include:
{
"id": 1,
"name": "buildShareText and toDuplicate helpers",
"acceptance_criteria": [
"buildShareText returns formatted string with title and date",
"buildShareText includes location when present, omits when empty",
"toDuplicate copies all fields except generates new ID",
"toDuplicate preserves timed format with start/end times"
],
"files_create": [],
"files_modify": ["src/domain/model/Item.ts"],
"test_files": ["src/domain/model/Item.test.ts"],
"tdd": "Write 6 tests: property mapping, default ID, date format, timed format, location present, location empty. Run -> compile error -> implement -> pass.",
"depends_on": []
}
{
"id": 2,
"name": "Share button in QuickView",
"acceptance_criteria": [
"Share button renders in QuickView detail panel",
"Button click triggers onShare callback with current item"
],
"files_create": [],
"files_modify": ["src/ui/components/QuickView.tsx"],
"test_files": [],
"tdd": "No unit test (UI). Verified by build.",
"depends_on": [1]
}
{
"id": 3,
"name": "App-level callback wiring",
"acceptance_criteria": [
"Share callback connected from App to QuickView",
"Share action calls buildShareText and opens share dialog"
],
"files_create": [],
"files_modify": ["src/App.tsx"],
"test_files": [],
"tdd": "No unit test (wiring). Verified by build + full suite regression.",
"depends_on": [1, 2]
}
{
"id": 4,
"name": "Full Regression + Quality Verification",
"acceptance_criteria": [
"Full test suite passes with no new failures",
"Build compiles without errors or new warnings",
"8-point quality checklist completed"
],
"files_create": [],
"files_modify": [],
"test_files": [],
"tdd": "Run full test suite + build. Run 8-point quality checklist.",
"depends_on": [1, 2, 3]
}
Bad: 10 chunks for a 3-file change Good: 1-3 chunks that map to natural boundaries
Bad: Chunk A changes shared type, Chunk B changes consumer Good: Single BATCH chunk that changes both together
Bad: “Implement the feature” Good: “FILES: Item.ts. Add buildShareText() method matching format in existing formatEvent(). PATTERN: Follow formatEvent() in EventService.ts:42. DO NOT: Change return type of getItems().”
Bad: Writing DOM/render tests for a simple layout change Good: Build verification + manual testing for pure UI, unit tests for extracted logic