refactor-scope-fence
Scope Fence — one step, one scope, nothing sneaks in — refactor-chain · do-the-work
Bundle: refactor-chain (self-diagnosing, self-healing fix-it pipeline).
Phase: do-the-work — a standing contract over every executing step · Prerequisite: an active chain with a current step (state.json exists, state.steps[cursor] set) · Next: the step's own verify, then advance.
Adaptivity / conditional: repo-agnostic; active whenever a chain step is executing. The drift signal comes free from the guard hook; this skill supplies the discipline.
Purpose
Every chain step declares its territory: state.steps[cursor].scope, a list of path
prefixes. Inside the fence, work proceeds; outside it, nothing gets edited — no matter
how broken, ugly, or tempting the adjacent code is. "While I'm here" is how a rename
becomes a rewrite, how diffs become unreviewable, and how a green baseline stops
meaning anything. Adjacent problems are treasure, not chores: they get flagged and
parked (a note in state plus a line in the write-up) so they become deliberate future
work instead of silent scope creep.