Refactor
Code refactoring best practices based on Martin Fowler's catalog and Clean Code principles (formerly refactoring). This skill should be used when refactoring existing code, improving code structure, reducing complexity, eliminating code smells, or reviewing code for maintainability. Triggers on tasks involving extract method, rename, decompose conditional, reduce coupling, or improve readability.
Install
npx skills add pproenca/dot-skills --skill refactorgit clone --depth 1 https://github.com/pproenca/dot-skills.git /tmp/dot-skills
mkdir -p ~/.claude/skills
cp -r /tmp/dot-skills/skills/.curated/refactor ~/.claude/skills/refactorPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# Fowler/Martin Code Refactoring Best Practices Comprehensive code refactoring guide based on Martin Fowler's catalog and Clean Code principles, designed for AI agents and LLMs. Contains 43 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation. ## When to Apply Reference these guidelines when: - Refactoring existing code to improve maintainability - Decomposing long methods or large classes - Reducing coupling between components - Simplifying complex conditional logic - Reviewing code for code smells and anti-patterns ## Rule Categories by Priority | Priority | Category | Impact | Prefix | |----------|----------|--------|--------| | 1 | Structure & Decomposition | CRITICAL | `struct-` | | 2 | Coupling & Dependencies | CRITICAL | `couple-` | | 3 | Naming & Clarity | HIGH | `name-` | | 4 | Conditional Logic | HIGH | `cond-` | | 5 | Abstraction & Patterns | MEDIUM-HIGH | `pattern-` | | 6 | Data Organization | MEDIUM | `data-` | | 7 | Error Handling | MEDIUM | `error-` | | 8 | Micro-Refactoring | LOW | `micro-` | ## Quick Reference ### 1. Structure & Decomposition (CRITICAL) - `struct-extract-method` - Extract Method for Long Functions - `struct-single-responsibility` - Apply Single Responsibility Principle - `struct-extract-class` - Extract Class from Large Class - `struct-compose-method` - Compose Method for Readable Flow - `struct-function-length` - Keep Functions Under 20 Lines
Details
- Skill name
refactor- Repository
- pproenca/dot-skills
- Path
skills/.curated/refactor/SKILL.md- License
- MIT
- Repo updated
- 15 August 2026
FAQ
What does the Refactor skill do?
Code refactoring best practices based on Martin Fowler's catalog and Clean Code principles (formerly refactoring). This skill should be used when refactoring existing code, improving code structure, reducing complexity, eliminating code smells, or reviewing code for maintainability. Triggers on tasks involving extract method, rename, decompose conditional, reduce coupling, or improve readability.
How do I install the Refactor skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add pproenca/dot-skills --skill refactor. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Refactor popular?
It lives in pproenca/dot-skills, which has 228 GitHub stars and 19 forks.
Related skills
12 Factor App
228pproenca/dot-skills
The Twelve-Factor App methodology for building scalable, maintainable cloud-native applications. Use when designing backend services, APIs, microservices, or any software-as-a-service application. Triggers on deployment patterns, configuration management, process architecture, logging, and infrastructure decisions.
37signals Rails
228pproenca/dot-skills
37signals Rails coding principles and conventions from DHH, Jorge Manrubia, and the Fizzy/Basecamp/HEY codebase. This skill should be used when writing, reviewing, or refactoring Ruby on Rails code following the 37signals philosophy — vanilla Rails, CRUD controllers, rich domain models, concerns, no service objects, Hotwire, Turbo, Stimulus, Solid Queue, Solid Cache, Solid Cable, multi-tenancy, Minitest, custom auth, or DHH conventions.
Acceptance Pipeline Catalog
228pproenca/dot-skills
Use when implementing, reviewing, or debugging a Gherkin acceptance-test pipeline with mutation testing. Covers parser, JSON IR, generator, runtime, step handlers, test runner, mutator, value mutation rules, execution, result classification, reporting, project layout, conformance, and agent setup. Based on Uncle Bob's Acceptance Pipeline Specification. Trigger even when the user mentions Gherkin parsing, acceptance test generation, mutation testing for acceptance tests, or building a portable test pipeline.
Requirements Analysis
191jwynia/agent-skills
Diagnose requirements problems and guide discovery of real needs and constraints
Rails Hotwire
228pproenca/dot-skills
Ruby on Rails Hotwire best practices for building interactive applications with Turbo Drive, Turbo Frames, Turbo Streams, Turbo 8 morphing, and Stimulus controllers. This skill should be used when writing, reviewing, or refactoring Hotwire-powered Rails code to ensure optimal patterns for navigation, partial page updates, real-time broadcasting, morphing, Stimulus controller design, error handling, and progressive enhancement. Triggers on tasks involving Turbo Frames, Turbo Streams, Turbo Drive, broadcasts, morphing, Stimulus controllers, ActionCable, turbo_stream_from, turbo_frame_tag, data-c
Restful Hateoas
228pproenca/dot-skills
RESTful API design guidelines following the Richardson Maturity Model through to Level 3 (HATEOAS) for Ruby on Rails. This skill should be used when designing, building, reviewing, or refactoring REST APIs to ensure proper resource modeling, HTTP method semantics, hypermedia controls, content negotiation, and API evolvability. Triggers on tasks involving API controllers, serializers, routing, link relations, pagination, error handling, or HTTP caching in Rails.
Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.