
Refactoring guide
Plans safe, test-backed refactorings using Martin Fowler's catalog of named techniques
Refactoring guide is an open-source agent skill for developer tools. It is available on Claude Code.
- Scripts
- None
- Platforms
- Claude Code
- GitHub stars
- 6
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Refactoring guide
This skill guides an agent through restructuring code by mapping common code smells to named refactorings from Martin Fowler's catalog. It groups techniques into extract, simplify and reorganize families, so the agent can match a problem such as a long function, nested conditionals or shotgun surgery to a specific fix.
Before proposing changes, the skill has the agent read the target code, locate existing tests, map what depends on it and check for open pull requests or in-progress work. Each proposed refactoring is then rated for risk, test coverage, blast radius, reversibility and whether it can be done incrementally, and turned into a plan with preconditions, atomic steps, verification and expected end state.
The output follows a fixed markdown template with a target summary, current issues, proposed refactorings, execution order and a safety checklist. The skill is a plain instruction file with no scripts. It assumes the agent can run the project's tests and typecheck between steps.
When your agent uses it
Fowler-based refactoring recommendations with specific techniques, risk assessment, and step-by-step plans. Use when code needs restructuring and you want a safe execution plan. To first locate structural issues use /architecture-review.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 1 file (5 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the claude-code-kit plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add tansuasici/claude-code-kit
/plugin install claude-code-kit@claude-code-kitOr copy only this skill to ~/.claude/skills/refactoring-guide:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/tansuasici/claude-code-kit.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/refactoring-guide &&
cp -R "$tmp/.claude/skills/refactoring-guide" ~/.claude/skills/refactoring-guide &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/refactoring-guide inside it instead.
Copy the skill folder to ~/.agents/skills/refactoring-guide to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/tansuasici/claude-code-kit.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/refactoring-guide &&
cp -R "$tmp/.claude/skills/refactoring-guide" ~/.agents/skills/refactoring-guide &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/refactoring-guide inside it instead.
Copy the skill folder to ~/.cursor/skills/refactoring-guide to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/tansuasici/claude-code-kit.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/refactoring-guide &&
cp -R "$tmp/.claude/skills/refactoring-guide" ~/.cursor/skills/refactoring-guide &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/refactoring-guide inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/tansuasici/claude-code-kit.git --path .claude/skills/refactoring-guideOr copy the folder to ~/.gemini/skills/refactoring-guide yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/refactoring-guide:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/tansuasici/claude-code-kit.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/refactoring-guide &&
cp -R "$tmp/.claude/skills/refactoring-guide" ~/.copilot/skills/refactoring-guide &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/refactoring-guide inside it instead.
Get the folder:
git clone --depth 1 https://github.com/tansuasici/claude-code-kit.gitThen copy claude-code-kit/.claude/skills/refactoring-guide into your agent's skills folder as refactoring-guide. Agents that support SKILL.md read one folder per skill.
What it does
- Code smell mapping
- Matches smells such as long functions, feature envy and data clumps to named Fowler refactorings.
- Risk assessment
- Rates each proposed change by risk level, test coverage, blast radius and reversibility.
- Step-by-step execution plan
- Gives preconditions, atomic steps, verification commands and expected results for each refactoring.
- Test-first safeguards
- Requires existing tests to be identified or written before any behavior-preserving change.
- Dependency and PR checks
- Has the agent map dependent code and avoid areas with open pull requests or unfinished features.
- Structured report template
- Produces a consistent markdown report with target, issues, refactorings, ordering and a safety checklist.
Good for
- Plan a safe refactor of a bloated module into smaller classes
- Turn audit findings into ordered, committable refactoring steps
- Replace a growing switch on type with polymorphism without changing behavior
- Prepare a messy area of code for a new feature with cleaner foundations
- Assess the risk of splitting a large interface before editing it
Refactoring guide FAQ
When does Refactoring guide trigger?
It is invoked with /refactoring-guide when code needs restructuring and a safe execution plan is wanted. The skill suggests running /architecture-review first to locate structural issues.
Does Refactoring guide change code directly?
The skill is focused on recommendations and a plan. It asks that each refactoring be applied stepwise, with tests run and verified between steps.
What should be in place before using Refactoring guide?
The skill's core rule is to refactor only when current behavior is understood and tested. If tests are missing, its notes say to write them first.
Does Refactoring guide need any scripts or extra tools?
The folder contains only the SKILL.md file and no scripts. The plan assumes the project's tests and typecheck can be run between steps.
How do I install Refactoring guide in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/refactoring-guide to use it in all your projects, or to .claude/skills/refactoring-guide in one project. Or install the claude-code-kit plugin, which includes it: /plugin marketplace add tansuasici/claude-code-kit, then /plugin install claude-code-kit@claude-code-kit.
Does Refactoring guide run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Refactoring guide?
Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.
What are the best alternatives to Refactoring guide?
The closest alternatives to Refactoring guide are Refactor, Refactor plan, Refactor, Code simplification and Code simplification.
Where this comes from
- Description: from the skill's own SKILL.md.
More from tansuasici/claude-code-kit

Audits UI code against WCAG 2.1 AA for semantics, keyboard use, contrast and ARIA
- Open source
- 6 GitHub stars
- Developer tools

Audits a codebase's structure for SOLID violations, coupling and module boundary issues
- Open source
- 6 GitHub stars
- Developer tools

Lists the skills, agents, hooks and modules installed in a kit-enabled project
- Open source
- 6 GitHub stars
- Developer tools

Audits code for smells, error-handling gaps and maintainability issues with fixes
- Open source
- 6 GitHub stars
- Developer tools

Guides the agent to write and extend a project's golden-principles.yaml rule file
- Open source
- 6 GitHub stars
- Developer tools

Finds unused functions, dead imports, orphan files and unreachable branches in a codebase
- Open source
- 6 GitHub stars
- Developer tools




