Plan a multi-file refactor with proper sequencing and rollback steps
The refactor-plan skill is designed to assist developers in organizing and executing multi-file refactoring tasks in a structured and safe manner. It addresses the common challenge of managing complex code changes across multiple files, where dependencies and the order of operations are critical to avoid breaking the application. By generating a comprehensive refactoring plan, this skill ensures that developers can understand the current state of their codebase, identify all affected files, and implement changes with minimal risk. It also incorporates verification and rollback steps to maintain stability throughout the process.
The main features of this skill include systematic codebase analysis, identification of impacted files along with their dependencies, and planning the sequence of changes to minimize errors. It guides developers through different phases: updating types and interfaces, implementing changes, updating tests, and cleaning up deprecated code. Each step includes verification instructions, and the output format provides a clear structure for documenting the plan. The skill also includes a rollback strategy and highlights potential risks, ensuring that developers have a clear mitigation path in case something goes wrong.
This skill is ideal for software engineers, technical leads, and development teams who are performing large-scale refactoring in projects using languages like TypeScript or JavaScript. It is particularly useful in scenarios where multiple modules and tests are interdependent, and a systematic approach is needed to ensure smooth transitions. Use cases include modernizing legacy code, restructuring complex modules, or preparing code for new features, where careful sequencing and verification are crucial for maintaining software quality.
Provide a description of the refactoring goal and follow the structured output format to plan each phase of the refactor.
The skill is designed for multi-file projects, particularly in TypeScript and JavaScript, but the principles can be generalized to other languages.
Yes, you can adjust the sequence of steps and verification methods to fit your specific project requirements.
Follow the rollback plan outlined in the execution plan, which includes undo steps and risk mitigation instructions.
While it can be used for small changes, its primary benefit is in organizing complex, multi-file refactors where dependencies and sequencing are critical.
Quick Setup:
.claude/skills/Repository
github/awesome-copilot