claude

refactor

141 SKILL.md skills — 1 audit orchestrator + 66 refactorings + 24 smells + 50 patterns (27 Kerievsky + 23 GoF). Apply Fowler refactorings when their preconditions appear; refuse known code smells; apply Kerievsky composite refactorings whose destination is a pattern; recognize GoF design patterns as destination shapes. Sources: https://refactoring.com/catalog/, Refactoring to Patterns (Kerievsky 2004), and Design Patterns (Gamma/Helm/Johnson/Vlissides 1994).

0 on GitHubby Wallace Drewupdated 4 months agodevelopment
/

Plugin refactor from marketplace ritl in wallacedrew/ritl. Commands read from the repo's manifest — 1 month ago.

What it installs

Skills (141)

  • abstract-factory

    Apply Abstract Factory when you see Shotgun Surgery, Repeated Switches, Replace Constructor with Factory Function. The agent reads one factory interface to know what products exist; concrete factories are short and exhaustive; client code is one factory pointer away from the right family.

  • adapter

    Apply Adapter when you see Alternative Classes with Different Interfaces, Change Function Declaration, Replace Subclass with Delegate. The canonical interface is the agent's single anchor for reasoning about how the system uses payments; the adapter is a thin file the agent reads once to understand

  • alternative-classes-with-different-interfaces

    Refuse Alternative Classes with Different Interfaces when two classes the agent recognizes as doing similar things but with mismatched method names and signatures; the agent must learn both vocabularies and translate between them. Apply Change Function Declaration, Move Function.

  • audit

    Audit a target for refactoring smells — primary purpose is shared understanding of what's present, for both agent and human reader; refactoring is the action arm, taken only on accepted rows. Sense the smells, build a decision table, lay down safety-net tests for accepted rows, then apply the matchi

  • bridge

    Apply Bridge when you see Shotgun Surgery, Replace Subclass with Delegate, Extract Class. Two independent surfaces the agent reads separately.

  • builder

    Apply Builder when you see Long Parameter List, Primitive Obsession, Introduce Parameter Object. Self-describing construction the agent reads top-to-bottom without cross-file lookup.

  • chain-constructors

    Apply Chain Constructors when you see Duplicated Code, Extract Function, Combine Functions into Class. One construction path the agent reads to know what a fully-initialized object looks like; all other paths are one-line delegations the agent skips past during reasoning.

  • chain-of-responsibility

    Apply Chain of Responsibility when you see Long Function, Divergent Change, Replace Conditional with Polymorphism. N small handler classes the agent reads one at a time.

  • change-function-declaration

    Apply Change Function Declaration when you see Mysterious Name, Long Parameter List, Alternative Classes with Different Interfaces. Names and signatures express what the function does; the agent reasons about call sites from the signature alone.

  • change-reference-to-value

    Apply Change Reference to Value when you see Mutable Data. The object is immutable + equal-by-content; the agent reasons about value semantics without modeling write timing.

  • change-value-to-reference

    Apply Change Value to Reference when you see Duplicated Code. The entity exists once; the agent reasons about one canonical object referenced everywhere.

  • collapse-hierarchy

    Apply Collapse Hierarchy when you see Lazy Element, Speculative Generality. The subclass folds into the parent; the agent reads one class instead of a degenerate two-class hierarchy.

  • combine-functions-into-class

    Apply Combine Functions into Class when you see Data Clumps, Primitive Obsession. Operations live with the data they act on; the agent loads one class to reason about both shape and behavior.

  • combine-functions-into-transform

    Apply Combine Functions into Transform when you see Data Clumps, Mutable Data. One transform produces the enriched record from the input; the agent reads one input-to-shape contract and consumers read named output fields without simulating the derivation.

  • command

    Apply Command when you see Repeated Switches, Primitive Obsession, Replace Function with Command. One Command interface (execute + undo) the agent reads as the structural commitment.

  • comments

    Refuse Comments when comments explaining what the next block does or what a function returns; the agent loading the comment plus the code carries two sources of truth that may have drifted apart. Apply Extract Function, Change Function Declaration.

  • compose-method

    Apply Compose Method when you see Long Function, Extract Function, Replace Temp with Query. The method reads as a sequence of named operations the agent verifies against without re-deriving the algorithm.

  • composite

    Apply Composite when you see Repeated Switches, Replace Conditional with Polymorphism, Replace Type Code with Subclasses. A typed interface where adding a new node kind forces the type system to demand an implementation of every operation.

  • consolidate-conditional-expression

    Apply Consolidate Conditional Expression when you see Duplicated Code. The predicate lives at one named function the agent reads once; edits to the rule land at the function definition and propagate to every caller through reference.

  • data-class

    Refuse Data Class when a class whose surface is only getters and setters; all real behavior lives in consumers, scattered across files the agent must locate to reason about anything domain-meaningful. Apply Encapsulate Record, Remove Setting Method.

  • data-clumps

    Refuse Data Clumps when the agent sees the same field group appearing across multiple signatures (parameters, class fields, interface properties, args) — every site re-parses the same shape and verifies the same ordering. Apply Extract Class, Introduce Parameter Object.

  • decompose-conditional

    Apply Decompose Conditional when you see Long Function, Comments. Conditions read as named domain decisions; the agent reasons about isSummer(date) instead of re-deriving the month range.

  • decorator

    Apply Decorator when you see Large Class, Divergent Change, Replace Subclass with Delegate. N small wrapper classes the agent reads one at a time.

  • divergent-change

    Refuse Divergent Change when reading the module, the agent constantly switches between conceptually unrelated regions (tax logic, UI logic, API logic); every cross-axis edit pays context-window load for all of them. Apply Split Phase, Move Function.

  • duplicated-code

    Refuse Duplicated Code when near-identical code in multiple files; each copy the agent reads adds tokens to the context window without adding new information, and copies the agent doesn't read stay unverified. Apply Extract Function, Slide Statements.

  • encapsulate-classes-with-factory

    Apply Encapsulate Classes With Factory when you see Shotgun Surgery, Replace Constructor with Factory Function, Hide Delegate. One factory module the agent verifies once; all construction sites read as named factory calls the agent treats opaquely.

  • encapsulate-collection

    Apply Encapsulate Collection when you see Mutable Data, Insider Trading. The owner exposes mutation methods (add, remove, replace); reads return snapshots or iterators; the agent reasons about collection invariants on the owner alone.

  • encapsulate-composite-with-builder

    Apply Encapsulate Composite With Builder when you see Long Function, Hide Delegate, Extract Class. A construction site that reads as a tree literal the agent parses structurally in one pass.

  • encapsulate-record

    Apply Encapsulate Record when you see Data Class, Primitive Obsession. The record is a class with accessors; the agent reasons about its shape, invariants, and behavior in one definition.

  • encapsulate-variable

    Apply Encapsulate Variable when you see Global Data, Mutable Data. All access goes through a small named function the agent can grep for, audit, and instrument as a single closed surface.

  • extract-adapter

    Apply Extract Adapter when you see Divergent Change, Extract Class, Replace Conditional with Polymorphism. One adapter file per variant; the agent verifies each adapter independently against the external API.

  • extract-class

    Apply Extract Class when you see Data Clumps, Temporary Field, Large Class, Primitive Obsession. Each type has one purpose; the agent loads a small focused file to reason about any single concept.

  • extract-composite

    Apply Extract Composite when you see Duplicated Code, Extract Superclass, Pull Up Method. One Composite superclass the agent reads once and trusts thereafter.

  • extract-function

    Apply Extract Function when you see Long Function, Duplicated Code, Comments. Each function is a verifiable unit small enough that the agent reasons about its full behavior in a single reasoning step.

  • extract-parameter

    Apply Extract Parameter when you see Duplicated Code, Parameterize Function, Extract Function. One method the agent reads once; callers supply the varying value at the call site.

  • extract-superclass

    Apply Extract Superclass when you see Duplicated Code, Alternative Classes with Different Interfaces. Shared structure lives on the parent with one declaration; queries about either subclass load the parent's contract once instead of paying the cost of loading N near-identical subclass declarations.

  • extract-variable

    Apply Extract Variable when you see Mysterious Name, Comments. Intermediate values carry domain names; subsequent reads resolve to one token of name instead of re-evaluating the expression at every use.

  • facade

    Apply Facade when you see Message Chains, Insider Trading, Hide Delegate. One Facade method the agent reads end-to-end to understand the full choreography.

  • factory-method

    Apply Factory Method when you see Repeated Switches, Replace Conditional with Polymorphism, Replace Type Code with Subclasses. Structural completeness via the type system; every subclass of the creator implements the factory method, so missing-variant bugs surface as construction-time errors the age

  • feature-envy

    Refuse Feature Envy when a method's body references foreign-class data more than its own; the agent loading this method also loads the foreign class to verify any change. Apply Move Function, Extract Function.

  • flyweight

    Apply Flyweight when you see Duplicated Code, Large Class, Extract Class. A structural separation between kind-shared data (TreeType) and per-instance data (Tree).

  • form-template-method

    Apply Form Template Method when you see Duplicated Code, Pull Up Method, Extract Function. One template body the agent reads to know the algorithm; primitives are short, locally readable, individually verifiable.

  • global-data

    Refuse Global Data when a module-level variable mutated from anywhere — the agent reading any single call site cannot bound its impact without paying completeness-check cost across every consumer. Apply Encapsulate Variable.

  • hide-delegate

    Apply Hide Delegate when you see Message Chains. Callers reach for the wrapper's methods directly; the agent reads one type signature instead of walking the delegate chain to predict what the call returns.

  • inline-class

    Apply Inline Class when you see Lazy Element, Speculative Generality. The class folds into its primary collaborator; the agent loads one file for what was two.

  • inline-function

    Apply Inline Function when you see Lazy Element, Speculative Generality. Trivial wrappers disappear from the agent's working context; call sites read as exactly what's happening.

  • inline-singleton

    Apply Inline Singleton when you see Global Data, Inline Function, Remove Dead Code. Constructor signatures carry every dependency the class uses; the agent reads one signature to enumerate what the class touches instead of grepping for static accessor calls across the codebase.

  • inline-variable

    Apply Inline Variable when you see Lazy Element. Expressions sit at their use sites without an intervening binding; the agent reads the expression once instead of reading the variable name plus the binding's definition.

  • insider-trading

    Refuse Insider Trading when module A reaches into module B's private fields or undocumented behavior; the agent reasoning about A must also load B's internals to make any change. Apply Move Function, Move Field.

  • interpreter

    Apply Interpreter when you see Primitive Obsession, Repeated Switches, Replace Conditional with Polymorphism. One class per grammar rule, each with interpret(env).

  • introduce-assertion

    Apply Introduce Assertion when you see Comments, Mutable Data. Invariants live in code as runtime checks; the agent reads the assertion as a typed constraint that downstream code can take as a precondition without re-deriving it from caller context.

  • introduce-null-object

    Apply Introduce Null Object when you see Repeated Switches, Introduce Special Case, Replace Conditional with Polymorphism. One Null Object class the agent verifies once; all call sites unconditionally invoke the collaborator interface.

  • introduce-parameter-object

    Apply Introduce Parameter Object when you see Long Parameter List, Data Clumps. The clump becomes a named value object the agent passes through as a single token; structure validation happens once at construction.

  • introduce-polymorphic-creation-with-factory-method

    Apply Introduce Polymorphic Creation With Factory Method when you see Repeated Switches, Replace Conditional with Polymorphism, Replace Constructor with Factory Function. Each subclass's Factory Method is locally verifiable; the base algorithm has no construction-conditional for the agent to load.

  • introduce-special-case

    Apply Introduce Special Case when you see Repeated Switches, Comments. The special case responds to the same interface as the real case; the agent reasons without branching at every call site.

  • iterator

    Apply Iterator when you see Insider Trading, Message Chains, Encapsulate Collection. One iterator protocol the agent reads to understand traversal semantics.

  • large-class

    Refuse Large Class when a type definition — class or interface — with so many fields and methods that the agent cannot load it as a coherent unit; multiple unrelated responsibilities sit under one name. Apply Extract Class, Extract Superclass.

  • lazy-element

    Refuse Lazy Element when a class, function, or namespace whose body the agent traces through only to find no decisions or transformations — every hop is pure overhead in reasoning context. Apply Inline Function, Inline Class.

  • limit-instantiation-with-singleton

    Apply Limit Instantiation With Singleton when you see Mutable Data, Encapsulate Variable, Replace Constructor with Factory Function. One static accessor the agent verifies once; all references resolve to the same identity.

  • long-function

    Refuse Long Function when the function's body has more tokens than the agent can hold in one reasoning step; verifying behavior preservation means re-reading the entire body on every edit. Apply Extract Function, Replace Temp with Query.

  • long-parameter-list

    Refuse Long Parameter List when a signature with so many positional parameters that the agent has to read the function definition into the context window before generating each invocation. Apply Replace Parameter with Query, Preserve Whole Object.

  • loops

    Refuse Loops when imperative for/while loops where filter, map, and reduce concerns are mixed by hand; the agent cannot tell what the loop is producing without mentally executing it. Apply Replace Loop with Pipeline.

  • mediator

    Apply Mediator when you see Insider Trading, Shotgun Surgery, Move Function. One Mediator the agent reads to understand all relationships.

  • memento

    Apply Memento when you see Insider Trading, Mutable Data, Extract Class. One save / restore pair the agent reads inside the editor class.

  • message-chains

    Refuse Message Chains when long dotted access paths the agent must trace through several object hops to understand any single read; renaming any intermediate field breaks every caller silently. Apply Hide Delegate, Extract Function.

  • middle-man

    Refuse Middle Man when a class whose methods all delegate straight through to another object — the agent traces every call to the real implementation, paying a hop for no decision. Apply Remove Middle Man, Inline Function.

  • move-accumulation-to-collecting-parameter

    Apply Move Accumulation To Collecting Parameter when you see Duplicated Code, Parameterize Function, Substitute Algorithm. One collecting parameter the agent reads as a single mutable accumulator; recursion bodies become small and locally verifiable.

  • move-accumulation-to-visitor

    Apply Move Accumulation To Visitor when you see Divergent Change, Extract Class, Move Function. One file per operation; the agent verifies a Visitor against its declared interface in isolation.

  • move-creation-knowledge-to-factory

    Apply Move Creation Knowledge To Factory when you see Long Function, Extract Class, Move Function. One factory file the agent reads as the construction contract; callers are short delegations the agent treats opaquely.

  • move-embellishment-to-decorator

    Apply Move Embellishment To Decorator when you see Long Parameter List, Extract Class, Replace Subclass with Delegate. One file per behaviour the agent reads in isolation; the core class is short and verifiable on its own.

  • move-field

    Apply Move Field when you see Shotgun Surgery, Insider Trading. Each field lives in the class that determines its value; reading the field and reading the data that determines it happen in the same class file.

  • move-function

    Apply Move Function when you see Feature Envy, Shotgun Surgery, Insider Trading, Divergent Change. Each function lives where its data lives; the agent loads one class to reason about one behavior.

  • move-statements-into-function

    Apply Move Statements into Function when you see Duplicated Code. The function owns its setup and follow-up; the agent verifies behavior at the function definition instead of auditing every call site.

  • move-statements-to-callers

    Apply Move Statements to Callers when you see Divergent Change. The function's body addresses one responsibility; callers express their differences at the call site.

  • mutable-data

    Refuse Mutable Data when fields the agent finds reassigned across multiple files with no obvious owner; reasoning about state at any moment requires completeness-check cost across every writer. Apply Encapsulate Variable, Split Variable.

  • mysterious-name

    Refuse Mysterious Name when names that don't disambiguate scope or domain force the agent to read more code into the context window just to know what a variable holds before each reasoning step. Apply Change Function Declaration, Rename Variable.

  • observer

    Apply Observer when you see Shotgun Surgery, Divergent Change, Hide Delegate. One subscribe/notify protocol the agent reads once per subject.

  • parameterize-function

    Apply Parameterize Function when you see Duplicated Code. One canonical function with a parameter; the agent reasons about one body and verifies parameter values at call sites.

  • preserve-whole-object

    Apply Preserve Whole Object when you see Long Parameter List, Data Clumps. The function takes the object; the agent updates one place when the function needs new fields.

  • primitive-obsession

    Refuse Primitive Obsession when function signatures use raw strings and numbers where domain concepts hide; the agent cannot tell from the type whether an argument is the right kind of thing. Apply Replace Primitive with Object, Replace Type Code with Subclasses.

  • prototype
  • proxy
  • pull-up-constructor-body
  • pull-up-field
  • pull-up-method
  • push-down-field
  • push-down-method
  • refused-bequest
  • remove-dead-code
  • remove-flag-argument
  • remove-middle-man
  • remove-setting-method
  • remove-subclass
  • rename-field
  • rename-variable
  • repeated-switches
  • replace-command-with-function
  • replace-conditional-dispatcher-with-command
  • replace-conditional-logic-with-strategy
  • replace-conditional-with-polymorphism
  • replace-constructor-with-factory-function
  • replace-constructors-with-creation-methods
  • replace-control-flag-with-break
  • replace-derived-variable-with-query
  • replace-error-code-with-exception
  • replace-exception-with-precheck
  • replace-function-with-command
  • replace-hard-coded-notifications-with-observer
  • replace-implicit-language-with-interpreter
  • replace-implicit-tree-with-composite
  • replace-inline-code-with-function-call
  • replace-loop-with-pipeline
  • replace-magic-literal
  • replace-nested-conditional-with-guard-clauses
  • replace-onemany-distinctions-with-composite
  • replace-parameter-with-query
  • replace-primitive-with-object
  • replace-query-with-parameter
  • replace-state-altering-conditionals-with-state
  • replace-subclass-with-delegate
  • replace-superclass-with-delegate
  • replace-temp-with-query
  • replace-type-code-with-class
  • replace-type-code-with-subclasses
  • return-modified-value
  • separate-query-from-modifier
  • shotgun-surgery
  • singleton
  • slide-statements
  • speculative-generality
  • split-loop
  • split-phase
  • split-variable
  • state
  • strategy
  • substitute-algorithm
  • template-method
  • temporary-field
  • unify-interfaces-with-adapter
  • unify-interfaces
  • visitor
View source on GitHub refactorplug.com

Similar plugins

superpowers

claudecodex

Core skills library for Claude Code: TDD, debugging, collaboration patterns, and proven techniques

15 skills · hooks

obra/superpowers 316,836

context7

claudecodex

Up-to-date documentation lookup. Pull version-specific documentation and code examples directly from source repositories into your coding agent's context.

1 MCP server

upstash/context7 64,709

Build powerful, stateful CLI interfaces for any GUI application using the cli-anything harness methodology.

5 commands

HKUDS/CLI-Anything 58,665

Automates browser interactions for web testing, form filling, screenshots, and data extraction

12 skills

vercel-labs/agent-browser 50,373

Use Alibaba Open Code Review from local Codex.

2 skills

alibaba/open-code-review 50,068

slidev

claude

Claude Code skill for creating and presenting Slidev slidedecks

1 skill

slidevjs/slidev 49,452

Maintain refactor?

This page updates itself from your repo. Add the badge to your README, or get it Featured to pin it above the organic results with a followed link to your site.

claude & codex pluginslisted