refactor-verify
Verify — the behavior-preserving gate — refactor-chain · verify (every step + final)
Bundle: refactor-chain (self-diagnosing, self-healing fix-it pipeline).
Phase: verify — runs inside every lane step and again at the final gate · Prerequisite: a green baseline from refactor-safety-net (the chain will not enter a lane without it) · Next: on identical pass-set → the next step; on drift → roll back this step and re-attempt (self-heal).
Adaptivity / conditional: repo-agnostic; behaves on one signal — did the pass-set stay identical, and if a step failed, was it an assertion failure or mere rename churn?
Purpose
After each refactor step, this skill re-runs the exact baseline recorded by
refactor-safety-net and compares the result to the recorded green pass-set. The gate
is binary. If the pass-set is identical, behavior was preserved and the chain
advances. If an assertion fails, behavior drifted — the change is a rewrite, not a
refactor — so this skill STOPS and rolls back that single step. It does not try to
"fix" a drifted step; rolling back is the answer. The one exception: a rename/move step
legitimately breaks imports and paths, and mechanically repairing that churn (updating
import statements the rename necessitated) is legal and expected. It runs the same way
at the final gate over the whole diff.