refactoring-patterns

Installation
SKILL.md

Refactoring Patterns

Safe techniques for restructuring code without changing its behavior. Every refactoring follows: test green -> refactor -> test green.

Golden Rule

Never refactor and change behavior in the same commit. Refactoring = same behavior, different structure. Feature work = different behavior. Mixing them makes bugs untraceable.

Pre-Refactoring Checklist

Before any refactoring:

  • Tests exist and pass for the code being refactored
  • You can describe what the code does WITHOUT reading it line by line
  • The refactoring has a clear motivation (not "it could be cleaner")
  • The scope is bounded — you know exactly which files/functions change

Core Refactorings

1. Extract Function

Installs
1
GitHub Stars
29
First Seen
Mar 31, 2026
refactoring-patterns — akaszubski/autonomous-dev