Ruby refactor

From pproenca/dot-skills · View interactive version

Ruby refactor is an AI agent skill from the GitHub repository pproenca/dot-skills. 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

How to use this skill

Skill file

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:

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)

7. Modern Ruby 3.x (MEDIUM)

8. Naming & Readability (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Reference Files

| File | Description |

|------|-------------|

| references/_sections.md | Category definitions and ordering |

| assets/templates/_template.md | Template for new rules |

| metadata.json | Version and reference information |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.