Agent skill

Refactor Plan

by softspark in softspark/ai-toolkit

Creates detailed refactor plan with tiny commits via interview, files as GitHub RFC.

Apache-2.0Auto-check: notesDevelopment

Install Refactor Plan

skills CLI
$ npx skills add softspark/ai-toolkit --skill refactor-plan -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install softspark/ai-toolkit refactor-plan --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/softspark/ai-toolkit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/app/skills/refactor-plan .claude/skills/refactor-plan && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
refactor-plan
GitHub stars
179
Token cost
~1.2k tokens
SKILL.md length
609 words
Files
1
Skills in repo
112
Repo updated
First seen
Licence
Apache-2.0

At a glance

Creates detailed refactor plan with tiny commits via interview, files as GitHub RFC.

  • Works in 7 steps: Gather Problem → Explore Codebase → Present Alternatives → …
  • Tasks that involve Refactoring
  • SKILL.md covers Usage, What This Command Does, Process and Issue Template, plus 9 more sections
  • Calls gh

What it does

Refactor Plan is an agent skill from 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.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Refactoring. It works with GitHub. The repository describes itself as: Professional-grade AI coding toolkit: 94 skills, 44 agents, multi-platform (Claude, Cursor, Windsurf, Copilot, Gemini, Cline, Roo Code, Aider, Augment, Antigravity, Codex CLI… The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Refactoring

Example prompts

  • “Use the refactor-plan skill to create detailed refactor plan with tiny commits via interview, files as GitHub RFC”
  • “/refactor-plan”

Requirements

  • Pre-approved tools (allowed-tools): Read, Grep, Glob, Bash, Agent

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Gather Problem
  2. Explore Codebase
  3. Present Alternatives
  4. Interview
  5. Check Test Coverage
  6. Break into Tiny Commits
  7. File GitHub Issue

What it can do on your machine

Read from SKILL.md and the folder at commit d64db2b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Grep
    • Glob
    • Bash
    • Agent

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • gh

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use gh, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Refactor Plan loads about 1.2k tokens when it runs. Until then it costs about 44 tokens; SKILL.md has 609 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~44
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Grep, Glob, Bash, Agent

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from softspark/ai-toolkit at commit d64db2b, republished under its Apache-2.0 licence (© softspark). 609 words, ~1,159 tokens.

Download SKILL.mdSave it as .claude/skills/refactor-plan/SKILL.md (or your agent's skills folder).
name
refactor-plan
description
Creates detailed refactor plan with tiny commits via interview, files as GitHub RFC. Triggers: refactor plan, refactoring RFC, incremental refactor, safe steps.
allowed-tools
Read, Grep, Glob, Bash, Agent
user-invocable
true
effort
high
argument-hint
[area or module to refactor]

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:

  • The problem they want to solve
  • Potential ideas for solutions
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:

  • Leaves the codebase in a working state
  • Is the smallest possible step
  • Can be reviewed independently
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:

  • Modules to build/modify
  • Interface changes
  • Architectural decisions
  • Schema changes
  • API contracts

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

Testing Decisions

  • What makes a good test (external behavior, not implementation details)
  • Which modules to test
  • Prior art for tests in the codebase

Out of Scope

What is explicitly NOT part of this refactor.

</refactor-plan-template>

Rules

  • MUST present >=3 alternative approaches with trade-offs before committing to one
  • MUST break the refactor into commits small enough to roll back individually — a commit that cannot be reverted is not tiny
  • MUST verify test coverage of the affected area before planning; insufficient coverage is a blocker, not a warning
  • NEVER embed file paths, code snippets, or function names in the issue body — the plan outlives the code
  • NEVER ask for review after creating the issue — file it immediately, share the URL, iterate in comments
  • CRITICAL: dead-code cleanup is per step, not deferred (Constitution Art. VI.1). "We'll delete the old code later" is only acceptable during explicit expand-contract phases, and the cleanup step must be in the plan.
  • MANDATORY: the Out of Scope section names what is NOT part of this refactor — scope clarity prevents reviewer confusion
Show full SKILL.md (185 more words)Show less

Gotchas

  • "Tiny" is relative to the reviewer's context. A 20-line commit that touches the hot path is not tiny in practice — tiny means tractable, not short.
  • Tests for refactors are often omitted with "the existing tests cover it". Verify by running the suite with coverage in the affected area, not by asking.
  • Rebasing a long chain of tiny commits is painful when the target branch moves. Recommend landing the chain weekly and rebasing on main before each review round.
  • GitHub issue RFCs tend to get stale if the refactor drags. Add a "Status" line that updates with each landed commit so readers see progress without scrolling through comments.
  • Expand-contract refactors with double-writes silently leak cost — both paths are live, both pay resources. Set a hard deadline in the plan for when the old path is removed.

When NOT to Use

  • For executing a refactor directly — use /refactor
  • For architecture-level audit without a specific refactor in mind — use /architecture-audit
  • For creating a PRD (product requirements) — use /write-a-prd
  • For a plan without the GitHub RFC step — use /plan
  • For interface design of a single module — use /design-an-interface

© softspark, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in app/skills/refactor-plan of softspark/ai-toolkit.

Open the folder on GitHubat commit d64db2b

Compare with similar skills

Refactor Plan next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Refactor Plan compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Refactor Plan this skillsoftspark/ai-toolkit179—~1.2kAutomated safety check: NotesApache-2.0
Valgocohesivestack/valgo508—~2.4kAutomated safety check: PassMIT
Rust Hygiene Audittsz-org/tsz572—~1.5kAutomated safety check: PassApache-2.0
iOS FixMacMagazine/app-iOS171—~957Automated safety check: PassNone
External Contributor Issuesaxelixlabs/axelix147—~2.2kAutomated safety check: PassLGPL-3.0
Request Refactor Planfossasia/eventyay-interpretation1.6k10 repos~678Automated safety check: PassApache-2.0

Similar skills

  • Valgo

    cohesivestack/valgo

    Add, refactor, debug, review, explain, or migrate type-safe validation in consumer Go applications using github.com/cohesivestack/valgo.

    508 GitHub stars~2.4k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Run a deep DRY + code-hygiene audit of the Rust workspace and turn the findings into verified, deduplicated, hierarchical GitHub tech-debt issues.

    572 GitHub stars~1.5k tokensUpdated 28 days ago
    DevelopmentAuto-check passed
  • iOS Fix

    MacMagazine/app-iOS

    Bug-fix and refactoring workflow for MacMagazine — root cause analysis, pattern-matching fix, regression verification.

    171 GitHub stars~957 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Pick open GitHub issues in the Axelix monorepo that are suitable for unpaid volunteer contributors working in their spare time.

    147 GitHub stars~2.2k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Request Refactor Plan

    fossasia/eventyay-interpretation

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

    1.6k GitHub starsUsed in 10 repos~678 tokens
    DevelopmentAuto-check passed
  • Refactor Analysis

    Samsung/TizenFX

    Automatically scans the TizenFX codebase on a rotating schedule to discover .NET 8 / C 12+ refactoring targets and register them as GitHub Issues.

    214 GitHub stars~2.6k tokensUpdated yesterday
    DevelopmentAuto-check passed

More from softspark/ai-toolkit

All 112 skills in this repo
  • Prepare Test Env

    softspark/ai-toolkit

    Prepare or verify a project QA environment with source identity, readiness, browser access, evidence paths and owned cleanup.

    179 GitHub stars~1.8k tokensUpdated yesterday
    Auto-check: notes
  • A11y Validate

    softspark/ai-toolkit

    Accessibility validator: WCAG 2.1 AA, EN 301 549, EAA. An agent skill from softspark/ai-toolkit.

    179 GitHub stars~3.8k tokensUpdated yesterday
    Auto-check: notes
  • Analyze

    softspark/ai-toolkit

    Analyzes code quality, complexity, patterns across codebase.

    179 GitHub stars~1k tokensUpdated yesterday
    Auto-check passed
  • Autonomous Dev

    softspark/ai-toolkit

    Drives a brief, specification, issue or existing PR through implementation, review, tests and QA to a ready PR.

    179 GitHub stars~2.6k tokensUpdated yesterday
    Auto-check: notes
  • Brand Voice

    softspark/ai-toolkit

    Direct technical voice for docs, README, user-facing text. An agent skill from softspark/ai-toolkit.

    179 GitHub stars~2.1k tokensUpdated yesterday
    Auto-check passed
  • CI

    softspark/ai-toolkit

    Detect/generate/debug CI pipeline config (GitHub Actions, GitLab CI).

    179 GitHub stars~1.1k tokensUpdated yesterday
    Auto-check: notes

Works with

Categories

Questions about Refactor Plan

What does Refactor Plan do?

Creates detailed refactor plan with tiny commits via interview, files as GitHub RFC. Refactor Plan is an agent skill from softspark/ai-toolkit. Creates detailed refactor plan with tiny commits via interview, files as GitHub RFC.

When should I use Refactor Plan?

Refactor Plan fits situations like: tasks that involve Refactoring.

How do I install Refactor Plan in Claude Code?

Run `npx skills add softspark/ai-toolkit --skill refactor-plan -a claude-code`. Or copy the skill folder (app/skills/refactor-plan in softspark/ai-toolkit) into .claude/skills/refactor-plan in your project. Claude Code loads it when a task matches its description.

How do I install Refactor Plan in Codex?

Run `npx skills add softspark/ai-toolkit --skill refactor-plan -a codex`. Or copy the skill folder (app/skills/refactor-plan in softspark/ai-toolkit) into .agents/skills/refactor-plan in your project. Codex loads it when a task matches its description.

Can I use Refactor Plan in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add softspark/ai-toolkit --skill refactor-plan -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/refactor-plan, .gemini/skills/refactor-plan, .github/skills/refactor-plan and .opencode/skills/refactor-plan in your project.

What does Refactor Plan need to run?

Going by SKILL.md and its folder, Refactor Plan needs the command-line tools its instructions call (gh). Its frontmatter pre-approves these tools: Read, Grep, Glob, Bash, Agent.

Does Refactor Plan access the network?

SKILL.md contains no URLs. Its commands use gh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Refactor Plan safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Refactor Plan use?

Refactor Plan is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Refactor Plan use?

About 1.2k tokens (SKILL.md is roughly 4.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Refactor Plan?

Skills that share tags, products or a category with Refactor Plan: Valgo (cohesivestack/valgo, 508 stars), Rust Hygiene Audit (tsz-org/tsz, 572 stars), iOS Fix (MacMagazine/app-iOS, 171 stars) and External Contributor Issues (axelixlabs/axelix, 147 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Refactor Plan?

softspark (a GitHub user) maintains it in softspark/ai-toolkit, which has 179 GitHub stars. The repository holds 112 skills in this directory. The repository was last updated on October 7, 2026.

Source: softspark/ai-toolkit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.