Skip to content
ContentsChapter 2: Breaking Down the Project and Building the Foundations

Part I: Rethinking the Work and Planning the Foundations

Chapter 2: Breaking Down the Project and Building the Foundations

Imagine saying to an assistant, "Write me an e-commerce product-management system." It hands back a polished set of list and edit pages; products can be added, and the demo seems complete. You then add one more requirement: the same product comes in different colors and sizes, and each combination records its own inventory. The table that previously had only a price field and an inventory field suddenly cannot answer which variant's inventory a given order reduces. The difficulty in this teaching scenario is not that the pages are insufficiently refined; it is that the dependencies between the data model and business logic were never sorted out before implementation. Before adding more buttons to the pages, you first have to state what parts the system consists of, and which agreements must be settled first.

Quite a few projects collapse starting from the developer's one-shot "wish" to the AI. Unconstrained instructions leave the AI to invent dependencies and boundaries that the planner should have defined.

"Systematic decomposition" must therefore be enforced. Before any code is written, the architect must construct the system's "dependency tree," in their head or in a document, and make the order of implementation explicit. You must strip away the interwoven complexity of the business and break the large system down into engineering nodes with linear, one-way dependencies.

The common sequence is: phase one lays the foundations — defining the database table schemas and the core data model; phase two raises the load-bearing walls — writing the core business logic and the service-layer interfaces; phase three runs the utilities — handling cross-cutting concerns such as authentication, caching, and third-party APIs; phase four, only then, is the finishing work — the front-end UI and interaction. The core principle is this: when the underlying model is not yet established and the dependencies are not yet sorted out, do not let the AI skip ahead across layers to implement upper-level business; if there is a genuine reason to adjust the order, record the basis in the blueprint.

After breaking the tasks down along the dependency tree, we need to set "structural milestones" along the implementation route. In an AI development workflow, you must never let the AI generate thousands upon thousands of lines of code in one breath and then cross your fingers to see whether it runs.

What qualifies as a structural milestone? It does not mean "finished writing a certain file" or "accumulated 500 lines of code"; it is an intermediate state that can run independently, can be tested, and is logically self-contained. It is the equivalent of topping out a floor in building construction.

For example, completing "the definition of the user entity class (User Model) together with its database migration script" is a standard structural milestone. Even if at this moment it has no front-end interface at all, not even an API endpoint, its data structure is clear and its field types and relationships are complete; a simple unit test or script can exercise the database insertion. Only when this self-contained milestone has been accepted, baselined, and protected from arbitrary changes can it become the solid foundation for the next milestone (such as developing the login interface).

And meeting a milestone must rely on an extremely rigorous acceptance mechanism. This leads to "acceptance-driven development" for the AI era — it carries forward TDD's idea of "fix the criteria first, then write the implementation," extending test cases into acceptance items that cover function, boundaries, and architectural constraints.

In the past, TDD meant writing the test cases first and then writing your own code to pass them; in the AI era, you set the "acceptance criteria" first and then let the AI produce the code. Before the AI outputs a single line of substantive code, the architect must first feed that node's acceptance rules to the AI as a prompt.

If you only say "implement a user login feature," the AI may offer widely varying implementation plans and may miss the boundary conditions you care about. The correct "acceptance-driven" instruction reads: "Next, implement user login. Your code must meet the following acceptance criteria: 1. Accept account credentials: an account identifier and a password. 2. Verify the password using Bcrypt hash comparison. 3. Only after successful verification, issue a JWT that includes User ID and is valid for only 2 hours. 4. Define and throw a 401 AppException for all authentication failures. Classify other exceptions separately according to the global exception-handling convention. Once you understand these boundaries, begin writing the code."

Set the acceptance criteria first, then let the AI produce code. This is not only handing the AI a precise blueprint; it also draws clear acceptance red lines for the architect. Code that has not completed the agreed acceptance should not be marked as an accepted milestone, or treated as a reliable dependency for the next stage; what is not yet verified and what has been established as failed must be recorded separately. So-called acceptance must correspond to specific criteria, an implementation version, and supporting material. The next chapter, "Evidence Discipline," answers this: is the material sufficient to support our judgment of a completed state? When a judgment changes in later checks, a retrospective ledger (a record preserving the basis, failures, unknowns, and revision relationships, developed later in the book) is needed to continue the work.