Refactor Code
Suppose you need to update legacy code to use modern patterns and practices.
Identify Legacy Code That Needs Refactoring
> find deprecated API usage in our codebaseGet Refactoring Suggestions
> suggest how to refactor utils.js to use modern JavaScript featuresApply Changes Safely
> refactor utils.js to use ES2024 features while maintaining the same behaviorVerify the Refactoring
> run tests for the refactored codeTips:
- Ask Claude to explain the benefits of the modern approach
- Request backward compatibility preservation when needed
- Refactor in small, testable increments