rubocop-and-code-quality

Installation
SKILL.md

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-omakase as the base preset — it ships with Rails 8 and reflects DHH's defaults. Layer rubocop-rails, rubocop-performance, rubocop-rspec, rubocop-thread_safety only when you need cops beyond omakase. Run rubocop -a (safe autocorrect) on every PR; -A (all autocorrect including unsafe) only in dedicated cleanup PRs. Gate CI on rubocop --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:

Installs
1
GitHub Stars
21
First Seen
Sep 8, 2026
rubocop-and-code-quality — sandeepmvl/rails-skills