mirror of
https://github.com/duthaho/claudekit.git
synced 2026-06-10 12:14:57 +03:00
993 B
993 B
/refactor - Refactoring Command
Purpose
Improve code structure, readability, or performance without changing behavior.
Usage
/refactor [file or function] [goal: clean | extract | simplify | optimize]
Refactor: $ARGUMENTS
Workflow
Step 1: Understand Current Code
- Read the code thoroughly
- Identify what it does
- Note existing tests
Step 2: Plan Refactoring
- Identify improvement opportunities
- Ensure tests exist
- Plan incremental changes
Step 3: Execute
- Make small, focused changes
- Run tests after each change
- Commit incrementally
Refactoring Types
- Extract: Pull out reusable functions
- Simplify: Reduce complexity
- Rename: Improve clarity
- Clean: Remove dead code
Output
## Refactoring Complete
### Changes Made
- Extracted `validateInput()` function
- Simplified conditional logic
- Renamed `x` to `userCount`
### Before/After
[Code comparison]
### Tests
All passing