rails-conventions

Identify Rails convention violations in Ruby on Rails codebases.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Grupo-AFAL/claude-plugins --skill rails-conventions-grupo-afal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rails-conventions
Source: https://github.com/Grupo-AFAL/claude-plugins/tree/main/rails-tools/skills/rails-conventions
Command: npx skills add https://github.com/Grupo-AFAL/claude-plugins --skill rails-conventions-grupo-afal

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Enforce Rails Doctrine and DHH-style conventions to identify anti-patterns, reduce accidental complexity, and make Rails codebases more idiomatic and maintainable.

Core Features & Use Cases

  • Convention Enforcement: Evaluates controllers, models, routes, queries, views, and tests against Rails best practices.
  • Actionable Reviews: Flags anti-patterns (fat controllers, anemic models, boolean soup, N+1 queries, banned gems) and suggests concrete refactors and design changes.
  • Guided Refactors & Examples: Provides before/after recommendations, preferred AFAL replacements (e.g., Pundit, Propshaft), and references to patterns and anti-patterns for reviewer education.
  • Use Case: Run when reviewing pull requests, auditing a legacy Rails app, or preparing a codebase for AFAL conventions adoption.

Quick Start

Review the provided controller and model files for Rails Doctrine adherence and return a DHH-style code review with prioritized issues and concrete refactor examples.

Frequently Asked Questions about rails-conventions

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

FAQPage Schema
How do I check my Rails codebase for convention violations?

To check Rails codebase for convention violations, review controllers, models, routes, queries, view components, and testing patterns against Rails Doctrine. This identifies anti-patterns like fat controllers, anemic models, and N+1 queries, producing actionable, DHH-style recommendations for your code.

What are common Rails anti-patterns to look for during a code review?

Common Rails anti-patterns include fat controllers, anemic models, boolean soup, N+1 queries, and banned gems. Identifying these reduces accidental complexity and enforces DHH-style conventions to make the Rails codebase more idiomatic and maintainable.

How do I refactor Rails controllers to follow DHH conventions?

Refactoring Rails controllers involves moving logic to models, replacing banned gems with preferred solutions like Pundit, and verifying state management. This provides concrete before/after examples and design changes aligned with Rails Doctrine.

Can I use this Rails review process for legacy application audits?

Yes, you can use this Rails review process for legacy application audits. It evaluates existing controllers, models, routes, queries, and views against best practices, flagging anti-patterns and suggesting concrete refactors to prepare the codebase for conventions adoption.

Does this convention enforcement check Rails view components and routes?

Yes, convention enforcement verifies Rails view components, routes, and testing patterns. It audits these elements against Rails Doctrine to detect anti-patterns and provide DHH-style recommendations with example refactors.

What is the best way to enforce Rails Doctrine in pull requests?

The best way to enforce Rails Doctrine in pull requests is applying convention checks to controllers, models, queries, and views. This flags anti-patterns like boolean soup and N+1 queries, returning prioritized issues with concrete refactor examples.