Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

RuboCop

$ rubocop Community Low Risk
RuboCop · Code & DevOps · MIT · macos / linux / windows

The standard Ruby and Rails static analyzer, linter, and code formatter enforcing community style, lint, security, and metrics cops. Emits structured --format json reports and distinguishes safe --autocorrect (-a) from aggressive --autocorrect-all (-A).

FCRS-1.0 Score
85 /100
Good
Medium Confidence
Zero-Friction Install
brew install rubocop
CLI vs MCP Decision CLI Only

Analyzes and formats local Ruby files directly; CLI execution is standard and fast with --server.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 22 / 25

Supports --format json, --no-color, --only cop filtering, --fail-level, and --server daemon acceleration.

  • --format json emits clean JSON payloads
  • --only and --except filter cops precisely
Trust & Safety 21 / 25

Read-only by default and separates safe --autocorrect from unsafe --autocorrect-all, though lacks a dry-run diff mode.

  • Safe -a vs unsafe -A autocorrection boundary
Setup & Portability 12 / 15

Installable via Homebrew or gem install rubocop / Bundler, requiring a Ruby runtime.

  • Requires Ruby runtime and project Gemfile plugins (e.g. rubocop-rails)
Utility & Efficiency 13 / 15

Unifies Ruby linting and formatting with rich Rails/RSpec extensions and --server caching.

  • Covers style, lint, security, and metrics in one CLI
Maintenance & Lineage 9 / 10

Standard Ruby ecosystem tool (rubocop/rubocop) actively maintained under MIT license.

  • Canonical rubocop/rubocop repository
Docs & Verifiability 8 / 10

Well-structured Antora documentation covering CLI options and every cop.

  • Official docs at docs.rubocop.org

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

Offline local Ruby static analyzer; no credentials stored or required.

Side Effects
Read-Only Local Write
Cost & Quotas

MIT open-source Ruby gem/CLI; completely free.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# RuboCop (rubocop) Agent Rules
- Always pass `--format json --no-color` when inspecting Ruby offenses.
- Prefer `--autocorrect` (`-a`) over `--autocorrect-all` (`-A`), which can rewrite semantics.

Agent-Ready Command Recipes

Safe Read-Only Queries

Run RuboCop with JSON diagnostics
rubocop --format json --no-color

Outputs complete per-file offenses, line/column locations, cop names, and severity in JSON.

Controlled Writes & Previews

Apply safe RuboCop autocorrections
rubocop --autocorrect --format json app/

Applies only safe autocorrections (-a) to app/ and outputs remaining offenses as JSON.

Strengths for Agents

  • + Built-in --format json --no-color returns structured cop names, severities, and exact spans.
  • + Separates safe --autocorrect (-a) from potentially unsafe --autocorrect-all (-A).

Caveats & Pitfalls

  • ! Projects using rubocop-rails or rubocop-rspec should run via bundle exec rubocop rather than global binary.
  • ! No --dry-run diff preview flag before -a writes files.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI