freeskillv2.0.0✓ verified
refactoring-patterns
Improve code structure without changing behavior — the discipline of small, named, test-backed moves. Extract function/variable, inline, rename, replace conditional with polymorphism, introduce parameter object, guard clauses. Recognize smells, refactor safely, avoid big-bang rewrites.
$npx vanara install refactoring-patterns
Free & open source (Apache-2.0) — view the source on GitHub.
Overview
Refactoring is changing the internal structure of code without changing its observable behavior. It is not "cleanup whenever," and it is not rewriting. It is a disciplined sequence of small, *named*, behavior-preserving moves, each verified by tests, each committable on its own. Done right it is nearly risk-free; done wrong — without tests, mixed with feature work, or as a big-bang rewrite — it is
What it covers
- Tests are the safety net (non-negotiable)
- Smells: knowing where to refactor
- The named moves
- Code Smells — and the move each one calls for
- Refactoring Catalog — named moves with mechanics
- Safe Refactoring Workflow