Separating Planning from Execution: A Practical Guide to the New AI Coding Paradigm
This article explains why one-shot code generation struggles with real engineering constraints, and how separating planning from execution addresses them. You will learn a reusable planning document structure, task selection criteria, cost-control practices for the execution phase, common failure modes, and how to make AI-assisted development sustainable.
1. The Problem: Why “One-Prompt Generation” Falls Short in Real Engineering
AI coding tools with strong planning capabilities have drawn a lot of attention recently. From 3D game prototypes to early operating system shells, their end-to-end generation results are genuinely impressive. However, treating these demos as a measure of engineering productivity leads to two misjudgments: mistaking the completeness of demo code for production-grade quality, and treating a single, high-consumption call as a sustainable development method.
Real projects face three hard constraints: a limited context window, a limited output length per turn, and limited budget and quotas. Any attempt to build a “million-line complex application” in a single conversation will lose architectural consistency along the way. So the more useful question is not whether a given tool can generate something in one click, but how to organize the human-AI collaboration workflow so that models with different strengths each do what they are best at.
2. The Core Idea: Split Planning and Execution into Two Stages
Separating planning from execution makes the design step—the one most often skipped in software engineering—explicit, and captures it in local documents that can be version controlled.
- Planning stage: A model with stronger planning ability handles requirement clarification, domain modeling, module boundaries, data structure design, interface contracts, milestone breakdown, and a risk list. It outputs structured documents, not code.
- Execution stage: A cheaper, faster model implements tasks one by one according to the documents, doing only local coding and unit testing. It is not allowed to change the architectural contracts on its own.
- Verification stage: The documents serve as the acceptance baseline. This stage checks whether the implementation deviates from the design and writes any deviations back into the documents, closing the loop.
The direct benefit is that the expensive model is called only a few times, so cost is concentrated on “thinking” rather than repeated generation. Meanwhile, architectural decisions are fixed in place, which avoids long-context drift.
3. Task Selection: What Problem Tests Planning Quality
To measure planning ability, the problem must be both perceptible in complexity and decidable in acceptance. Spreadsheet software is an ideal target: public sources generally put its code size in the millions of lines, its functional boundaries are clear (cell model, formula parsing, dependency recalculation, formatting, charts), and completeness can be judged by comparing screenshots and test cases.
Even a demo-level prototype is not easy, though. A formula engine involves lexical analysis, syntax trees, evaluation order, and circular reference detection; recalculation involves dependency graphs and incremental updates; rendering involves virtual scrolling and a selection state machine. These are exactly the touchstones for testing whether the plan accounts for failure paths.
4. A Reusable Planning Document Structure
Ask the planning model to produce the following document skeleton. A missing item means the plan is not acceptable:
- Goals and non-goals: State what will not be done, to prevent scope creep.
- Domain model: Core entities, invariants, and lifecycles.
- Modules and dependency graph: One-way dependencies; no circular references.
- Interface contracts: Inputs and outputs, error semantics, idempotency.
- Data and persistence format: Version numbers and backward compatibility strategy.
- Milestones: Each milestone must be independently demonstrable.
- Test strategy: Unit, integration, snapshot, and performance baselines.
- Risks and rollback plans.
An illustrative contract description (neutral pseudocode, not the interface of any specific product):
Module: FormulaEngineparse(text) -> ASTevaluate(ast, context) -> Value | ErrorError ∈ {SyntaxError, CircularRef, OutOfRange}Invariant: evaluate must be idempotent for the same context
5. Controlling Costs in the Execution Stage
- Task granularity: Keep each task to one or two files and completable within one turn, so long outputs are not truncated.
- Context feeding: Feed only the relevant module documents and interface contracts, not the entire conversation history.
- Automated acceptance: Every task must come with runnable test cases. If they fail, roll back; do not move to the next task with known defects.
- Quota management: Allocate the total budget across milestones, set a per-task limit, and if a limit is exceeded, complete the documentation first and then retry.
- Observability: Use logging services and monitoring alerts to track the number of calls, failure rate, and rework rate, and use that data to judge whether the workflow is healthy.
6. Verifying the Transfer of Visual and Aesthetic Ability
Beyond purely logical tasks, graphical problems can test how well a model combines aesthetics with engineering—for example, using a drawing library to stack a large number of basic primitives into a layered scene, then gradually refining lighting, color, and composition. The key here is not “how much is drawn” but whether the plan accounts for primitive scheduling, spatial partitioning, and a performance budget. This shows that aesthetic ability must be built on an awareness of resource constraints.
7. Common Failure Modes and How to Avoid Them
- Vague documents: A table of contents with no invariants leaves the execution stage to improvise.
- Contract drift: The execution stage changes interfaces on its own, causing integration failures.
- Scope creep: Constantly adding “just implement this too” blows through the budget.
- No rollback: Without versioned documents, rework is extremely expensive.
- Demo as acceptance: Checking only whether it runs, without looking at boundaries and exception paths.
8. Conclusion
Separating planning from execution can become a standard configuration for coding collaboration not because of the peak capability of any one tool, but because it optimizes cost structure and engineering quality at the same time: scarce high-order reasoning goes to the design side, while parallelizable, verifiable coding goes to the execution side. For teams, the focus should be on three things: documentation standards, contract management, and automated acceptance. In cloud practice, common capabilities such as container platforms, object storage, and log monitoring can carry the runtime and observability, moving AI coding from “demo surprise” to “sustainable delivery”.
