refactor-plan-gate
Plan Gate — think on paper before touching code — refactor-chain · plan
Bundle: refactor-chain (self-diagnosing, self-healing fix-it pipeline).
Phase: plan — runs after orchestrate.mjs init builds the step list, before baseline may run · Prerequisite: an initialized chain (init succeeded, state.json exists) · Next: refactor-safety-net (baseline).
Adaptivity / conditional: repo-agnostic; the spec-kit interop branch activates only when diagnose reports the spec-kit signal (.specify/ directory detected).
Purpose
No multi-edit work starts on impulse. This skill forces one cheap artifact into
existence first: a mini-plan of five parts — the goal in one sentence, the
unknowns that could sink the work, the success criteria that will prove it
worked, the step order mapped onto the chain's step list, and what is explicitly
out of scope (adjacent things noticed but deliberately not touched — the boundary
refactor-scope-fence then enforces). The plan is recorded
into chain state as a note, and until it is recorded, the baseline phase stays locked.
Five minutes of writing routinely saves an hour of undoing.