Skip to content
ContentsChapter 8: Practicing the Standard Implementation Workflow

Part III: Standardizing Deliverables and Practicing the Workflow

Chapter 8: Practicing the Standard Implementation Workflow

To make the architect's approach part of the development team's daily practice, we need to establish a firm standard operating procedure (SOP). This SOP is a rigorous closed loop: every act of generating and merging code must pass strictly through the following six steps:

From Decomposition to Acceptance

The first step is Decomposition. Faced with the current requirement, strip away the business complexity in your mind and find a "structural milestone" that can run independently.

The second step is Issue the implementation prompt. Stop treating the AI as a code-completion tool; instead, issue it a prompt that carries "strict acceptance criteria." State clearly the input and output boundaries, the architectural constraints that must be followed, and the underlying non-negotiable constraints that must not be touched.

The third step is Coding. This is usually the step that takes the least time: hand it entirely to the large model to generate the code quickly and apply it to the project.

The fourth step is Acceptance. The architect steps in and reviews the code from a careful, objective perspective. Look not only at whether the test cases run through, but even more at whether "architectural drift" has occurred and whether unnecessary coupling and complexity have been introduced. Following "Evidence Discipline," you must also map the criteria, the implementation version, the execution material, and the recheck results item by item, and record the conditions not covered.

Decide the Next Action and Begin the Next Iteration

The fifth step is the core one: Decide the next action. This is a critical decision point.

If the agreed items have corresponding material supporting acceptance, run git commit to save the version and link it to the acceptance record; the commit itself does not raise the evidence level. If the material is insufficient, record the items as pending verification and fill in the missing basis; the unknown must not be counted as either a pass or a failure.

If acceptance fails, point out the defect in architecture-level language and give the AI one or two chances to revise. If it remains unresolved, pause first and review the problem and the plan; when you decide to roll back, execute the complete rollback process in "A Core Discipline: Rebuilding from a Known Baseline." The teaching scenario below shows how to apply this choice to a specific version.

The sixth step is Update the blueprint / start a new conversation. As soon as a milestone is baselined, immediately update the CONTEXT.md living blueprint in the project root, syncing the acceptance items, the evidence references, and the unresolved items. If multiple rounds of correction with the AI have occurred in the meantime, or the current milestone is extremely important, first preserve the original conversation, the failed artifacts, and the acceptance records according to the handoff rules described earlier; then close the current conversation window and, carrying the latest blueprint, the material references, and the unresolved items, open a new session and enter the next cycle.

Teaching Scenario: Authentication and Rate Limiting

To understand this SOP more concretely, the following teaching scenario is used: building from scratch the core logic of an API gateway with authentication (Auth) and rate limiting (Rate Limit). This scenario is not presented as a verified historical case; the actions and results that follow all serve to illustrate the workflow and do not indicate that actual execution evidence exists.

In the scenario's initial stage, the architect first performs Decomposition, making it clear that the phase-one milestone is only "complete the JWT authentication middleware" and resolutely leaving the rate-limiting logic untouched. The architect then issues the implementation prompt to the AI, clearly defining the JWT parsing rules, the expiration-handling policy, and the convention for throwing custom exceptions. After the AI does the Coding, the architect moves to Acceptance and confirms that the code structure is clear and single-responsibility; under the teaching setup, the parsing, expiration, and exception behaviors should also be checked item by item, the corresponding acceptance material retained, and only then the version saved and the blueprint updated.

The work then moves into the phase-two milestone: "introduce the rate-limiting mechanism."

At this point, suppose an instance of architectural drift is deliberately allowed — for example, giving the AI only an extremely vague instruction: "Add rate limiting." Suppose this generation produces "implementation that violates agreed constraints": the AI hard-codes in-memory rate-limiting logic straight into the authentication middleware file it has only just finished writing. The code becomes bloated; authentication and rate limiting are now coupled tightly together.

The architect's warning radar sounds the alarm at once. Following the SOP, first try the "design-level correction" prompt, asking the AI to pull the rate-limiting logic out into a separate rate-limiting middleware backed by shared storage. But if the AI has now fallen into the "self-consistency trap," it may, in order to decouple, introduce an abnormally large, incompatible third-party flow-control framework, or even break the original route-binding mechanism and leave the gateway completely unable to start.

In this teaching branch, the architect reviews the problem and decides to roll back and rebuild. Following the complete process described earlier, the architect identifies as the target version the authentication implementation that is supported by acceptance material, then checks the restored state and the original acceptance scope. The point of applying this here is finding the correct authentication version; the rollback itself is not a fresh acceptance, nor does it prove that external state has been restored.

After the rebuild, the architect rewrites the prompt, refines the blueprint instructions for the rate-limiting mechanism, and explicitly requires a rate limiter backed by shared storage and continued middleware separation. Finally, preserve the original conversation and the failed material, prepare only the active context for the next round, and hand the new blueprint, the evidence references, and the unresolved items to a new AI instance.

The new round of implementation still requires checking the acceptance items for authentication, for rate limiting, and for keeping the two separated. The teaching scenario shows how to proceed; it does not offer a conclusion that anything actually passed.

This teaching scenario connects the steps of the standard implementation workflow: constrain generation with the blueprint, judge quality against acceptance criteria supported by evidence, re-implement on the selected version, and hand off through the blueprint and the evidence material.