This skill loads a compact rule set inspired by Martin Fowler’s Refactoring. It tells a coding agent to preserve observable behavior, work in small buildable steps and keep structural edits apart from feature work.
It covers preparatory and follow-up refactoring around a change, safety nets such as characterization tests, and a stop condition before cleanup turns into a rewrite.
What You Get
- A mini rule set with decision rules, trigger rules and a closing checklist for refactoring work
- A nano version for tight context budgets and a full version for reference
- A skill description that makes the agent load the rules for cleanup and bug-fix tasks
Common Use Cases
- Reshaping local structure before adding a feature, then cleaning up after it
- Writing characterization tests before touching unclear code
- Splitting a patch that renames, moves and changes logic together
- Replacing repeated conditionals with a table or polymorphism only when the variation is real
What Makes It Unique
It ties refactoring to the task in hand: what blocks the requested change gets treated, and the next smell is left for later. The agent is told never to delete a failing test to finish cleanup and to keep patch intent reviewable. A companion set in the repository takes the same topic from the Refactoring.Guru smell catalog.
Under The Hood
The skill is a SKILL.md with a name and description, plus Markdown files holding the mini, nano and full versions of the rules. The SKILL.md tells the agent to read the mini file before design or code decisions and the full file only for harder tradeoffs. It contains no scripts. It does not fetch web pages, call APIs, run commands or write files; the agent only reads the rule text.