write-rewrite
Implement a rewrite
DISRESPEC-SPINE: One fact once. No filler, repeated source material, empty sections, or chat restatement; after successful creation return only clickable artifact links, except for blockers, failed creation, incomplete verification, or irreversible-action confirmation.
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 carries the rewrite discipline standalone. When runs are parallel, isolate each in its own worktree or branch so their writes stay disjoint. These are conventions the review packet inspects — nothing enforces them at edit time.
Plan the transformation first — the 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.