Overview
- Use a four-phase process:
调研 -> 计划 -> 实施 -> 迭代。 - Strictly maintain phase boundaries: no code changes during the research/planning phases, and the implementation phase must be verified.
- Each phase produces structured results to ensure the next phase can directly reuse them.
How to Use
Advance by phase within the same session:
- Enter
调研, and only collect facts and constraints. - Enter
计划, and output a reviewable execution plan. - After the plan is confirmed, enter
实施, execute the changes and verify them. - After implementation is complete, enter
迭代, review and provide improvement priorities.
Workflow Decisions
- When requirements are unclear or context is insufficient, first do
调研。 - Once key facts are clear, do
计划and wait for confirmation. - After the plan is confirmed, execute
实施。 - After implementation is complete, execute
迭代。 - When a key premise changes, fall back to
调研or计划。
Phase Specifications
1) Research
Goal: establish trustworthy context without changing code.
Actions:
- Clarify the problem definition, success criteria, and constraint boundaries.
- Identify relevant code, dependencies, configuration, and existing patterns.
- Distinguish facts, assumptions, and unknowns.
- Extract decision information for entering the planning phase.
Output structure:
- Summary
- Key findings
- Context
- Questions to confirm
- Recommendations
2) Plan
Goal: form an executable, verifiable, and reviewable plan without changing code.
Actions:
- Break down steps based on confirmed facts.
- Mark affected files, risks, and rollback approach.
- Define the verification plan and completion criteria.
- Wait for confirmation before entering the implementation phase.
Output structure:
- Goal
- Premises and assumptions
- Scope and files involved
- Execution steps
- Risks and mitigation
- Verification plan
3) Implement
Goal: implement changes according to the plan and continuously verify.
Actions:
- Implement step by step and control the scope of changes.
- Verify immediately after each batch of changes (tests, lint, type-check, functional checks).
- When deviating from the plan, first explain the reason and update the plan.
- Record progress and remaining work.
Output structure:
- Completed changes
- Verification results
- Deviation notes
- Remaining work
4) Iterate
Goal: systematically review and define the next round of optimization.
Actions:
- Evaluate correctness, robustness, maintainability, and observability.
- Check boundary conditions, failure paths, performance, and security risks.
- Identify test gaps and technical debt.
- Output improvement items sorted by priority.
Output structure:
- Strengths
- Issues
- Edge cases and gaps
- Priority improvement items
Quality gates
- In the
调研and计划stages, directly modifying code is prohibited. - In the
实施stage, skipping verification and directly declaring completion is prohibited. - In the
迭代stage, providing only conclusions is prohibited; executable improvement items must be provided. - At the end of each stage, a structured result must be output.
Reference
- Read
references/rpi-playbook.mdto obtain the detailed checklist and prompt templates.