Back to Skills

fix-rubocop

Fixes RuboCop offenses systematically and safely. Use when the user wants to reduce RuboCop warnings, clean up .rubocop_todo.yml, fix linting errors, or improve code style compliance.

2starsUpdated 3/25/2026

Security Assessment

Safe(100/100)
Security Score100/100

About fix-rubocop

The 'fix-rubocop' skill helps developers systematically reduce RuboCop offenses, aiming to improve code style compliance without introducing behavioral changes. It is designed to assist users in cleaning up their codebase by applying RuboCop's auto-correction capabilities while ensuring that tests continue to pass and functionality remains intact. The skill emphasizes minimal, focused changes that preserve code integrity, making it suitable for teams that wish to maintain strict code style guidelines across their projects without overwhelming the codebase with massive, unrelated changes.

FAQ

How do I start using the 'fix-rubocop' skill?

You can start by running 'rake rubocop' to check for offenses in your code. Follow up with 'bundle exec rubocop -a' to apply safe autocorrections, ensuring no behavior changes. Always run tests afterward using 'rake spec' to verify that your changes did not break functionality.

Can I apply the fixes to specific files or directories?

Yes, you can target specific files or directories by specifying their paths when running 'bundle exec rubocop'. This helps you reduce the scope of changes, minimizing the risk of introducing errors in unrelated parts of your project.

What should I do if RuboCop's safe autocorrect doesn't fix all issues?

If RuboCop's safe autocorrect doesn't resolve all offenses, manually fix the remaining issues one cop at a time. Use the '--only' option to target specific cops, and always run tests to confirm that your fixes don't introduce any regressions.

How do I handle cops that are disabled in '.rubocop_todo.yml'?

To handle disabled cops, temporarily enable them by commenting out their entries in the '.rubocop_todo.yml' file. After applying the fixes, regenerate the TODO file using 'bundle exec docquet regenerate-todo' to keep it updated.

Are there any configuration changes I can make to adjust RuboCop rules?

Yes, you can modify the '.rubocop.yml' configuration file to adjust rules according to your project's needs. Be sure to document any changes with clear comments explaining the rationale, and regenerate the TODO file to reflect these adjustments.

Install fix-rubocop

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill

Repository

sakuro/dotfiles