Enforces a disciplined 'Two Hats' rhythm to separate feature development from code restructuring through small, test-backed steps.
This skill implements the classic 'Two Hats' methodology popularized by Martin Fowler and Kent Beck, ensuring a rigorous separation between adding new functionality and restructuring existing code. By mandating a cycle of assessment, preparation, implementation, and cleanup, it prevents technical debt from accumulating during the development process. It guides Claude to apply specific refactoring patterns from established catalogs while maintaining a 'green' test suite at every step, resulting in cleaner, more maintainable codebases with zero unintended behavioral changes.
Key Features
01Comprehensive quality gates for validating behavioral consistency and linting
02Automated code smell identification and mapping to specific refactoring patterns
03Detailed Hat Log tracking for transparent development history
04Small-step execution strategy to ensure easy reverts if tests fail
051 GitHub stars
06Strict 'Two Hats' enforcement to separate behavior changes from structural cleanup
Use Cases
01Cleaning up complex logic immediately after getting a new test to pass
02Systematically removing technical debt during code reviews or bug fixing
03Preparing a legacy codebase for new features by restructuring 'the easy way' first