fix-rubocop

Fix RuboCop offenses in Ruby projects with safe autocorrects and test validation.

2|Updated Aug 16, 2011
One-click install
npx skills add https://github.com/sakuro/dotfiles --skill fix-rubocop
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fix-rubocop
Source: https://github.com/sakuro/dotfiles/tree/main/.config/claude/skills/fix-rubocop
Command: npx skills add https://github.com/sakuro/dotfiles --skill fix-rubocop

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires rubocop, rake, docquet.

What problem does it solve?

This Skill systematically resolves RuboCop offenses in Ruby projects, significantly reducing manual linting effort and ensuring consistent code style compliance across your codebase. It helps clean up .rubocop_todo.yml and maintain high code quality.

Core Features & Use Cases

  • Automated Correction: Applies safe and targeted autocorrects for various RuboCop cops, minimizing behavioral changes.
  • Structured Workflow: Provides a clear, step-by-step process for identifying, fixing, and verifying linting issues, including test verification.
  • Configuration Management: Guides on safely updating .rubocop.yml and regenerating .rubocop_todo.yml to reflect fixes and new configurations.
  • Use Case: A Ruby developer has a codebase with many RuboCop warnings and a growing .rubocop_todo.yml. This skill helps them systematically tackle these offenses, starting with safe autocorrects and verifying changes with tests, ultimately cleaning up the codebase and reducing technical debt.

Quick Start

Use the fix-rubocop skill to fix all Style/StringLiterals offenses in the lib/ directory, then run tests to verify.

Frequently Asked Questions about fix-rubocop

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automatically fix RuboCop offenses in my Ruby project?

RuboCop offenses can be automatically fixed using safe autocorrect rules that apply targeted corrections without changing code behavior. Apply autocorrects to specific cops or directories, then verify changes with tests before regenerating your .rubocop_todo.yml to reflect the fixes.

What's the best way to clean up a large .rubocop_todo.yml file?

Systematically resolve RuboCop offenses by applying safe autocorrects, centralizing rule changes in .rubocop.yml, and avoiding inline disables. Once fixes are validated with tests, regenerate .rubocop_todo.yml to remove resolved offenses and reduce technical debt.

Can I fix specific RuboCop style violations like StringLiterals without affecting my whole codebase?

Yes, RuboCop autocorrects can target specific cops and directories. Apply corrections to individual rules or paths, run your test suite to validate changes haven't introduced bugs, then update .rubocop_todo.yml to track remaining violations.

Do I need to manually update .rubocop.yml when fixing style offenses?

Centralizing rule changes in .rubocop.yml is the recommended approach rather than using inline disables. After applying autocorrects and verifying with tests, regenerate .rubocop_todo.yml to align with your updated configuration.

Why should I run tests after applying RuboCop autocorrects?

Testing validates that autocorrected code maintains intended behavior and hasn't introduced regressions. This verification step is essential before regenerating .rubocop_todo.yml to ensure fixes are safe and complete.

What's the difference between safe autocorrects and inline disable comments?

Safe autocorrects actively resolve violations and reduce warnings, while inline disables suppress them without fixing the underlying issue. This Skill favors autocorrects and centralizing configuration in .rubocop.yml to maintain code quality and reduce technical debt.

Related Skills