← ClaudeAtlas

refactoring-sweeplisted

Codifies the 10 Fowler-style refactoring closure verbs as detector + procedure pairs. Is the core apply-engine of /refactor (these 10 verbs ARE /refactor's closed vocabulary) and is also used by /optimize Phase 2 (tactical) and any /align-recheck run that hits the refactoring class. Each verb has a fingerprint (what triggers it), a procedure (how to apply it safely), and a verify step (what must stay green). Behaviour-preserving — refactoring NEVER changes observable output.
adnanmokhtar/refract · ★ 1 · Code & Development · score 80
Install: claude install-skill adnanmokhtar/refract
# Skill: refactoring-sweep ## Purpose Apply Fowler-style refactorings as closure verbs in /optimize and /align-recheck. Each verb is a small, named, behaviour-preserving transformation with a clear fingerprint and verification step. The skill does NOT invent refactorings; it operates from a closed vocabulary of 10 verbs. ## When to use - **Core apply-engine of `/refactor`** — the 10 verbs below ARE `/refactor`'s closed vocabulary; `/refactor` dispatches this skill with `--target=<paths>` and the `refactorer` agent gates abstractions on top. See [`commands/refactor.md`](../../../../../commands/refactor.md). - Dispatched by `/optimize` Phase 2 (tactical) when class = refactoring. - Dispatched by `/align-recheck` when the finding's class = refactoring. - NOT dispatched by `/align-fast`. That command dispatches align's own per-finding loop (`find-and-align`) over the closed 21-verb align vocabulary, which does not contain these 10 Fowler verbs; a row that wants one is mis-classified and `/align-fast` routes it to `/refactor`, which is where this skill runs. - NOT for new code or features — refactoring operates on existing code only. ## The 10 closure verbs ### 1. extract-method **Fingerprint**: - Function ≥ 30 lines, OR - Cyclomatic complexity ≥ 10, OR - A block of 5+ lines doing distinct work that has its own narrative (and could be named). **Procedure**: 1. Identify the contiguous block to extract. 2. Detect free variables (referenced but not defined locally) → these be