rails-style

Enforce Rails code style rules for models, controllers, helpers, and concerns.

4|2|Updated Dec 12, 2025
One-click install
npx skills add https://github.com/rubakas/agent-notes --skill rails-style-rubakas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rails-style
Source: https://github.com/rubakas/agent-notes/tree/main/rails-style
Command: npx skills add https://github.com/rubakas/agent-notes --skill rails-style-rubakas

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rails teams often struggle with inconsistent code style, making it harder to read, review, and maintain large Rails apps. This guide provides opinionated conventions for conditionals, method ordering, visibility, bang methods, and naming to improve readability and maintainability across models, controllers, and concerns.

Core Features & Use Cases

  • Expanded conditionals over guard clauses (except early returns) to improve clarity.
  • Clear method ordering by invocation flow and proper visibility modifiers to reduce cognitive load.
  • Guidelines for bang vs non-bang method usage, intention-revealing names, and resource-oriented controller patterns.
  • Useful during code reviews, onboarding, and refactoring to enforce consistent Rails conventions.

Quick Start

Integrate these conventions into your Rails project by importing the rails-style guide and applying its rules to your models and controllers.

Frequently Asked Questions about rails-style

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

FAQPage Schema
What is the best way to standardize Rails code style across models and controllers?

Standardize Rails code style by applying opinionated conventions for conditional returns, method ordering, visibility modifiers, and resource-oriented controller patterns to ensure consistent readability across your codebase.

Should I use guard clauses or expanded conditionals for early returns in Rails?

Rails style guidelines recommend expanded conditionals over guard clauses to improve clarity, except for early returns where guard clauses remain acceptable for reducing nested branching.

How do I order methods and apply visibility modifiers in Rails models?

Order methods in Rails models by invocation flow and apply proper visibility modifiers to reduce cognitive load, grouping related logic sequentially so the execution path reads top to bottom.

When should I use bang methods in Rails naming conventions?

Use bang methods in Rails naming conventions when a method mutates state or raises exceptions on failure, reserving non-bang methods for safe operations that return boolean or nil outcomes.

Does this Rails style guide apply to concerns and helpers during code reviews?

These Rails style conventions apply to models, controllers, helpers, and concerns, providing consistent rules for code reviews, onboarding, and refactoring across the entire project architecture.