Skip to main content
Building with AI (Vibe Coding)

⏱ About 20 min20 XP

Decomposing a Build

You have requirements, a scope, a component design, a data model, and a technology plan. Now you face the build. Staring at a complete architecture and wondering where to start is one of the most common causes of paralysis in software projects. The answer is decomposition: breaking the whole project into an ordered sequence of small, concrete tasks, each small enough to build and test in a single work session — and in the context of AI-assisted building, small enough to fit in a single well-focused prompt.

What Makes a Task the Right Size

A well-sized task has three properties. First, it has a single, verifiable output: when the task is done, you can run a specific test or check a specific behavior to confirm it. Second, it is independent enough that it can be built and tested without requiring all other components to be complete. Third, it is small enough to hold entirely in your head — or in a single AI prompt — without losing track of the goal. Tasks that are too large produce multiple problems at once. When you test and something fails, you do not know which part of the work introduced the failure. When you ask an AI to implement a large task, the model has to make more decisions without guidance, and each decision is a potential source of error. When the task takes days rather than hours, motivation erodes and the context you had at the start fades. Tasks that are too small are also a problem, but a less damaging one: excessive granularity creates overhead without proportional benefit. A rule of thumb for student projects: a task should represent roughly 30 to 90 minutes of focused work. If estimating consistently that a task will take more than two hours, decompose it further. For AI-assisted building, the practical constraint is the prompt: one task, one prompt (or one short conversation). If completing a task requires the AI to simultaneously design a database schema, implement an API endpoint, and write front-end code, that is three tasks that have been collapsed into one. Separate them. Example: Implementing user authentication can be decomposed into these tasks: (1) Design the users table schema and create the migration. (2) Implement the sign-up endpoint — accept email and password, hash the password, insert the user record, return a session token. (3) Implement the login endpoint — verify credentials, return a session token on success, return an error on failure. (4) Implement the session middleware — validate a token on incoming requests and attach the user object to the request context. (5) Implement the logout endpoint — invalidate the session token. Each of these is independently buildable and testable.

One Task, One Prompt

For AI-assisted building, calibrate task size to prompt size. A task is the right size if it can be given to an AI in a single, focused prompt that specifies the interface, the data it touches, and the expected behavior. Tasks too large for a single prompt should be split.

Ordering tasks is as important as sizing them. The dependency graph of your tasks — which tasks must be complete before others can begin — determines the order. Build foundational layers before dependent layers. This almost always means: data model and schema first, then API or back-end logic, then front-end components that consume the API. Within each layer, build in order of dependency. If the Product component depends on the Category component, build Category first. If both a search feature and a saved-items feature depend on the user authentication being complete, authentication is a prerequisite for both and goes first. A useful tool for visualizing task order is a simple dependency list: for each task, write one line that reads "Task N depends on: [list of task numbers]." Tasks with no dependencies go first. Tasks whose dependencies are all complete go next. This produces a valid build order without needing formal project management software. When using AI assistance, the build order also determines the context you can provide. Once the data schema exists, you can include it in the prompt for the API layer: "Here is the schema you must use." Once the API exists and its interface is defined, you can include it in the front-end prompt: "Here are the endpoints and their response shapes." Each completed task becomes a constraint that makes the next prompt more precise and the AI's output more accurate. A final principle: integrate frequently. After each task, combine the new piece with what exists and verify that the whole still works. Integration problems discovered after one task is much easier to fix than integration problems discovered after ten tasks have accumulated.

Match each task-decomposition concept to its definition.

Terms

Dependency graph
Task granularity
Foundational layer
Continuous integration
Build order

Definitions

A component or module that others depend on and must be built first
The practice of combining new code with the existing codebase frequently to catch conflicts early
The size of an individual task — how much work it represents
A map showing which tasks must be completed before others can begin
The sequence in which tasks are executed based on their dependencies

Drag terms onto their definitions, or click a term then click a definition to match.

Writing a Task List

A task list is a concrete artifact: a numbered list of tasks, each with a title, a description of the expected output, and a list of its dependencies. Writing the task list before building serves multiple purposes. It gives you a map so you always know what to work on next. It lets you estimate total effort by summing task estimates. It gives your AI collaborator a precise context for each prompt. And it gives you checkpoints: each completed task is a moment to test, commit, and verify progress. A task list entry might look like: Task 7: Implement the searchRecipes API endpoint. Output: A GET endpoint at /api/recipes/search that accepts a query string parameter and returns an array of recipe summaries matching the query. Searches the title and tags fields. Returns an empty array (not an error) when nothing matches. Depends on: Task 3 (recipes database table), Task 5 (database connection module). Estimate: 45 minutes. That level of specificity is not bureaucratic overhead — it is the specification for your AI prompt. You can paste that task entry directly into a prompt as the task description, add your technology context header, and receive a focused, usable implementation. Task lists also serve as progress records. As you complete tasks, mark them done. If you pause a project for a week and return to it, the task list tells you exactly where you left off. This is especially valuable in AI-assisted projects, where the conversation history may be lost between sessions.

Task Lists Are Living Documents

Your initial task list is a starting estimate, not a contract. As you build, you will discover tasks you missed and tasks you over- or under-estimated. Update the list as you go. A task list that reflects reality is useful; one that reflects your original guess is just noise.

A student builds an entire social feed feature in one session — posts, likes, comments, and notifications — then discovers nothing works together. What decomposition error did they make?

Which task ordering is correct for building a weather dashboard app?

Build Order Map

  1. Step 1: Take your running project. List every task required to complete the MVP — aim for 10 to 15 tasks.
  2. Step 2: For each task write: a title, a one-sentence description of the expected output, and a time estimate.
  3. Step 3: For each task write 'Depends on: ...' listing any tasks that must be complete first.
  4. Step 4: Identify which tasks have no dependencies — these are your starting tasks.
  5. Step 5: Order all tasks so every task appears after all of its dependencies.
  6. Step 6: Sum your estimates. Does the total fit your available time? If not, identify tasks to move out of scope or combine.
  7. Step 7: Write the task entry for task 1 in the full format shown in this lesson: title, output description, dependencies, estimate.