refactoring-guru — Claude Code skill: what it does, how to install
refactoring-guru — a skill for Claude Code helps diagnose code smells and choose focused refactoring techniques. The agent applies its rules to code changes while preserving behavior.
MIT 598 installs ★ 3,328 updated 2026-09-10
npx skills add ciembor/agent-rules-books --skill refactoring-guru -a claude-codeWhat refactoring-guru does
The skill guides the agent in spotting code smells and selecting a targeted refactoring technique. It keeps cleanup tied to the task instead of letting it turn into an uncontrolled redesign.
The agent reads refactoring-guru.mini.md before making code or design decisions. It consults refactoring-guru.md as a deeper reference only when the short rules do not resolve the current refactoring tradeoff. Changes should preserve the program’s behavior.
What it helps with
- spot code smells
- choose a targeted refactoring technique
- preserve behavior while changing code
- keep cleanup from expanding into a redesign
Example prompts for the agent
- Find code smells in this module and suggest a focused refactoring.
- Choose a refactoring technique for this code while preserving its behavior.
- Clean up this section without redesigning the whole system.
How to install refactoring-guru
1Skills CLI (Vercel)
npx skills add ciembor/agent-rules-books --skill refactoring-guru -a claude-code2Manually: put the files in place
~/.claude/skills/refactoring-guru/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/refactoring-guru/
1Skills CLI (Vercel)
npx skills add ciembor/agent-rules-books --skill refactoring-guru -a codex2Manually: put the files in place
.agents/skills/refactoring-guru/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add ciembor/agent-rules-books --skill refactoring-guru -a cursor2Manually: put the files in place
.cursor/skills/refactoring-guru/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install ciembor/agent-rules-books refactoring-guru2Manually: put the files in place
.github/skills/refactoring-guru/SKILL.md1Skills CLI (Vercel)
npx skills add ciembor/agent-rules-books --skill refactoring-guru -a gemini-cli2Platform CLI
gemini skills install https://github.com/ciembor/agent-rules-books --path refactoring-guruManually: put the files in place
.devin/skills/refactoring-guru/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add ciembor/agent-rules-books --skill refactoring-guru -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about refactoring-guru
How do I install refactoring-guru in Claude Code?
Run npx skills add ciembor/agent-rules-books --skill refactoring-guru -a claude-code. The skill file is located at ~/.claude/skills/refactoring-guru/SKILL.md.
What does refactoring-guru do?
It guides the agent in diagnosing code smells, choosing focused refactoring techniques, and preserving behavior. The agent starts with concise rules and consults the longer reference if those rules do not settle a tradeoff.
Which files does refactoring-guru use?
The agent reads refactoring-guru.mini.md first and consults refactoring-guru.md when the shorter rules are not enough for the current decision.
Source text
SKILL.md · MIT
--- name: refactoring-guru description: Apply Refactoring.Guru-inspired rules when diagnosing code smells, choosing refactoring techniques, and stopping cleanup before uncontrolled redesign. license: MIT --- # Refactoring.Guru Skill Use this skill when a task involves diagnosing smells, choosing targeted refactoring treatments, preserving behavior, applying a refactoring catalog, or avoiding uncontrolled redesign. Before making design or code decisions, read and apply [refactoring-guru.mini.md](refactoring-guru.mini.md). Use [refactoring-guru.md](refactoring-guru.md) only as a deeper reference when the mini rules are not enough for the current refactoring tradeoff.
© ciembor · MIT · ciembor/agent-rules-books