From ruby-rails
Comprehensive Ruby and Rails code review using Sandi Metz rules and SOLID principles. Analyzes changed files in current branch vs base branch, runs rubycritic and simplecov, identifies OOP violations, Rails anti-patterns, security issues, code smells, and test coverage gaps. Outputs REVIEW.md with VSCode-compatible file links. Use when reviewing Ruby/Rails code, conducting code reviews, checking for design issues, pull request review, code quality analysis, or when user mentions Sandi Metz, POODR, 99 Bottles, SOLID, Law of Demeter, or "Tell Don't Ask".
npx claudepluginhub el-feo/ai-context --plugin ruby-railsThis skill uses the workspace's default tool permissions.
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.
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
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: