Goal: readable, well-factored Ruby that reads like intent.
Use for:
- new Ruby code, scripts, or Rails-adjacent logic
- reviewing object design, naming, and method length
- untangling long methods or god objects
Workflow:
- Keep methods short and named for what they do.
- Favor small objects with single responsibilities.
- Use enumerable methods (map, select, reduce) over manual loops.
- Raise specific exceptions; rescue narrowly.
- Prefer immutable data and frozen constants where sensible.
- Verify with RSpec/Minitest and RuboCop.
Idioms:
- blocks and yield for iteration and resource handling
- keyword arguments for clear call sites
- guard clauses over nested conditionals
- duck typing with clear method contracts
Rules:
- rescue specific errors, never bare rescue
- keep methods small; extract when they grow
- avoid metaprogramming unless it clearly pays off
- name things for behavior, not implementation