.claude/skills/code-review/SKILL.md
Analyzes Rails code quality, architecture, and patterns without modifying code. Use when the user wants a code review, quality analysis, architecture audit, or when user mentions review, audit, code quality, anti-patterns, or SOLID principles. WHEN NOT: Actually implementing fixes (use specialist agents), writing new tests (use rspec-agent), or generating new features.
npx skillsauth add ThibautBaissac/rails_ai_agents code-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are an expert code reviewer specialized in Rails applications. You NEVER modify code — you only read, analyze, and report findings.
bin/brakeman
bin/bundler-audit
bundle exec rubocop
Read and evaluate against these focus areas:
Format your review as:
For each issue: What → Where (file:line) → Why → How (code example)
Fat Controller → Service Object:
# Bad
class EntitiesController < ApplicationController
def create
@entity = Entity.new(entity_params)
@entity.calculate_metrics
@entity.send_notifications
if @entity.save then ... end
end
end
# Good
class EntitiesController < ApplicationController
def create
result = Entities::CreateService.call(entity_params)
end
end
N+1 Query → Eager Loading:
# Bad
@entities.each { |e| e.user.name }
# Good
@entities = Entity.includes(:user)
Missing Authorization:
# Bad
@entity = Entity.find(params[:id])
# Good
@entity = Entity.find(params[:id])
authorize @entity
development
Creates Turbo Streams, Turbo Frames, and morphing patterns for real-time UI updates. Use when adding real-time updates, partial page rendering, form submissions, or broadcasting. WHEN NOT: For Stimulus JavaScript controllers (see stimulus-patterns skill). For general view conventions (see rules/views.md).
testing
Writes Minitest tests with fixtures following 37signals conventions. Uses Minitest (not RSpec) and fixtures (not factories). Use when writing tests, adding test coverage, or creating fixtures. WHEN NOT: For RSpec or FactoryBot patterns (this project uses Minitest + fixtures exclusively). For test configuration/CI setup (see project docs).
tools
Builds focused, single-purpose Stimulus controllers for progressive enhancement. Use when adding JavaScript behavior, UI interactions, form enhancements, or building reusable client-side components. WHEN NOT: For Turbo Stream/Frame patterns (see turbo-patterns skill). For server-side view logic (see rules/views.md).
testing
Implements the state-as-records-not-booleans pattern for rich state tracking. Use when modeling state changes, replacing boolean flags with record-based state, or when user mentions state records, closures, publications, or toggling state. WHEN NOT: Technical flags like cached/processed (use booleans), concern extraction (use concern-patterns), general model work (use model-patterns).