rubocop-and-code-quality

rubocop-and-code-quality is a skill for Claude Code, Codex from sandeepmvl/rails-skills. It costs 171 tokens per session (3,141 once invoked), scanned A, original, MIT.

A guide to keeping Rails code consistently formatted, structured, and tested with tools such as RuboCop, SimpleCov, and ERB Lint. It also covers optional tools for checking Ruby types.

In plain words
What is it for?
Use it to configure Rails-aware RuboCop rules, check Ruby and ERB files, run checks in parallel in CI, measure line and branch coverage, and decide when optional type checking is worthwhile.
Why use it?
It catches style problems, risky patterns, template errors, and insufficient test coverage before they reach the main codebase. It provides rules for automatically fixing safe issues without hiding them by disabling checks.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to configure Rails-aware RuboCop rules, check Ruby and ERB files, run checks in parallel in CI, measure line and branch coverage, and decide when optional type checking is worthwhile.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sandeepmvl/rails-skills/58-rubocop-and-code-quality
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add sandeepmvl/rails-skills --skill 58-rubocop-and-code-quality
Clone the repo
git clone --depth 1 https://github.com/sandeepmvl/rails-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rubocop-and-code-quality

README.md
[![agentmods](https://agentmods.dev/badge/skills/sandeepmvl/rails-skills/58-rubocop-and-code-quality/github.svg)](https://agentmods.dev/skills/sandeepmvl/rails-skills/58-rubocop-and-code-quality)
Your own site
<a href="https://agentmods.dev/skills/sandeepmvl/rails-skills/58-rubocop-and-code-quality"><img src="https://agentmods.dev/badge/skills/sandeepmvl/rails-skills/58-rubocop-and-code-quality/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rubocop-and-code-quality

Your own site · 80×15
<a href="https://agentmods.dev/skills/sandeepmvl/rails-skills/58-rubocop-and-code-quality"><img src="https://agentmods.dev/badge/skills/sandeepmvl/rails-skills/58-rubocop-and-code-quality.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 171 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,141 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00171 $0.03141
Opus 5 $0.00086 $0.01571
Sonnet 5 $0.00034 $0.00628
Haiku 4.5 $0.00017 $0.00314

Measured 11d ago against content hash d9eecaba2c7f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

rubocop-and-code-quality scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/58-rubocop-and-code-quality/SKILL.md · 333 lines

How it starts

The opening of the file, as written. The whole thing — 333 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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:

# Gemfile (Rails 8 default — already present)
gem "rubocop-rails-omakase", require: false
# .rubocop.yml (Rails 8 default)
inherit_gem:
  rubocop-rails-omakase: rubocop.yml

That's the whole baseline. omakase enables ~120 cops aligned with the Rails core team's style. Run:

bundle exec rubocop                 # report
bundle exec rubocop -a              # safe autocorrect
bundle exec rubocop -A              # unsafe autocorrect — review diff carefully
bundle exec rubocop --parallel      # CI mode
bundle exec rubocop -l              # lint cops only

Pattern 2: Adding extensions

Read the full file on GitHub · 333 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 333 lines · 171 tokens per session scan A d9eecaba2c7f

Subscribe to this mod's changes

rubocop-and-code-quality is a skill published in the GitHub repository sandeepmvl/rails-skills (21 stars, last pushed 3mo ago), licensed MIT. It adds 171 tokens to every session and 3,141 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

simplify

Simplifies and refines Ruby on Rails code following 37signals patterns and the One Person Framework philosophy, while preserving exact functionality. Focuses on recently modified code unless instructed otherwise. Use this skill when simplifying or refactoring Rails code, reviewing recently written Rails code for…

maquina-app/rails-claude-code · 123 tokens

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…

pproenca/dot-skills · 65 tokens

sgcop-setup

A setup guide for adding the sgcop Ruby and Rails code-checking rules to a project. RuboCop is a tool that finds style and quality problems in Ruby code.

SonicGarden/sgcop · 169 tokens

gem-docs-review

Harvests offline documentation (README, CHANGELOG, public API) for every gem in a Ruby/Rails project's Gemfile.lock into a local cache, tracks gem versions in a manifest, and refreshes only gems whose version changed. Then reviews a git diff or pull request against that cache to surface (a) gem-upgrade impact …

VSN2015/concerns_on_rails · 152 tokens

apply-code-conventions

Use when applying daily Rails conventions by path (DRY, YAGNI, PORO, CoC, KISS). Style defers to the project linter. Trigger words: conventions, clean code, RuboCop, DRY, YAGNI.

igmarin/rails-agent-skills · 58 tokens

code-review

Use when reviewing a Rails PR, diff, or merge request. Ground findings in a real file:line. Trigger words: review PR, code review, review my diff, CR.

igmarin/rails-agent-skills · 40 tokens