Refactoring

Apply Martin Fowler's refactoring discipline — changing the internal structure of code without changing its observable behavior — using the named refactorings catalog (Extract Function, Move Method, Replace Conditional with Polymorphism, etc.) and the code-smells catalog (Long Method, Feature Envy, Primitive Obsession, etc.). Use when cleaning code under a test safety net, responding to a code smell, preparing code for a new feature, or as the third step of every TDD cycle.

5 stars 2 forksSoftware Development Plugin marketplace

Install

Claude Code plugin
/plugin marketplace add vnovakovits/claude-skills

The repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add vnovakovits/claude-skills --skill refactoring
Manual install
git clone --depth 1 https://github.com/vnovakovits/claude-skills.git /tmp/claude-skills
mkdir -p ~/.claude/skills
cp -r /tmp/claude-skills/plugins/engineering-practices/skills/refactoring ~/.claude/skills/refactoring

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Refactoring (Martin Fowler)

Apply this skill whenever you need to change the structure of existing code without changing its observable behavior — to prepare code for a new feature, to eliminate a smell, to recover a clearer design, or as the third leg of the Red-Green-Refactor cycle. Refactoring is a disciplined practice, not "cleaning up": small steps, tests after each, and a catalog of named moves.

## Core Philosophy

**Refactoring is the discipline of changing structure without changing behavior.** If behavior changes, it isn't refactoring — it's editing.

**Two hats** (Beck). At any moment you wear one of two hats: the **adding-features hat** (behavior change, tests turn red then green) or the **refactoring hat** (no behavior change, all tests stay green). Switching hats is fine; wearing both at once is dangerous. Mixing them means you cannot tell what broke the test.

**Small steps, tests after each.** A refactoring is a sequence of tiny, individually-safe transformations. If a step breaks a test, undo and try smaller. Big-bang refactorings are not refactorings — they are rewrites with optimism.

**Refactor for a reason.** Refactor to make the next change easier, to eliminate a smell that's costing comprehension, or as part of a TDD cycle. Refactoring for its own sake is yak-shaving.

**Refactoring is an economic activity.** Time invested in refactoring is justified by faster future change. Code that won't change again doesn't earn refactoring.

---
Read the full skill on GitHub

Details

Skill name
refactoring
Path
plugins/engineering-practices/skills/refactoring/SKILL.md
License
MIT
Repo updated
16 November 2026

FAQ

What does the Refactoring skill do?

Apply Martin Fowler's refactoring discipline — changing the internal structure of code without changing its observable behavior — using the named refactorings catalog (Extract Function, Move Method, Replace Conditional with Polymorphism, etc.) and the code-smells catalog (Long Method, Feature Envy, Primitive Obsession, etc.). Use when cleaning code under a test safety net, responding to a code smell, preparing code for a new feature, or as the third step of every TDD cycle.

How do I install the Refactoring skill?

Claude Code plugin: /plugin marketplace add vnovakovits/claude-skills. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Refactoring popular?

It lives in vnovakovits/claude-skills, which has 5 GitHub stars and 2 forks.

Related skills

Accidental Cio

5

vnovakovits/claude-skills

Apply Scott Millett's "The Accidental CIO — A Lean and Agile Playbook for IT Leaders" (Wiley, 2024) when designing or reviewing how a technology organisation decides, funds, governs and delivers work. Covers the five components of an adaptive IT operating model (organised, work, govern, talent, lead) and its four themes (outcomes over output, intrinsic motivation, being not doing agile, manage flow not people); matching method and governance to context via Cynefin and Wardley evolution; governance as demand management + funding + measurement + decision rights, shifting from project funding to

Frontend & Design

Agent Retro

5

vnovakovits/claude-skills

Run a retrospective on a coding-agent session and improve the agent's environment, not the code. Combines Derby & Larsen's five-stage retrospective, Shigeo Shingo's poka-yoke (turn a mechanical mistake into a check that makes it impossible), and Matt Pocock's retro categories — navigation, automated checks, coding standards, steering files, tool economy, information access. Covers mining the session transcript for corrections, wrong turns and slow searches; deciding where each fix belongs (analyzer, hook, CI, reviewer standards, CLAUDE.md pointer, skill, doc or memory); the no-op test for stee

AI, LLMs & Agents

API Design

5

vnovakovits/claude-skills

Design APIs that are clear, evolvable, and idiomatic to their protocol — covering REST (Fielding, Richardson Maturity Model, Massé), GraphQL, gRPC/protobuf, versioning strategies, pagination, error responses (RFC 7807 Problem Details), idempotency, authentication, documentation (OpenAPI), and the pragmatic trade-offs between RESTful purity and developer ergonomics. Use when designing a new endpoint, choosing between REST/GraphQL/gRPC, defining versioning, structuring error responses, deciding pagination strategy, or evaluating an existing API's evolvability.

Software Development

Refactoring to Patterns

5

vnovakovits/claude-skills

Apply Joshua Kerievsky's "Refactoring to Patterns" — the discipline of arriving at Gang of Four design patterns through refactoring driven by smells, not by upfront design. Includes the "refactor to / toward / away from a pattern" framing, the economic argument against pattern over-use, and the specific refactorings whose targets are named patterns (Factory, Strategy, Observer, Composite, Adapter, Template Method, State, Null Object). Use when a smell genuinely warrants a pattern, when undoing speculative pattern over-engineering, or when teaching the right time to introduce patterns.

Software Development

QA Debugging

8

Freddy-CHEN-ux/00_claude_skills

Systematic debugging methodologies, troubleshooting workflows, logging strategies, error tracking, performance profiling, stack trace analysis, and debugging tools across languages and environments. Covers local debugging, distributed systems, production issues, and root cause analysis.

Software Development

Repository Context Checker

8

Freddy-CHEN-ux/00_claude_skills

Verify developers are working in the right repository type (brain vs code)

Software Development

Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.