write-rewrite
Implement a rewrite
A rewrite is riskier than a refactor because behavior is permitted to change — so an unintended
change hides exactly where an intended one is allowed. The discipline forces the change onto two
provable surfaces: the delta (every behavior meant to change) and the preserved non-delta
(everything else). The delta is the contract; anything not on it must survive untouched. This guide
adds the rewrite discipline on top of the base implement-task rules. These are conventions the
review packet inspects — nothing enforces them at edit time.
Plan the transformation first — the workspace's change plan covers baseline, waves, and rollback; this guide is the execution half. If your task moves no observable behavior, it is a refactor; if only the implementation API moves while behavior holds, it is a migration; if it adds capability that did not exist, it is a feature. Relabel rather than proceed under the wrong discipline.
Before you start, open references/task-template.md and copy it
into your task file — it is the session frame for this work; fill it in as you go (don't reconstruct
the structure from memory). It scaffolds the delta table consumed from the sources, the preservation
ACs, the caller inventory, pasted evidence, and the self-review. The task packet itself uses the
kit's task template.