Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Refactoring Patterns?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ansh44233-refactoring-patterns)
---
description: Safe, behavior-preserving refactoring moves with a test safety net
profile: standard
tags: refactor
---
# Refactoring Patterns
- Establish a green test baseline first; add characterization tests for untested code.
- Prefer small named moves: extract function, inline variable, move module, replace conditional with polymorphism, introduce parameter object.
- One move per commit; run tests after each.
- Separate refactors from behavior changes in different commits or PRs.
## Verify
The full test suite passes after every move, and the diff contains no behavior change (same public API and outputs; snapshot or characterization tests unchanged).