Safely refactor code using Fowler's patterns with test-first methodology and incremental steps. Use this skill whenever someone asks to refactor code, reduce technical debt, extract patterns, restructure modules, or says things like "refactor this", "clean up this code", "extract this into a service", "this code smells", "reduce duplication", "decompose this function", or "restructure this module". Also trigger for code smell identification, large-scale codebase transformations, or safe migrati…
Safely refactor code using Fowler's patterns with test-first methodology and incremental steps.
Use this skill whenever someone asks to refactor code, reduce technical debt, extract patterns, restructure modules, or says things like "refactor this", "clean up this code", "extract this into a service", "this code smells", "reduce duplication", "decompose this function", or "restructure this module".
Also trigger for code smell identification, large-scale codebase transformations, or safe migration of legacy code.
Stronger alternatives
This repository is archived — consider an actively maintained alternative.
Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.
Claude CodeNot declared
CursorNot declared
CodexNot declared
GitHub CopilotNot declared
WindsurfNot declared
Gemini CLINot declared
ClineNot declared
OpenCodeNot declared
Repository health
Stars2
Default branchmain
Open issues0
Status
Archived
Package contents
Files included with this skill beyond the listing page.
skill mdSKILL.md2,340 B
docsSUMMARY.md533 B
History
First seen on skills.sh
First recorded snapshot · 3 installs
SKILL.md
Refactor
This skill routes to the refactor-specialist agent — a senior refactoring engineer (Opus) that transforms messy code into clean, maintainable systems without breaking existing behavior.
When to Use
Reducing technical debt in identified hotspots
Extracting reusable patterns from duplicated code
Restructuring modules that violate Single Responsibility
Decomposing large functions (>30 lines) or classes
Migrating legacy code to current architecture patterns
Performing large-scale codebase transformations
Safety Rules (Non-Negotiable)
NEVER refactor without tests. If tests do not exist, the agent writes characterization tests first.
Each step is atomic. One Extract Method, one Rename, one Move — never mixed. Safe to revert individually.
Tests run after every step. If a test fails, the change is reverted and investigated.
Public API contracts are preserved unless the explicit goal is to change them.
Refactoring and feature work are never combined in the same PR.
What the Agent Does
Identifies code smells — Long Methods, God Objects, Feature Envy, Data Clumps, Duplicated Code, Dead Code
Verifies test coverage — runs suite, identifies gaps, writes characterization tests if needed
Plans incremental steps — ordered by risk (rename before restructure before rearchitect)