Separating Planning and Execution in AI-Assisted Development: A Practical Evaluation
This article examines why AI-assisted development benefits from separating planning from execution. It explains how a design-document phase improves interface consistency, reviewability, and traceability; how to evaluate planning quality across completeness, consistency, executability, and tradeoff reasonableness; and how to organize staged collaboration, evaluation, cost control, and common failure prevention. It also outlines test ideas for software prototypes and creative visual generation tasks, along with practical adoption advice for teams.
1. Why Planning and Execution Should Be Separated
When a model is asked to generate a complete project directly, common problems include inconsistent interfaces between modules, missing requirements, duplicated functionality, and changes in one place breaking another. The root cause is that the model must decide both “what to build” and “how to build it” at the same time. Once the context is filled with implementation details, the earlier overall judgment is diluted.
The idea of separating planning and execution is to split the work into two phases. The first phase produces only a design document, covering functional scope, module breakdown, data structures, interface contracts, milestones, and acceptance criteria. The second phase uses the document as input and writes code module by module. The document thus becomes a contract shared by humans and models, and between models.
This approach has three benefits. First, the design document can be reviewed by humans, so directional errors can be found before code is written. Second, the execution phase can use lower-cost models because most concrete implementation decisions are already constrained by the document. Third, the document is stored locally and placed under version control, so changes can be traced.
2. Why Planning Capability Deserves Separate Evaluation
Code generation capability is often measured through single-point tasks, such as implementing a sorting function or fixing an error. Such tests rarely reflect the gaps that appear in real engineering. Real projects require judging which features are core and which can be delayed, how to make tradeoffs under resource constraints, and how to coordinate dozens of modules.
Planning capability is exactly this kind of judgment. A qualified design document should answer the following questions: What parts make up the system? How does data flow between parts? Which states need to be persisted? Which boundary conditions are most likely to fail? What is the completion criterion for each phase?
Evaluation can be scored across four dimensions. Completeness means whether all requirements are covered. Consistency means whether there are contradictions between sections. Executability means whether downstream developers can implement directly from the document. Tradeoff reasonableness means whether judgments about scope and priority are justified.
3. Test Ideas for Two Typical Task Types
3.1 Practical Software Prototype
Take spreadsheet-like software as an example. This type of software includes subsystems such as the cell model, formula parsing, dependency updates, format rendering, file reading and writing, and UI interaction. Even for a simplified version, the formula calculation engine must handle details such as circular references, operator precedence, and nested functions.
For this type of target, the value of a prototype is to expose problems. If the model produces a clear plan and the generated code passes preset test cases, it indicates a deeper understanding of the problem domain. If the plan is vague, or the formula engine supports only basic addition and subtraction, it indicates the boundary of capability.
3.2 Creative and Visual Generation
Another task type is generating images or animations programmatically, for example using code to control a “brush” to draw a scene step by step, or writing rendering logic for a game scene. This type of task tests the model’s understanding of coordinate systems, color blending, iterative drawing, and visual feedback. Validation relies mainly on human aesthetic judgment. Metrics such as image similarity can serve as auxiliary references, but cannot fully replace human judgment.
4. Staged Collaboration Workflow
4.1 Planning Phase
The input to the planning phase is the requirement description, constraints, and reference samples, and the output is a set of structured documents. A recommended document structure is as follows:
- Project goals and non-goals
- Feature list, prioritized
- Module breakdown and responsibility descriptions
- Data model and storage plan
- Interface contracts, including inputs, outputs, and error handling
- Milestones and acceptance criteria
- Known risks and open questions
During planning, the model should be required to list all assumptions and mark uncertain issues separately so that humans can confirm them.
4.2 Document Persistence
Documents are saved as plain text or markup files in a fixed directory in the project repository, such as docs/design. Each design change should update the version number and record the reason for the change. Each code generation in the execution phase should reference an explicit version of the document, which helps avoid context drift.
4.3 Execution Phase
The execution phase should proceed module by module rather than generating all code at once. Each module’s task ticket should include the module, interface definition, dependencies, test cases, and completion criteria. After a module is completed, run the tests and only then move to the next module.
A schematic task description is as follows:
task: implement formula-parsermodule: calc-engineinputs: docs/design/v3/calc-engine.md#interfacesoutputs: src/calc/parser.*tests: tests/calc/test_parser.*done_when:- all syntax cases pass- no direct dependencies on other modules introduced
This format makes it easy to record and review work, and to quickly locate the specific module when errors occur.
5. Evaluation Methods
Evaluation can be divided into three layers.
The first layer is document review. Developers check item by item whether the design document satisfies the four dimensions in Section 2, recording the number and severity of issues.
The second layer is code structure inspection. Observe whether module boundaries match the design, whether interfaces are respected, and whether circular dependencies or cross-layer calls exist.
The third layer is functional testing. Write test cases against the acceptance criteria in the design document, covering normal paths, boundary conditions, and invalid inputs.
Evaluation results should also record execution cost, including number of calls, input and output length, and repair rounds. Only by considering quality and cost together can a team judge whether a given approach is suitable for its use.
6. Cost Control Strategies
Cost mainly comes from two parts: long document generation during planning, and repeated revisions during execution. The control approach is as follows.
- Do the planning phase thoroughly once, then make only incremental changes afterward.
- Break execution into sufficiently fine-grained steps so that the context for each request stays as small as possible.
- Lock the interfaces of modules that have passed tests to reduce repeated context passing.
- When tests fail, trim logs before submitting them instead of dumping entire sections.
- Create templates for recurring tasks to avoid re-describing the background each time.
Lowering cost may reduce quality, so each round should compare quality metrics and overhead together.
7. Common Failure Modes
- Missing requirements: edge features are not covered during planning, and later additions cause architectural rework.
- Interface drift: the execution phase changes interfaces without authorization, making them inconsistent with other modules.
- Overdesign: the planned scope far exceeds the target, generating many abstractions that are never used.
- Missing tests: only checking whether code runs, not whether functionality is correct.
- Outdated documentation: code has been modified while the document is not synchronized, so later execution is based on old information.
Corresponding prevention methods include: conduct a human review at the end of planning; interface changes must update the document before changing code; write non-goals for each module; and test first by turning acceptance criteria into executable cases.
8. Practical Recommendations
Teams can start with small tools, such as format conversion scripts or simple data statistics tools. First run the complete planning, execution, and evaluation loop, then gradually expand the scope.
For complex projects, design documents should receive thorough discussion earlier than code. Investing more time in the planning phase usually reduces rework in the execution phase.
Model capabilities change quickly, so evaluation results should be retested periodically. The same process may perform very differently at different times and with different versions, so a single result should not be treated as a long-term conclusion.
