Skill
Refactor planner
Plans a safe, step-by-step refactor of a file or area before any code changes. Manual-only: run it with /refactor-planner.
Free For Claude Code
How to use it
- Save the file below as
.claude/skills/refactor-planner/SKILL.mdin your project. - Run it in Claude Code with
/refactor-planner.
.claude/skills/refactor-planner/SKILL.md
---
name: refactor-planner
description: Plans a refactor in small, safe steps without changing any code.
disable-model-invocation: true
argument-hint: [file-or-folder]
---
Read $ARGUMENTS (if none is given, ask which file or folder to plan for) and the code that uses it.
Reply with a plan only:
1. **What is wrong today**: the specific problems (duplication, tangled responsibilities, hard-to-test code), each tied to a file and line.
2. **Goal**: what the code should look like afterwards, in two or three sentences.
3. **Steps**: a numbered list of small changes. Each step must leave the project working and say how to check it (a test, a build, a manual check).
4. **Risks**: behaviour that could change by accident, and which existing tests would catch it. Say plainly where there are no tests.
5. **Not worth doing**: anything tempting that adds risk for little gain.
Do not edit any files. Ask the user to approve the plan before starting step 1.