Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

ruby-refactor

FreeNo executable scriptsNot checked

Ruby refactoring guidelines from community best practices. This skill should be used when refactoring, reviewing, or restructuring Ruby code to improve…

pproencaby pproenca★ 231 GitHub stars

About this skill

Community Ruby Refactoring Best Practices

Comprehensive refactoring guide for Ruby applications, maintained by the community. Contains 45 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.

When to Apply

Reference these guidelines when:

  • Refactoring Ruby code to reduce complexity and improve design
  • Extracting methods, classes, or value objects from large units
  • Simplifying complex conditionals and deep nesting
  • Reducing coupling between classes and modules
  • Adopting idiomatic Ruby patterns and modern Ruby 3.x features

Rule Categories by Priority

Priority Category Impact Prefix
1 Structure & Decomposition CRITICAL struct-
2 Conditional Simplification CRITICAL cond-
3 Coupling & Dependencies HIGH couple-
4 Ruby Idioms HIGH idiom-
5 Data & Value Objects MEDIUM-HIGH data-
6 Design Patterns MEDIUM pattern-
7 Modern Ruby 3.x MEDIUM modern-
8 Naming & Readability LOW-MEDIUM name-

Quick Reference

1. Structure & Decomposition (CRITICAL)

2. Conditional Simplification (CRITICAL)

3. Coupling & Dependencies (HIGH)

4. Ruby Idioms (HIGH)

5. Data & Value Objects (MEDIUM-HIGH)

6. Design Patterns (MEDIUM)

Full SKILL.md on GitHub

Install ruby-refactor in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

AGENTS.mdREADME.mdassets/templates/_template.mdmetadata.jsonreferences/_sections.mdreferences/cond-consolidate-duplicates.mdreferences/cond-decompose-conditional.mdreferences/cond-guard-clauses.mdreferences/cond-null-object.mdreferences/cond-pattern-matching.mdreferences/cond-replace-with-polymorphism.mdreferences/couple-avoid-class-methods-domain.mdreferences/couple-composition-over-inheritance.mdreferences/couple-dependency-injection.mdreferences/couple-feature-envy.mdreferences/couple-law-of-demeter.mdreferences/couple-tell-dont-ask.mdreferences/data-define-immutable.mdreferences/data-encapsulate-collection.mdreferences/data-replace-data-clump.mdreferences/data-separate-query-command.mdreferences/data-value-object.mdreferences/idiom-block-yield.mdreferences/idiom-duck-typing.mdreferences/idiom-implicit-return.mdreferences/idiom-keyword-arguments.mdreferences/idiom-predicate-methods.mdreferences/idiom-prefer-enumerable.mdreferences/idiom-respond-to-missing.mdreferences/modern-deconstruct-keys.mdreferences/modern-endless-methods.mdreferences/modern-hash-pattern-guard.mdreferences/modern-pattern-matching.mdreferences/modern-rightward-assignment.mdreferences/name-avoid-abbreviations.mdreferences/name-consistent-vocabulary.mdreferences/name-intention-revealing.mdreferences/name-rename-to-remove-comments.mdreferences/pattern-decorator.mdreferences/pattern-factory.md

FAQ

What does the ruby-refactor skill do?

Ruby refactoring guidelines from community best practices. This skill should be used when refactoring, reviewing, or restructuring Ruby code to improve design, readability, and maintainability. Triggers on tasks involving code smells, method extraction, conditional simplification, coupling reduction, design patterns, or Ruby idiom adoption.

How do I install the ruby-refactor skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the ruby-refactor skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare ruby-refactor with