refactor-planner
Skill4 starsChanged 27 days agoMITView on GitHub
Use when asked to refactor, clean up, restructure or modernize code, split a large file or god class, remove duplication, migrate to a new pattern or library, or reduce technical debt without changing behavior.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- emtcmca/guildproof-skillstheir own version, first seen Sep 19, 2026
- caiolocateli46-cell/skills-caiotheir own version, first seen May 22, 2026
- vbrevik/claude_code_skillstheir own version, first seen Mar 14, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- caiolocateli46-cell/skills-caio★ 4same name
- emtcmca/guildproof-skills★ 0same name
- vbrevik/claude_code_skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository30 other files it gives its agents.
- accessibility-auditSkill
- api-design-reviewSkill
- api-test-writerSkill
- architecture-diagramSkill
- bug-debuggerSkill
- bug-report-writerSkill
- changelog-writerSkill
- codebase-onboardingSkill
- code-reviewSkill
- database-schema-designSkill
- dependency-upgradeSkill
- design-handoff-specSkill
- design-reviewSkill
- dockerize-appSkill
- figma-design-compareSkill
- flaky-test-fixerSkill
- git-commit-writerSkill
- github-actions-ciSkill
- playwright-e2e-testsSkill
- prd-writerSkill
- proof-of-done-liteSkill
- readme-writerSkill
- security-auditSkill
- seo-auditSkill
- test-case-generatorSkill
- test-plan-writerSkill
- test-writerSkill
- ux-research-synthesisSkill
- ux-writingSkill
- web-performance-auditSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Build the safety net: Run existing tests. If the behavior being moved is not covered, add characterization tests that capture what it does …
- Distinctive: line 21
Finish: remove dead code, update docs, report.
- Distinctive: line 25
Before changing code, deliver the plan:
- Distinctive: line 36
After executing: the list of commits and the test result after the last one.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Refactor Planner
Overview
Refactoring changes structure, never behavior. Lock behavior with tests first, move in small steps that each leave the code working, and keep every step reviewable and revertible.
Method
- State the goal in one sentence and why it pays off: "Split
orders.ts(1,400 lines) so checkout and refunds can change independently." - Map the code: who calls the target (find usages), what it depends on, public contracts that must not change.
- Build the safety net. Run existing tests. If the behavior being moved is not covered, add characterization tests that capture what it does today, including odd behavior.
- Plan small steps. Each step is one known refactoring, keeps tests green, and is one commit:
- Rename, extract function, extract module, move function, inline, introduce parameter object, replace conditional with polymorphism, extract interface at a boundary.
- For migrations: add the new path beside the old one, move callers in batches, delete the old path last.
- Execute step by step: change, run tests, commit. Never mix a refactor and a behavior change in one commit.
- Finish: remove dead code, update docs, report.
Output
Before changing code, deliver the plan:
Goal: <one sentence>
Safety net: <existing tests, tests to add>
Steps:
1. <refactoring> — <files> — risk: low/medium/high
2. ...
Out of scope: <tempting changes deliberately left out>After executing: the list of commits and the test result after the last one.
Smells and the refactoring that fixes them
| Smell | Refactoring |
| Long function doing several things | Extract function per responsibility |
| File or class with many unrelated reasons to change | Split by responsibility, move functions |
| Same logic in several places | Extract shared function; keep it where all callers can reach it |
| Long parameter lists | Introduce parameter object |
switch on type repeated in many places | Polymorphism or a lookup table |
| Deep nesting | Guard clauses, early returns |
| Feature envy (code that mostly uses another module's data) | Move function to that module |
Common mistakes
- Big-bang rewrite in one commit that nobody can review or revert.
- Refactoring without tests, then discovering behavior changed in production.
- "While I am here" behavior changes mixed into the refactor.
- Abstracting for imagined future needs; extract only what has two real callers.
- Renaming public APIs without a deprecation path for external users.
Made by Wageesha Tripathi · LinkedIn · Email · More skills
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

