-
Notifications
You must be signed in to change notification settings - Fork 16
Refactoring Code
rtd edited this page Jan 13, 2026
·
4 revisions
User: "Refactor this..." / "Clean up..." / "Improve structure..."
→ code-foundations classifies as REFACTOR
→ cc-developer-character checks mindset
→ cc-refactoring-guidance applies safe refactoring strategies
| Without Skill | With Skill |
|---|---|
| Big-bang refactoring | Incremental, tested changes |
| "While I'm here, let me also..." | Focused scope |
| Breaking existing behavior | Behavior-preserving transformations |
| No tests before refactoring | Tests first, then refactor |
- Verify tests exist - If no tests, write them first
- Small steps - One transformation at a time
- Test after each step - Catch breaks immediately
- Don't mix refactoring with features - Separate commits
User: This function is too long and hard to follow. Can you refactor it?
Claude will:
- Classify as REFACTOR
- Check for existing tests (or suggest adding them)
- Identify extraction points
- Make incremental changes with tests between
- Verify behavior unchanged
- Comment Renumbering - Most concise example—systematic table, one change at a time
- Border Cleanup - Post-refactoring CHECKER gates verify McCabe complexity, cohesion, and design compliance
- Tab Indicator Removal - Discipline recovery—user intervention triggered honest self-assessment and systematic feature removal
| Skill | Role |
|---|---|
| code-foundations | Classifies task as REFACTOR |
| cc-developer-character | Self-assessment, discipline enforcement, "Don't mix refactoring with features" |
| cc-refactoring-guidance | Safe refactoring strategies, systematic removal plans |
| cc-control-flow-quality | Validates improved structure (CHECKER) |
| cc-routine-and-class-design | Validates new interfaces (CHECKER) |
Task Guides
Case Studies
- Picker History Review ⭐
- Comment Renumbering
- Critical Path Review
- Border Cleanup
- Picker Text Overflow
- Tab Indicator Removal
- Picker Focus Bug
- Window Picker Plan
Reference