Individual skill
ruby-refactor
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.
skills/.curated/ruby-refactor/SKILL.md
Source commit cf93c57cac89d6fc3e4194686000411567f5caf3
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- No
- Repository scan complete
- No
- Skill scan complete
- Yes
- Observed behavior
- Not checked yet
- Last checked
- Nov 5, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 222
- Repository last updated
- Aug 15, 2026
- License
- MIT
Observed agent integration: codex
- engineering Derived category
- design Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
AGENTS.mddoc · 9,249 bytesREADME.mddoc · 4,569 bytesSKILL.mdcore · 7,569 bytesassets/templates/_template.mddoc · 590 bytesmetadata.jsonasset · 1,106 bytesreferences/_sections.mddoc · 2,090 bytesreferences/cond-consolidate-duplicates.mddoc · 2,270 bytesreferences/cond-decompose-conditional.mddoc · 1,727 bytesreferences/cond-guard-clauses.mddoc · 1,926 bytesreferences/cond-null-object.mddoc · 1,946 bytesreferences/cond-pattern-matching.mddoc · 2,225 bytesreferences/cond-replace-with-polymorphism.mddoc · 2,703 bytesreferences/couple-avoid-class-methods-domain.mddoc · 1,797 bytesreferences/couple-composition-over-inheritance.mddoc · 2,006 bytesreferences/couple-dependency-injection.mddoc · 1,582 bytesreferences/couple-feature-envy.mddoc · 1,571 bytesreferences/couple-law-of-demeter.mddoc · 1,668 bytesreferences/couple-tell-dont-ask.mddoc · 1,479 bytesreferences/data-define-immutable.mddoc · 2,129 bytesreferences/data-encapsulate-collection.mddoc · 1,931 bytesreferences/data-replace-data-clump.mddoc · 2,351 bytesreferences/data-separate-query-command.mddoc · 2,066 bytesreferences/data-value-object.mddoc · 2,385 bytesreferences/idiom-block-yield.mddoc · 1,576 bytesreferences/idiom-duck-typing.mddoc · 1,773 bytesreferences/idiom-implicit-return.mddoc · 1,878 bytesreferences/idiom-keyword-arguments.mddoc · 1,358 bytesreferences/idiom-predicate-methods.mddoc · 1,382 bytesreferences/idiom-prefer-enumerable.mddoc · 1,542 bytesreferences/idiom-respond-to-missing.mddoc · 1,808 bytesreferences/modern-deconstruct-keys.mddoc · 2,294 bytesreferences/modern-endless-methods.mddoc · 1,662 bytesreferences/modern-hash-pattern-guard.mddoc · 2,183 bytesreferences/modern-pattern-matching.mddoc · 1,799 bytesreferences/modern-rightward-assignment.mddoc · 2,076 bytesreferences/name-avoid-abbreviations.mddoc · 2,176 bytesreferences/name-consistent-vocabulary.mddoc · 1,851 bytesreferences/name-intention-revealing.mddoc · 1,666 bytesreferences/name-rename-to-remove-comments.mddoc · 1,516 bytesreferences/pattern-decorator.mddoc · 2,268 bytesreferences/pattern-factory.mddoc · 1,806 bytesreferences/pattern-null-object-protocol.mddoc · 2,194 bytesreferences/pattern-strategy.mddoc · 2,237 bytesreferences/pattern-template-method.mddoc · 2,682 bytesreferences/struct-compose-method.mddoc · 3,067 bytesreferences/struct-extract-class.mddoc · 2,134 bytesreferences/struct-extract-method.mddoc · 3,221 bytesreferences/struct-flatten-deep-nesting.mddoc · 3,010 bytesreferences/struct-parameter-object.mddoc · 3,148 bytesreferences/struct-replace-method-with-object.mddoc · 3,253 bytesreferences/struct-single-responsibility.mddoc · 2,703 bytes
Read excerpt
# 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