/ruby-rails:review-ruby-code runs instead · from ruby-rails
Reviews Ruby/Rails code changes against Sandi Metz rules, SOLID principles, and Rails best practices. Runs rubycritic and simplecov, detects OOP violations, code smells, anti-patterns, and coverage gaps, then outputs a REVIEW.md with VSCode links.
This skill never runs in Claude Code
It ships in ruby-rails at skills/, but /ruby-rails:review-ruby-code (a command, or a skill Claude Code finds first) has the same name: typing it, or Claude choosing it, runs that one instead.
Review Ruby/Rails code changes against Sandi Metz rules, SOLID principles, Rails best practices, and security standards. Generate a structured REVIEW.md with clickable VSCode links.
# Auto-detect base branch
git remote show origin | grep 'HEAD branch' | cut -d' ' -f5
# Get changed Ruby files (added/changed/modified/renamed only)
git diff --name-only --diff-filter=ACMR base-branch...HEAD | grep '\.rb$'
If not on a feature branch, review files specified by the user.
# RubyCritic on changed files
rubycritic --format json --no-browser $(git diff --name-only base...HEAD | grep '\.rb$')
# SimpleCov coverage run
COVERAGE=true bundle exec rspec
Parse rubycritic JSON for complexity/smells/duplication. Read coverage/.resultset.json for per-file coverage and uncovered lines. If tools aren't configured, invoke their respective skills for setup guidance.
Optionally run the bundled static analyzer:
ruby scripts/code_reviewer.rb <file.rb>
Review in this order for each file:
OOP Design — Apply Sandi Metz rules and SOLID principles:
Code Smells — Check for the 18 canonical smells:
Rails Patterns — Detect anti-patterns:
includes/preload/eager_load)Security — Flag vulnerabilities:
html_safe/raw on user input)permit!)Test Coverage — Cross-reference with simplecov:
Before making suggestions, understand existing patterns:
ls app/services/ app/queries/ app/decorators/ app/presenters/ app/policies/ 2>/dev/null
Ensure recommendations align with established patterns (naming conventions, abstraction layers, test framework usage). Don't suggest decorators if the codebase uses presenters.
Every code reference MUST use VSCode-compatible links:
[description](file:///absolute/path/to/file.rb#L42)
See references/vscode-links.md for format details.
Use severity levels for findings:
# Code Review - [Branch Name]
**Base Branch**: [detected-branch]
**Changed Files**: [count]
**Review Date**: [date]
---
## Summary
[High-level overview of changes and main findings]
## Critical Issues
[Security vulnerabilities, major bugs requiring immediate attention]
## Design & Architecture
### OOP Violations
[Sandi Metz rule and SOLID violations with VSCode links and severity]
### Code Smells
[Detected smells with specific refactoring suggestions]
### Rails Patterns
[N+1 queries, callback issues, anti-patterns with VSCode links]
## Security Concerns
[Vulnerabilities with VSCode links]
## Test Coverage
[Coverage gaps, missing tests, quality issues with VSCode links]
## Tool Reports
### RubyCritic Summary
- **Complexity**: [score]
- **Duplication**: [score]
- **Code Smells**: [count]
### SimpleCov Summary
- **Total Coverage**: [percentage]
- **Files with < 90% coverage**: [list]
---
## Recommendations
[Prioritized improvements aligned with codebase patterns]
## Positive Observations
[Well-designed code, good patterns, improvements from previous reviews]
Before finalizing:
What SKILL.md sets; muted values are Claude Code's defaults
13 skills in this plugin
/brakemanStatic analysis security vulnerability scanner for Ruby on Rails applications. Use when analyzing Rails code for security issues, running security audits, reviewing code for vulnerabilities, setting up security scanning in CI/CD, managing security warnings, or investigating specific vulnerability types (SQL injection, XSS, command injection, etc.). Also use when configuring Brakeman, reducing false positives, or integrating with automated workflows./cucumber-gherkinBDD testing with Cucumber and Gherkin for Ruby and Rails applications. Use when writing feature files (.feature), step definitions, hooks, or implementing Behaviour-Driven Development in Ruby/Rails projects. Covers Gherkin keywords (Feature, Scenario, Given/When/Then, Background, Scenario Outline, Rule), Ruby step definition patterns, Cucumber Expressions, hooks (Before/After/BeforeAll/AfterAll), tags, data tables, doc strings, World modules, and Capybara integration. Triggers on cucumber, gherkin, BDD, feature files, step definitions, acceptance testing, executable specifications./design-patterns-rubyComprehensive Ruby implementations of Gang of Four (GoF) design patterns. Use when implementing object-oriented design solutions, refactoring to reduce coupling, solving architecture problems, or when user mentions specific patterns (Factory, Singleton, Observer, Strategy, etc.) in Ruby context.npx claudepluginhub el-feo/ai-context --plugin ruby-railsOther plugins' skills for the same job