Refactor plan

From softspark/ai-toolkit · View interactive version

Refactor plan is an AI agent skill from the GitHub repository softspark/ai-toolkit. Creates detailed refactor plan with tiny commits via interview, files as GitHub RFC. Triggers: refactor plan, refactoring RFC, incremental refactor, safe steps.

How to use this skill

Skill file

Refactor Plan

$ARGUMENTS

Create a detailed refactor plan with tiny commits via user interview, filed as a GitHub issue.

Usage

/refactor-plan [area or module to refactor]

What This Command Does

  1. Gathers detailed problem description from user
  2. Explores the codebase to verify assertions
  3. Presents alternative approaches (>=3 options)
  4. Interviews about implementation details
  5. Checks test coverage of affected area
  6. Breaks into tiny commits (Martin Fowler: each step keeps codebase working)
  7. Files as GitHub issue via gh issue create

Process

1. Gather Problem

Ask for detailed description of:

2. Explore Codebase

Use Agent (subagent_type=Explore) to verify assertions and understand current state.

3. Present Alternatives

Present >=3 alternative approaches. Discuss trade-offs.

4. Interview

Detailed interview about chosen approach. Hammer out exact scope — what changes, what doesn't.

5. Check Test Coverage

Explore existing test coverage for the affected area. If insufficient, ask about testing plans.

6. Break into Tiny Commits

Each commit:

7. File GitHub Issue

Use gh issue create with template below. Share URL immediately.

Issue Template

<refactor-plan-template>

Problem Statement

The problem from the developer's perspective.

Solution

The solution from the developer's perspective.

Commits

Detailed plan in plain English, broken into the tiniest commits possible. Each commit leaves the codebase working.

Decision Document

Implementation decisions made:

Do NOT include file paths or code snippets — they go stale.

Testing Decisions

Out of Scope

What is explicitly NOT part of this refactor.

</refactor-plan-template>

Rules

Gotchas

When NOT to Use

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.