home / skills / ratacat / claude-skills / lint

lint skill

/skills/lint

This skill runs linting and security checks for Ruby and ERB projects, auto-fixing issues and preparing code before pushing.

npx playbooks add skill ratacat/claude-skills --skill lint

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
767 B
---
name: lint
description: Use this agent when you need to run linting and code quality checks on Ruby and ERB files. Run before pushing to origin.
---

Your workflow process:

1. **Initial Assessment**: Determine which checks are needed based on the files changed or the specific request
2. **Execute Appropriate Tools**:
   - For Ruby files: `bundle exec standardrb` for checking, `bundle exec standardrb --fix` for auto-fixing
   - For ERB templates: `bundle exec erblint --lint-all` for checking, `bundle exec erblint --lint-all --autocorrect` for auto-fixing
   - For security: `bin/brakeman` for vulnerability scanning
3. **Analyze Results**: Parse tool outputs to identify patterns and prioritize issues
4. **Take Action**: Commit fixes with `style: linting`

Overview

This skill runs linting and code quality checks for Ruby and ERB files and performs security scans when needed. It automates selection of the right tools, supports auto-fixing where available, and produces actionable results ready for commit. Use it as a pre-push step to catch style, syntax, and common security issues early.

How this skill works

The skill inspects changed files and decides which checks to run: Ruby, ERB, or security scans. It executes standardrb for Ruby, erblint for ERB, and Brakeman for security, optionally invoking auto-fix commands when requested. Outputs are parsed to extract errors, warnings, and suggested fixes, and fixes can be committed with the message prefix style: linting.

When to use it

  • Before pushing code to origin to prevent style regressions
  • After modifying Ruby (.rb) files to enforce project standards
  • After editing ERB templates to catch template-specific issues
  • When performing a security check on Rails code paths
  • As part of a pre-merge check or CI local run

Best practices

  • Run the skill against only changed files to save time and noise
  • Prefer auto-fix flags (--fix or --autocorrect) for straightforward style issues
  • Review parsed output to prioritize fixes that affect functionality or security
  • Commit automated fixes with a clear prefix like style: linting
  • Keep tool dependencies (bundler, gems) up to date to match project config

Example use cases

  • A developer edits controllers and views; run the skill to auto-fix style and detect ERB template problems before opening a PR
  • Integrate the skill in a local pre-push hook to run fast lint checks and a security scan on demand
  • Run a full scan before a release: standardrb for code style, erblint for templates, and Brakeman for vulnerabilities
  • Use the autocorrect flags to batch-apply formatting fixes, then commit with the style: linting message

FAQ

Which commands does the skill run for Ruby and ERB?

It runs bundle exec standardrb (or --fix) for Ruby and bundle exec erblint --lint-all (or --autocorrect) for ERB.

How does the skill handle security checks?

It runs bin/brakeman to scan for common Rails vulnerabilities and includes those results in the parsed output.