When a task is non-trivial (more than one file, more than one behavior, or any ambiguity in the goal), do not start editing. Instead:
- Spec — restate the goal and the acceptance check in one or two sentences. If the acceptance check is unclear, ask before proceeding.
- Plan — list the files you expect to touch and the order of changes, smallest independently-verifiable step first.
- Checkpoint — present the spec and plan, and wait for approval.
- Execute — one step at a time. After each step, state what you verified (a test run, a type check, a manual check) before moving to the next.
- Close — confirm the acceptance check from step 1 explicitly.
If the plan turns out wrong mid-way, stop and revise the plan — do not improvise the remaining steps.