Skip to main content
skill CX Codex

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

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add ciembor/agent-rules-books --skill refactoring-guru -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/refactoring-guru/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/refactoring-guru/

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

Similar skills

All skills for Code review and refactoring →
project-management-guru-adhd curiositech project-management-guru-adhd is a Claude Code skill that helps ADHD engineers manage multiple projects, protecting hyperfocus and reducing context switches. CX Codex +1 253installs golang-refactoring samber golang-refactoring — a skill for behavior-preserving restructuring of Go code at scale. Uses gopls, gofmt, and tools like gopatch to break down large functions, rename types across a project, and reorganize packages without breakage. CX Codex +1 13,600installs java-refactoring-extract-method official github The java-refactoring-extract-method skill guides Extract Method refactoring for complex Java methods while preserving behaviour. Use it when a method needs smaller, focused units backed by tests. CX Codex +1 9,284installs java-refactoring-remove-parameter official github The java-refactoring-remove-parameter skill guides an agent through removing unused or derivable parameters from Java methods and updating their callers. Use it when the change must preserve behavior and be checked with tests. CX Codex +1 8,900installs refactoring-patterns wondelai refactoring-patterns — a skill that improves code structure through named, behavior-preserving transformations. Use it to eliminate duplication, break apart long methods, or realign responsibilities across classes. CX Codex +1 6,900installs dry-refactoring kucherenko The dry-refactoring skill automates refactoring of copy-paste clones found by jscpd. It guides you through extraction strategies—function, parameterization, module or class—and highlights which files to start with. CX Codex +1 4,100installs

From the same set14

The whole set →
code-complete The code-complete Claude Code skill applies software construction rules to routines, classes, control flow, defensive code, and tests. It activates for implementation and design tasks. CX Codex +1 611installs release-it The release-it Claude Code skill applies production reliability rules to failure handling, timeouts and retries. It activates on tasks involving integration failures, deployment or operational readiness. CX Codex +1 607installs the-pragmatic-programmer the-pragmatic-programmer — a skill for Claude Code and Codex applying Hunt and Thomas-inspired engineering guidelines. Triggers during architecture decisions, automation work, and code refactoring. CX Codex +1 603installs working-effectively-with-legacy-code working-effectively-with-legacy-code — a skill for Claude Code and Codex that enforces Michael Feathers' legacy code techniques. Activates during risky refactoring, missing test coverage, and dependency breaking. CX Codex +1 602installs designing-data-intensive-applications designing-data-intensive-applications — a skill for Claude Code that applies Martin Kleppmann-inspired data-system rules when designing scalable architectures. CX Codex +1 598installs domain-driven-design-distilled domain-driven-design-distilled — a skill for Claude Code that integrates lightweight Domain-Driven Design (DDD) rules into the development workflow. It assists in modeling domains and contexts without excess ceremony. CX Codex +1 593installs domain-driven-design The domain-driven-design Claude Code skill applies DDD rules to domain modeling. It activates for complex domains, bounded contexts, ubiquitous language, and aggregate design. CX Codex +1 589installs patterns-of-enterprise-application-architecture patterns-of-enterprise-application-architecture is a Claude Code skill for choosing enterprise application patterns. It activates on tasks involving layers, domain models, repositories, or integrations. CX Codex +1 585installs

Project sponsors

Companies that keep this analytics open