refactor-extract-and-isolate
SKILL.md
Refactor: Extract and Isolate
Break down complex code into focused, reusable units.
Extract Method
When to Extract
- Function > 20 lines
- Code block has a distinct purpose
- Same logic repeated
- Deep nesting (> 3 levels)
Extract Class
When to Extract
- Class > 300 lines
- Multiple distinct responsibilities
- Group of related methods/properties
- Feature envy
Extract Protocol/Interface
When to Extract
- Multiple implementations possible
- Testing requires mocking
- Dependency inversion needed
Checklist
- Identify extraction boundary
- Choose good name for new unit
- Move code to new location
- Update references
- Add tests for new unit
- Verify original tests pass
Weekly Installs
3
Repository
cantagestudio/c…aspackerGitHub Stars
2
First Seen
Feb 26, 2026
Security Audits
Installed on
opencode3
gemini-cli3
github-copilot3
codex3
amp3
kimi-cli3