SuperAPI AI Directory

request-refactor-plan

Coding & development

View repository

Updated 10-16 01:38

About this skill

This skill is invoked when the user wants to create a refactor request. You should proceed as follows. You may skip some steps if you deem them unnecessary.

This skill will be invoked when the user wants to create a refactor request. You should go through the steps below. You may skip steps if you don't consider them necessary.

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

Ask the user for a long, detailed description of the problem they want to solve and any potential ideas for solutions.

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

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

  1. Ask whether they have considered other options and show them the other options.

Ask whether they have considered other options, and present other options to them.

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

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

  1. Nail down the exact scope of the implementation. Determine what you plan to change and what you do not plan to change.

Hammer out the exact scope of the implementation. Work out what you plan to change and what you plan not to change.

  1. Check the test coverage of that area in the codebase. If the test coverage is insufficient, ask the user for their testing plan.

Look in the codebase to check for test coverage of this area of the codebase. If there is insufficient test coverage, ask the user what their plans for testing are.

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

Break the implementation into a plan of tiny commits. Remember Martin Fowler's advice to "make each refactoring step as small as possible, so that you can always see the program working."

  1. Create a GitHub issue with the refactor plan using the following template:

Create a GitHub issue with the refactor plan. Use the following template for the issue description:

Problem Statement

The problem the developer faces, described from the developer's perspective.

The problem that the developer is facing, from the developer's perspective.

Solution

The solution to the problem, described from the developer's perspective.

The solution to the problem, from the developer's perspective.

Commits

A detailed implementation plan. Write it in plain language and break the implementation into the smallest possible commits. Each commit should keep the codebase in a working state.

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

Decision Document

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

A list of implementation decisions that were made. This can include:

  • Modules to be built/modified

    The modules that will be built/modified

  • Module interfaces to be modified

    The interfaces of those modules that will be modified

  • Technical clarifications from the developer

    Technical clarifications from the developer

  • Architectural decisions

    Architectural decisions

  • Schema changes

    Schema changes

  • API contracts

    API contracts

  • Specific interactions

    Specific interactions

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

Do NOT include specific file paths or code snippets. They may end up being outdated very quickly.

Testing Decisions

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

A list of testing decisions that were made. Include:

  • A description of what makes a good test (test only external behavior, not implementation details)

    A description of what makes a good test (only test external behavior, not implementation details)

  • Which modules will be tested

    Which modules will be tested

  • Precedents for testing (i.e., similar types of tests in the codebase)

    Prior art for the tests (i.e. similar types of tests in the codebase)

Out of Scope

A description of what is not within the scope of this refactor.

A description of the things that are out of scope for this refactor.

Further Notes (optional)

Any additional notes about the refactor.

Any further notes about the refactor.