---
name: "rubocop-ruby-style-and-lint"
description: "Enforce community Ruby and Rails style guides and eliminate performance anti-patterns."
metadata:
  author: "Bozhidar Batsov"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "run rubocop autocorrect"
  - "configure .rubocop.yml"
  - "generate rubocop todo"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# RuboCop Ruby Static Code Analyzer & Style Enforcer

Configures RuboCop: writing .rubocop.yml, configuring departments (Layout, Lint, Metrics, Performance, Rails), running automated auto-corrections (rubocop -a / -A), and managing legacy codebases with .rubocop_todo.yml.

## When to Invoke
Invoke this skill whenever you need to:
- run rubocop autocorrect
- configure .rubocop.yml
- generate rubocop todo

## Execution SOP & Rules
1. Create .rubocop.yml requiring 'rubocop-rails' and 'rubocop-performance'.
2. Generate baseline todo: bundle exec rubocop --auto-gen-config.
3. Run safe auto-corrections: bundle exec rubocop -a.
4. Integrate into CI workflow ensuring bundle exec rubocop exits with status code 0.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
