rails-best-practices

Enforce Rails best practices in Ruby on Rails code reviews and generation.

3|Updated Nov 20, 2025
One-click install
npx skills add https://github.com/Kavin-Kannan/rails-best-practices-skill --skill rails-best-practices
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rails-best-practices
Source: https://github.com/Kavin-Kannan/rails-best-practices-skill/tree/main/.
Command: npx skills add https://github.com/Kavin-Kannan/rails-best-practices-skill --skill rails-best-practices

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill eliminates the guesswork and time spent ensuring your Ruby on Rails code adheres to community best practices, reducing bugs and improving maintainability.

Core Features & Use Cases

  • Automated Code Review: Analyze your Rails code for common anti-patterns, security vulnerabilities, and performance bottlenecks.
  • Guided Code Generation: Generate new Rails code (controllers, models, migrations) that automatically follows established conventions and best practices.
  • Use Case: Imagine you've written a new Rails controller. You can ask Claude to review it using this skill, and it will provide specific suggestions on how to improve efficiency, security, and adherence to Rails standards, or generate a new controller from scratch that's already compliant.

Quick Start

Review the attached Rails code for best practices.

Frequently Asked Questions about rails-best-practices

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

FAQPage Schema
How do I review Rails code for best practices and security issues?

Rails code review identifies anti-patterns, security vulnerabilities, and performance bottlenecks across controllers, models, views, and migrations. Submit your code and receive specific suggestions on Time.zone.now usage, N+1 query prevention, strong parameters, and other Rails conventions to improve efficiency and maintainability.

What are common Rails anti-patterns I should avoid?

Common Rails anti-patterns include using default_scope, missing save checks, N+1 queries, improper timezone handling, weak parameter validation, and inadequate documentation. This skill enforces standards for controllers, models, views, and migrations to prevent bugs and security vulnerabilities during code review and generation.

Can I generate new Rails controllers that follow best practices?

Yes, guided code generation creates new Rails controllers, models, and migrations that automatically adhere to established conventions and best practices. Generated code follows standards for strong parameters, timezone handling, performance optimization, and security from the outset.

How do I prevent N+1 queries and performance issues in Rails?

N+1 query prevention is enforced during code review by analyzing controller and model code for inefficient database access patterns. The skill identifies missing eager-loading opportunities and suggests optimizations to improve query performance across your Rails application.

What's the best way to handle timezones in Rails code?

Rails best practice enforces Time.zone.now instead of Time.now to respect application timezone settings. During code review and generation, timezone handling is automatically validated to ensure consistent, timezone-aware datetime operations throughout your codebase.