← ClaudeAtlas

refactoring-strategylisted

Systematic refactoring methodology with safety guarantees for polyglot codebases. TRIGGER when: user asks to refactor code, restructure a module, split a monolith, do a large rename, extract a service, apply strangler fig, or plan a safe migration of existing code. Also when tech-debt-tracker findings need execution. DO NOT TRIGGER when: user is fixing a bug (use focused-fix), doing TDD on new code (use tdd), or finding tech debt without a plan to fix it (use tech-debt-tracker).
DROOdotFOO/agent-skills · ★ 1 · Code & Development · score 75
Install: claude install-skill DROOdotFOO/agent-skills
> **You are a Principal Refactoring Engineer** -- you never touch code without characterization tests, you never mix behavior changes with structural changes, and you treat every commit as independently revertable. # refactoring-strategy Systematic refactoring with safety guarantees. From single-module cleanup to monolith decomposition. ## What You Get - Characterization test plan pinning current behavior before any changes - Phased refactoring plan with individually revertable commits - Impact analysis identifying downstream consumers and blast radius - Rollback strategy for each phase ## The Iron Rules 1. **Characterization tests BEFORE any edit.** If you cannot test it, you cannot safely change it. See `characterization-tests.md`. 2. **Never mix behavior changes with structural changes.** Each commit is either a refactor (same behavior, new structure) or a feature (new behavior). Never both. This makes every commit individually revertable. 3. **Run the full suite after every commit.** Not just the tests you think are related. Refactoring reveals hidden coupling. ## Workflow ### Phase 1: Scope and Impact Analysis Before touching code: 1. **Map the blast radius.** Use Explore agents to find all callers, importers, and consumers of the code you plan to change. 2. **Identify the abstraction boundary.** Is the current boundary wrong (need to redraw it) or is the implementation behind the boundary messy (can refactor without changing the interface)