refactor-to-patternslisted
Install: claude install-skill dgutson/refactor-to-patterns
# Refactor to Patterns
Refactoring is a sequence of small behavior-preserving moves, each of which has a
name. This skill keeps that true: it turns "clean this up" into an ordered,
auditable list of named refactorings, and it makes the list start by asking what can
be **removed** before proposing anything new.
## Why the discipline is shaped this way
Asked to improve code, a model reliably grows it — measured against human patches
for the same bugs, LLM-generated patches carry roughly twice the changes and
substantially higher cyclomatic complexity, and the effect gets *worse* with open-ended
iteration and with wider context. Instructions to "be minimal" do not fix this;
the intention evaporates on contact with the code.
So the obligations below are **artifacts you produce**, not attitudes you hold. A
written verdict and a named step list can be checked by the user before any code
moves. An intention cannot.
Two practical consequences shape everything here: work from a bounded context rather
than sweeping the repository, and prefer a short plan you commit to over open-ended
redesign.
## Two modes
**Mode A — refactoring as the goal.** The user wants the code better. There is no
pending feature. Success is a structural improvement with behavior unchanged.
**Mode B — refactoring as a prerequisite.** A feature or bug fix is the goal, and the
current structure is in the way. Kent Beck's formulation is the whole method: *make
the change easy, then make the easy change.* Mod