Refactoring to Patterns
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.
Install
/plugin marketplace add vnovakovits/claude-skillsThe repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.
npx skills add vnovakovits/claude-skills --skill refactoring-to-patternsgit 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-to-patterns ~/.claude/skills/refactoring-to-patternsPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# Refactoring to Patterns (Joshua Kerievsky) Apply this skill when a code smell justifies introducing a design pattern — but not before. The book bridges Fowler's refactorings and the Gang of Four patterns: Fowler tells you the named moves; the GoF tells you the named destinations; Kerievsky shows when the move is worth the destination. ## Core Philosophy **Patterns are destinations, not starting points.** GoF patterns were extracted from successful designs after the fact. Using them as upfront templates produces "patternitis" — code that is more complex than the problem requires, in service of nominal compliance with a pattern that no smell asked for. **Refactor toward patterns when a smell demands it.** A pattern earns its complexity when the alternative (status quo) has cost that the pattern eliminates. If the status quo has no cost, the pattern adds cost without offsetting benefit. **Refactor away from patterns when they no longer earn their keep.** Patterns extracted speculatively, patterns that don't fit the actual variation, patterns whose flexibility is never exercised — these should be *inlined*, not preserved. **Three directions of refactoring** with respect to a pattern: - **Refactoring TO a pattern** — full move, smell to pattern. - **Refactoring TOWARD a pattern** — partial move; useful when full commitment isn't justified yet. - **Refactoring AWAY FROM a pattern** — undo a pattern that's not pulling its weight.
Details
- Skill name
refactoring-to-patterns- Repository
- vnovakovits/claude-skills
- Path
plugins/engineering-practices/skills/refactoring-to-patterns/SKILL.md- License
- MIT
- Repo updated
- 16 November 2026
FAQ
What does the Refactoring to Patterns skill do?
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.
How do I install the Refactoring to Patterns 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 to Patterns popular?
It lives in vnovakovits/claude-skills, which has 5 GitHub stars and 2 forks.
Related skills
Accidental Cio
5vnovakovits/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
Agent Retro
5vnovakovits/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
API Design
5vnovakovits/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.
Repository Context Checker
8Freddy-CHEN-ux/00_claude_skills
Verify developers are working in the right repository type (brain vs code)
Refactoring
5vnovakovits/claude-skills
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.
Responsibility Driven Design
5vnovakovits/claude-skills
Apply Responsibility-Driven Design (RDD) by Rebecca Wirfs-Brock and Brian Wilkerson when designing classes, distributing behavior across objects, modeling a domain, or refactoring object-oriented code. Covers responsibilities, role stereotypes, CRC cards, collaborations, contracts, object neighborhoods, and the Tell-Don't-Ask principle.
Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.