Invoke this skill when the user wants to create a refactor request. Follow the steps below. You can skip any steps you deem unnecessary.
-
Ask the user to describe in detail the problem they want to solve, as well as possible solution ideas.
-
Explore the repo, verify their assertions, and understand the current state of the codebase.
-
Ask if they have considered other options, and present alternative options to them.
-
Interview the user about the implementation. Be extremely detailed and thorough.
-
Finalize the exact scope of the implementation. Clarify what you plan to change and what you will not change.
-
Check the test coverage of this area in the codebase. If coverage is insufficient, ask the user about their testing plans.
-
Break the implementation into a plan of tiny commits. Remember Martin Fowler's advice: "make each refactoring step as small as possible, so that you can always see the program working."
-
Create a GitHub issue using the refactor plan. Use the template below for the issue description:
The problem faced by the developer, described from the developer's perspective.
The solution to the problem, described from the developer's perspective.
A long, detailed implementation plan. Write in plain English, breaking the implementation into the smallest possible commits. Each commit should leave the codebase in a working state.
A list of implementation decisions made. This can include:
Do not include specific file paths or code snippets. They may become outdated quickly.
A list of testing decisions made. Include:
A description of items outside the scope of this refactor.
Additional notes about the refactor.