rubocop-and-code-quality
RuboCop + Code Quality
AI agents generate Ruby code that RuboCop hates: unfrozen string literals, long methods, wrong constant style. Then they disable the cops instead of fixing the code. This skill sets up RuboCop the way Rails core does it (omakase preset + extensions), wires it into CI, and gives the autocorrect-first workflow.
The opinion
Use
rubocop-rails-omakaseas the base preset — it ships with Rails 8 and reflects DHH's defaults. Layerrubocop-rails,rubocop-performance,rubocop-rspec,rubocop-thread_safetyonly when you need cops beyond omakase. Runrubocop -a(safe autocorrect) on every PR;-A(all autocorrect including unsafe) only in dedicated cleanup PRs. Gate CI onrubocop --parallel. Coverage via SimpleCov with branch coverage + 80% line threshold. erb_lint for ERB templates. RBS for type checking only on stable domains; skip Sorbet unless you have a strong reason.
Counter-positions:
- Standardrb / Standard — single-config zero-bikeshed alternative. Smaller team consensus, but less Rails-aware than rubocop-rails-omakase. Pick one or the other, not both.
- Sorbet — Stripe-grade. Heavy ceremony. Worth it for very large codebases (50k+ LOC, 50+ engineers). Most Rails apps don't need it.
Pattern 1: RuboCop setup (Rails 8 default)
Rails 8 generates .rubocop.yml referencing rubocop-rails-omakase automatically: