TutorialsPreview
Ship Production Software with AI

Ship Production Software with AILesson 4

Build with AIReferenceintermediate15 minShip Production Software with AI

Cut the work into agent-sized tasks

Lesson 3 of 5 — the unit of work that keeps you in control.

You will learn

How to size a task for review, sequence tasks to manage risk, and recognise when a prompt is too big to trust.

Prerequisites

Lesson 2 — you have a spec to decompose.

The reviewable unit is the real unit of AI-augmented work. If you cannot hold an entire change in your head well enough to spot what is wrong, the change is too big — no matter how good the model is. So you cut.

Concept · ai/task-decomposition
Catalog

Task decomposition

Cutting a feature into units small enough to review and verify in a single pass — the unit of work in AI-augmented development.

Want the full picture? Open the reference →

How to size a task

  • One concern per task — the route, OR the validation, OR the UI. Not all three.
  • Independently verifiable — each task ends at a state you can run or test.
  • Reviewable in one sitting — if the diff would not fit on your screen, split it.
  • Ordered by risk — the contract and data model first; they are expensive to change once code leans on them.
1. Schema + migration: post_draft table (postId, body, updatedAt). [verify: migration runs]
2. API route: POST /api/posts/:id/draft, owner-only, upsert. [verify: 3 tests pass]
3. Client hook: useAutosave(postId, body) — debounce + retry queue. [verify: saves after 2s idle]
4. Wire into editor + a "saved at HH:MM" indicator. [verify: by hand]
The "save draft" feature, decomposed
DetailSequencing: why contract-and-data go first

Code written against a contract is cheap to keep; a contract changed after code depends on it is a cascade of edits. Lock the shape (schema, signatures) in an early, small, heavily-reviewed task. Everything downstream then leans on something you already trust, and each later task stays a one-pass review.

Try it

Decompose your feature into 3–5 tasks. Write the one-line verification for each before you prompt for any of them.

Concepts covered · 2

More like this

A
Reference·beginner·15 min

Add todos with JavaScript

Wire the form so typing and pressing Add creates a real item. You will hold the todos in an array and render the list from it — the pattern every UI framework formalises later.

C
Reference·beginner·14 min

Complete & delete

Click a row to toggle it done; click the × to delete it. You will do it with a single listener on the list — event delegation — instead of one per row.

O
Reference·advanced·18 min

Orchestrate agents without the codebase rotting

Putting it together: context, guardrails, and a verification loop that lets you run coding agents across a real codebase without it drifting into an incoherent pile. This is the senior loop at full speed.

Liked this one?

Pass it on

Discussion

Be the first to ask

Your questions stay private with the team. We can pin answers to share with everyone.

Sign in to ask a question privately on this tutorial.

Sign in

No pinned answers yet for this tutorial.