Code Refactoring & Legacy Modernization
When to use
- Refactor code for better maintainability
- Modernize legacy codebases and frameworks
- Migrate between framework versions
- Reduce technical debt
- Update outdated dependencies
Workflow
- Analyze current codebase structure and patterns
- Identify technical debt and modernization opportunities
- Plan incremental refactoring steps
- Implement changes while maintaining backward compatibility
- Verify no regressions with existing tests
- Update tests for refactored code
Principles
- Incremental changes over big-bang rewrites
- Maintain backward compatibility during migration
- Preserve existing test coverage
- Follow the strangler fig pattern for legacy systems
- Keep refactoring commits separate from feature commits