SuperAPI AI Directory

request-refactor-plan

Coding & development

View repository

Updated 10-15 23:44

About this skill

This skill will be invoked when the user wants to create a refactoring request. You should proceed with the following steps. If you think some steps are unnecessary, you may skip them.

  1. Ask the user to provide a detailed description of the problem they want to solve and any potential solution ideas.

  2. Explore the repository to verify their assertions and understand the current state of the codebase.

  3. Ask them whether they have considered other options, and show them other options.

  4. Interview the user about implementation details. Be extremely detailed and thorough.

  5. Determine the exact scope of the implementation. Figure out what you plan to change and what you do not plan to change.

  6. Review the codebase to check the test coverage in that area. If the test coverage is insufficient, ask the user about their testing plan.

  7. 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."

  8. Use the following template to create a GitHub issue containing the refactoring plan:

Problem Statement

Describe the problem the developer faces from the developer's perspective.

Solution

Describe the solution to the problem from the developer's perspective.

Commits

A long, detailed implementation plan. Write the plan in plain English, breaking the implementation into the smallest possible commits. Each commit should leave the codebase in a working state.

Decision Documents

A list of implementation decisions that have been made. It may include:

  • Modules to be built/modified
  • Module interfaces to be modified
  • Technical clarifications from the developer
  • Architecture decisions
  • Schema changes
  • API contracts
  • Specific interactions

Do not include specific file paths or code snippets. They may become outdated quickly.

Testing Decisions

A list of testing decisions that have been made. Include:

  • A description of good tests (testing only external behavior, not implementation details)
  • Which modules will be tested
  • Precedents for testing (i.e., similar types of tests in the codebase)

Out of Scope

Describe what is outside the scope of this refactoring.

Further Notes (Optional)

Any further notes about the refactoring.