Sign in
Explore
Skills · SkillBackend & APIsBusiness & OpsReviewed

rails-patterns

Ruby on Rails framework patterns for Rails 7.1+ and 8.x apps. Covers the directory contract, skinny controllers with service objects, form objects, query objects, idiomatic ActiveRecord, background jobs, ViewComponent, Hotwire, and the Rails 8 Solid stack.

Kind
Skill
Works with
Claude Code, Codex
Languages
Ruby
Source
affaan-m/ECC @ d3b8a3e90890
Path
skills/rails-patterns/SKILL.md
License
MIT
Jobs
Review
InstallCopy it from the source repository, or sign in and let the assistant adapt it for your project.
# Rails Patterns

Framework patterns for modern Ruby on Rails applications (Rails 7.1+ and 8.x). Rails is opinionated by design; these are the patterns the community has converged on for apps that stay maintainable past the 50-model mark. This skill is the "how." For the "what" and "when" (the decisions about which pattern to reach for), see the Ruby patterns rules — `rules/ruby/patterns.md` in this repository, installed as `rules/ecc/ruby/patterns.md`.

## When to Activate

- Building a Rails application (full-stack, API-only, or hybrid)
- Reviewing a PR that touches `app/` or `config/`
- Generating models, controllers, services, or jobs
- A controller action grows past ~10 lines
- A model file grows past ~200 lines
- ActiveRecord queries start appearing in controllers or views

## Core Concepts

### The directory contract

Rails apps follow a predictable structure. Add directories deliberately, not casually.

```
app/
  models/         ActiveRecord models. Persistence and domain logic close to the data.
  controllers/    HTTP request handling. Thin orchestration only.
  views/          ERB templates. No business logic.
…