/ruby-rails:rubocopfrom ruby-rails
Analyzes and formats Ruby code using RuboCop, enforcing style guidelines, detecting bugs, and applying autocorrections. Supports Rails, RSpec, and Performance extensions.
Ships in ruby-rails. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
RuboCop is Ruby's premier static code analyzer (linter) and formatter, based on the community-driven Ruby Style Guide. This skill enables comprehensive code analysis, automatic formatting, and enforcement of coding standards across Ruby projects including Rails applications.
Claude automatically uses this skill when users:
Code Analysis & Linting
Automatic Code Correction
-a) for guaranteed-safe fixes-A) for broader but riskier corrections-x) for formatting without logic changesConfiguration & Customization
.rubocop.yml configurationExtension Integration
# Analyze current directory
rubocop
# Analyze specific files/directories
rubocop app spec lib/important_file.rb
# Show only correctable offenses
rubocop --display-only-correctable
# Safe autocorrection only (recommended)
rubocop -a
# All corrections including unsafe
rubocop -A
# Layout/formatting corrections only
rubocop -x
# Autocorrect specific cops
rubocop -a --only Style/StringLiterals,Layout/TrailingWhitespace
# Run only specific cops
rubocop --only Style/StringLiterals,Naming/MethodName
# Run all cops except specified
rubocop --except Metrics/MethodLength
# Run only lint cops
rubocop --lint
# Check only Rails-specific issues
rubocop --only Rails
# Enable extensions
plugins:
- rubocop-rails
- rubocop-rspec
- rubocop-performance
AllCops:
TargetRubyVersion: 3.2
NewCops: enable # Auto-enable new cops
Exclude:
- 'db/schema.rb'
- 'vendor/**/*'
- 'node_modules/**/*'
# Adjust specific cops
Style/StringLiterals:
EnforcedStyle: double_quotes
Metrics/MethodLength:
Max: 15
Exclude:
- 'spec/**/*'
Inherit from shared config:
inherit_from:
- .rubocop_todo.yml
- config/rubocop_defaults.yml
Rails-specific settings:
Rails:
Enabled: true
Rails/ApplicationRecord:
Enabled: true
Exclude:
- 'db/migrate/**'
RSpec configuration:
RSpec/ExampleLength:
Max: 10
RSpec/MultipleExpectations:
Max: 3
app/models/user.rb:15:3: C: Style/StringLiterals: Prefer single-quoted strings...
name = "John Doe"
^^^^^^^^^^
Format breakdown:
app/models/user.rb:15:3 - File path, line number, column numberC: - Severity (C=Convention, W=Warning, E=Error, F=Fatal)Style/StringLiterals - Cop department and name# Generate initial configuration
rubocop --init
# Generate .rubocop_todo.yml for existing violations
rubocop --auto-gen-config
# Use todo file to gradually fix issues
# .rubocop.yml:
inherit_from: .rubocop_todo.yml
# Check staged files only
git diff --name-only --cached | grep '\.rb$' | xargs rubocop
# With autocorrection
git diff --name-only --cached | grep '\.rb$' | xargs rubocop -a
# Exit with error code if offenses found
rubocop --format progress --fail-level warning
# Generate formatted reports
rubocop --format json --out rubocop-report.json
rubocop --format html --out rubocop-report.html
# Use all available CPUs (enabled by default)
rubocop --parallel
# Limit CPU usage
PARALLEL_PROCESSOR_COUNT=2 rubocop
Detects Rails-specific issues:
Enforces RSpec best practices:
Identifies performance optimizations:
"Unknown cop" errors:
rubocop-rails, rubocop-rspec, etc.).rubocop.yml: plugins: [rubocop-rails]Autocorrection not working:
-A for unsafe correctionsPerformance issues:
--parallel for faster executionUseCache: true under AllCops in configWhat SKILL.md sets; muted values are Claude Code's defaults
13 skills in this plugin
/brakemanStatic analysis security vulnerability scanner for Ruby on Rails applications. Use when analyzing Rails code for security issues, running security audits, reviewing code for vulnerabilities, setting up security scanning in CI/CD, managing security warnings, or investigating specific vulnerability types (SQL injection, XSS, command injection, etc.). Also use when configuring Brakeman, reducing false positives, or integrating with automated workflows./cucumber-gherkinBDD testing with Cucumber and Gherkin for Ruby and Rails applications. Use when writing feature files (.feature), step definitions, hooks, or implementing Behaviour-Driven Development in Ruby/Rails projects. Covers Gherkin keywords (Feature, Scenario, Given/When/Then, Background, Scenario Outline, Rule), Ruby step definition patterns, Cucumber Expressions, hooks (Before/After/BeforeAll/AfterAll), tags, data tables, doc strings, World modules, and Capybara integration. Triggers on cucumber, gherkin, BDD, feature files, step definitions, acceptance testing, executable specifications./design-patterns-rubyComprehensive Ruby implementations of Gang of Four (GoF) design patterns. Use when implementing object-oriented design solutions, refactoring to reduce coupling, solving architecture problems, or when user mentions specific patterns (Factory, Singleton, Observer, Strategy, etc.) in Ruby context.npx claudepluginhub el-feo/ai-context --plugin ruby-railsOther plugins' skills for the same job