Browse · Refactoring

Code Craft

Refactoring

Martin Fowler

1st ed.

Bad code isn't a character flaw, it's what happens under deadline pressure. This is the disciplined, test-backed way to fix it one small step at a time — not a rewrite.

About the book

Martin Fowler's core loop is deceptively simple: verify tests pass, apply one small structural change, verify tests still pass. Refactoring never changes what code does, only how it's organized — which is exactly why big-bang rewrites fail, since they tangle structural change with behavioral change until nobody can tell what broke what. The book pairs a catalog of code smells (where to look) with named transformations like Extract Method and Decompose Conditional (what to do).

Best used for

  • —Extracting a method or decomposing a tangled conditional safely
  • —Diagnosing a code smell and picking the right named refactoring for it
  • —Restructuring code before adding a feature, without resorting to a rewrite

“Martin Fowlers 'Refactoring' is in my opinion the best book about this subject.”

— Damian, Goodreads

Install this skill

Run this command in your terminal. The skill will be available in all your Claude Code projects.

mkdir -p ~/.claude/skills/refactoring-patterns && curl -fsSL "https://raw.githubusercontent.com/wondelai/skills/main/refactoring-patterns/SKILL.md" -o ~/.claude/skills/refactoring-patterns/SKILL.md

Once installed, invoke with /refactoring-patterns in Claude Code, or let Claude load it automatically when relevant.

Skill by wondelai/skills, licensed MIT.