Back to Library

Refactoring Task

task

Systematic code improvement without changing behavior

refactoringcode-qualityclean-codeworkflow
Prompt Content
# Code Refactoring

## Target: {{target_code}}

## Refactoring Checklist

### Before Starting
- [ ] Ensure tests exist and pass
- [ ] Understand the current behavior
- [ ] Identify the improvement goal

### Common Improvements
- Extract repeated code into functions
- Split large components into smaller ones
- Improve naming for clarity
- Add TypeScript types
- Reduce nesting depth
- Apply DRY principle

### Safety Rules
- Make small, incremental changes
- Run tests after each change
- Don't add features while refactoring
- Keep commits focused

### After Refactoring
- [ ] All tests still pass
- [ ] No new warnings or errors
- [ ] Code is more readable
- [ ] Performance is same or better
Variables
This prompt uses the following variables that should be replaced
{{target_code}}
target_codestringRequired

File or component to refactor

Details
Category
task
Version
1
Created
12/12/2025
Last Updated
12/12/2025