rubocop

Runs Rubocop on Ruby files and iteratively fixes style violations with minimal disable comments.

Updated Jul 22, 2026
One-click install
npx skills add https://github.com/Trigent-Software-Pvt-Ltd/trigen-aidlc --skill rubocop-trigent-software-pvt-ltd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rubocop
Source: https://github.com/Trigent-Software-Pvt-Ltd/trigen-aidlc/tree/main/plugins/ruby/skills/rubocop
Command: npx skills add https://github.com/Trigent-Software-Pvt-Ltd/trigen-aidlc --skill rubocop-trigent-software-pvt-ltd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Manually resolving Rubocop violations across Ruby files is repetitive and error-prone, especially when deciding whether to fix code or disable a rule. This Skill automates the lint-fix cycle while enforcing disciplined use of disable comments. ## Core Features & Use Cases - Iterative Violation Fixing: Runs bundle exec rubocop -a on a target file or the whole project and resolves violations until the output is clean. - Judicious Rule Disabling: Adds # rubocop:disable / # rubocop:enable comments only when a rule is incorrect, dangerous, or conflicts with project patterns, always with a documented reason. - Use Case: After refactoring a Rails model, run the Skill on app/models/user.rb to auto-correct style issues and get a clean Rubocop report with justified exceptions. ## Quick Start Ask the assistant to run Rubocop on a specific Ruby file and fix all violations, disabling rules only where necessary with explanations.

Frequently Asked Questions about rubocop

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

FAQPage Schema
How do I automatically fix Rubocop violations in a Ruby file?

Run `bundle exec rubocop -a <file_path>` to auto-correct safe violations, then manually fix remaining offenses. This Skill automates that loop, re-running Rubocop until the file is clean.

When should I disable a Rubocop rule instead of fixing the code?

Disable a rule only when following it would reduce readability, conflict with established project patterns, introduce bugs, or is contextually inappropriate. Always add a clear explanation and re-enable the rule immediately after the affected lines.

Can I run Rubocop on all files in a project at once?

Yes, omit the file path argument and Rubocop runs against the entire project. The Skill supports both single-file and whole-project linting through the same command.

How do I disable a Rubocop cop for specific lines only?

Add `# rubocop:disable <CopName>` before the problematic code and `# rubocop:enable <CopName>` immediately after it. This scopes the exception narrowly instead of disabling the cop project-wide.

Why does Rubocop still report violations after auto-correct?

The `-a` flag only fixes offenses marked as safely auto-correctable. Remaining violations require manual code changes or justified disable comments, which the Skill handles iteratively.