Skip to content
Kitbay
Skill

refactor

MITUpdated on Nov 3, 202646,944GitHub starsIncludes scripts

A refactoring skill from the claude-howto guide to Claude Code, based on Martin Fowler's book on refactoring.

What the skill teaches

A refactoring skill from the claude-howto guide to Claude Code, based on Martin Fowler's book on refactoring. It works in six phases, each needing the user's approval: understand the code and goals, check test coverage and decide whether to write tests first, find code smells such as long methods, duplication or feature envy and rank them, plan specific refactorings in phases with rollback steps, make one small change at a time and commit only when tests pass, and finally compare complexity before and after. It lists when to stop and ask, and refuses to refactor without tests unless the user accepts the risk. Bundled Python scripts detect smells and measure complexity.

Capabilities

  • Check test coverage before refactoring
  • Find and rank code smells
  • Plan refactorings with rollback steps
  • Measure complexity before and after