refactor-plan

refactor-plan is a skill for Claude Code from softspark/ai-toolkit. It costs 39 tokens per session (1,047 once invoked), scanned A, original, Apache-2.0.

A guided process for designing a safe code refactor, meaning a change to code structure without changing its behaviour, and recording the plan as a GitHub issue.

In plain words
What is it for?
Use it to investigate a module, discuss several refactoring options, interview the requester about scope, and plan tiny commits.
Why use it?
It helps compare approaches, check test coverage, and split risky changes into small steps that keep the code working.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the ai-toolkit plugin — 115 skills, 44 agents, 14 hooks shipped together

Good fit Use it to investigate a module, discuss several refactoring options, interview the requester about scope, and plan tiny commits.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/softspark/ai-toolkit/refactor-plan
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add softspark/ai-toolkit --skill refactor-plan
Clone the repo
git clone --depth 1 https://github.com/softspark/ai-toolkit

Made for: Claude Code.

Or install ai-toolkit, the plugin that ships this one along with the rest of its 115 skills, 44 agents, 14 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for refactor-plan

README.md
[![agentmods](https://agentmods.dev/badge/skills/softspark/ai-toolkit/refactor-plan/github.svg)](https://agentmods.dev/skills/softspark/ai-toolkit/refactor-plan)
Your own site
<a href="https://agentmods.dev/skills/softspark/ai-toolkit/refactor-plan"><img src="https://agentmods.dev/badge/skills/softspark/ai-toolkit/refactor-plan/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for refactor-plan

Your own site · 80×15
<a href="https://agentmods.dev/skills/softspark/ai-toolkit/refactor-plan"><img src="https://agentmods.dev/badge/skills/softspark/ai-toolkit/refactor-plan.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,047 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00039 $0.01047
Opus 5 $0.00019 $0.00524
Sonnet 5 $0.00008 $0.00209
Haiku 4.5 $0.00004 $0.00105

Measured 8d ago against content hash 11d8dcd25888, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

refactor-plan scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

app/skills/refactor-plan/SKILL.md · 131 lines

How it starts

The opening of the file, as written. The whole thing — 131 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

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

Read the full file on GitHub · 131 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 131 lines · 39 tokens per session scan A 11d8dcd25888

Subscribe to this mod's changes

refactor-plan is a skill published in the GitHub repository softspark/ai-toolkit (174 stars, last pushed yesterday), licensed Apache-2.0. It adds 39 tokens to every session and 1,047 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

go-code-reviewer

Review Go code with a defect-first approach using repository policy (constitution.md first, then AGENTS.md fallback). Use for code review, PR review, quality checks, risk analysis, and regression detection.

johnqtcg/awesome-skills · 45 tokens

go-review-lead

Orchestrate a comprehensive Go code review by triaging code changes, dispatching vertical review skills (security, concurrency, error, logic, performance, quality, test, observability) as parallel agents, then consolidating results into a unified report. Use for full Go PR review or comprehensive code review. Replaces…

johnqtcg/awesome-skills · 80 tokens

security-review

A code-security review guide that checks code changes, pull requests, or services for risks an attacker could exploit.

johnqtcg/awesome-skills · 164 tokens

go-concurrency-review

Review Go code for concurrency safety and goroutine lifecycle issues including race conditions, deadlocks, goroutine leaks, mutex misuse, and context propagation. Trigger when code contains go func, channels, sync primitives, WaitGroup, errgroup, or goroutine lifecycle management. Use for concurrency-focused review of…

johnqtcg/awesome-skills · 67 tokens

go-error-review

Review Go code for error handling correctness, nil safety, and failure-path integrity including ignored errors, missing wrapping, panic misuse, SQL/HTTP resource lifecycle, and transaction patterns. Trigger when code contains error returns, panic calls, sql.Rows, transactions, HTTP client/server code, or nil-sensitive…

johnqtcg/awesome-skills · 75 tokens

go-observability-review

Review Go code for observability gaps: missing structured logging, broken trace context propagation, Prometheus cardinality explosions, span lifecycle errors, and sensitive fields in logs. Dispatched by go-review-lead as a vertical reviewer. Also trigger directly when the user says "review my logging", "check my…

johnqtcg/awesome-skills · 80 tokens