Rails Patterns — portable workflow
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. Use when building or reviewing Rails apps, controllers, models, services, jobs, or views.
Use it only when the request supplies this domain, framework, data source or artifact; a shared keyword is not a match. Related skills, each for its own concern: bosskuai-fastapi-development, bosskuai-laravel-development, bosskuai-quarkus-patterns, bosskuai-software-architecture.
Workflow
Read the source workflow first, then work through these sections in order:
- Core Concepts.
- The directory contract.
- Skinny controllers.
- Service objects.
- Form objects.
- Query objects.
- Resolve its
scripts/, references/, assets/ and template paths against references/upstream/, not the project root. Source skill names map through SOURCE.json (bossku skills show <id>). ECC slash commands, agent names and package-root paths are not installed: use what this host has, or say what is missing.
- Check the project's tool versions first:
.ruby-version for the Ruby version, Gemfile.lock for the exact Rails version, and bundle exec rails -v for the installed one. Check the latest stable Rails release and its maintenance dates at work time on rubyonrails.org, and use only APIs that exist in the installed version. Also check the source prerequisites. A documented command is an example, not permission to install packages, add an account, expose secrets, upload private content or change an external service.
- It can need a named provider, MCP server or API: check that it is available and in scope, report it when it is not, and never invent its output.
Done when
Apply the source “Core Concepts”, “The directory contract” guidance to the concrete request. Return the resulting rails patterns artifact or diagnosis with source/command evidence for each conclusion.
If an input, provider, runtime or authorisation is missing, stop that step, carry on with read-only analysis, and say exactly what is missing. A generated plan alone is not completion.
Also check before you finish:
- Money is a
decimal column and a BigDecimal in Ruby, never a Float.
- A read-then-write is guarded by
with_lock, a lock_version column, or a conditional update_all that checks the row count.
- A job that uses
retry_on is safe to run twice.
- An index on a large PostgreSQL table uses
algorithm: :concurrently with disable_ddl_transaction!.
The full quality bar is in ../../references/checklists/engineering-quality-bar.md.
Adapted from the locally reviewed affaan-m/ECC snapshot: provenance and hashes in SOURCE.json, the original text and resources in references/upstream/ under its MIT licence. Copyright (c) 2026 Affaan Mustafa.
1---2name: bosskuai-rails-patterns3description: "Use when the task explicitly concerns 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. Use when building or reviewing Rails apps, controllers, models, services, jobs, or views."4metadata:5 source: https://skillmd.com/skills/wankimmy/bosskuai-rails-patterns6 origin: ECC-adaptation7---89# Rails Patterns — portable workflow1011Ruby 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. Use when building or reviewing Rails apps, controllers, models, services, jobs, or views.1213Use it only when the request supplies this domain, framework, data source or artifact; a shared keyword is not a match. Related skills, each for its own concern: `bosskuai-fastapi-development`, `bosskuai-laravel-development`, `bosskuai-quarkus-patterns`, `bosskuai-software-architecture`.1415## Workflow1617Read [the source workflow](references/upstream/SKILL.md) first, then work through these sections in order:18191. Core Concepts.202. The directory contract.213. Skinny controllers.224. Service objects.235. Form objects.246. Query objects.2526- Resolve its `scripts/`, `references/`, `assets/` and template paths against `references/upstream/`, not the project root. Source skill names map through [SOURCE.json](SOURCE.json) (`bossku skills show <id>`). ECC slash commands, agent names and package-root paths are not installed: use what this host has, or say what is missing.27- Check the project's tool versions first: `.ruby-version` for the Ruby version, `Gemfile.lock` for the exact Rails version, and `bundle exec rails -v` for the installed one. Check the latest stable Rails release and its maintenance dates at work time on rubyonrails.org, and use only APIs that exist in the installed version. Also check the source prerequisites. A documented command is an example, not permission to install packages, add an account, expose secrets, upload private content or change an external service.28- It can need a named provider, MCP server or API: check that it is available and in scope, report it when it is not, and never invent its output.2930## Done when3132Apply the source “Core Concepts”, “The directory contract” guidance to the concrete request. Return the resulting rails patterns artifact or diagnosis with source/command evidence for each conclusion.3334If an input, provider, runtime or authorisation is missing, stop that step, carry on with read-only analysis, and say exactly what is missing. A generated plan alone is not completion.3536Also check before you finish:3738- Money is a `decimal` column and a `BigDecimal` in Ruby, never a `Float`.39- A read-then-write is guarded by `with_lock`, a `lock_version` column, or a conditional `update_all` that checks the row count.40- A job that uses `retry_on` is safe to run twice.41- An index on a large PostgreSQL table uses `algorithm: :concurrently` with `disable_ddl_transaction!`.4243The full quality bar is in `../../references/checklists/engineering-quality-bar.md`.4445Adapted from the locally reviewed `affaan-m/ECC` snapshot: provenance and hashes in [SOURCE.json](SOURCE.json), the original text and resources in [references/upstream/](references/upstream/SKILL.md) under its [MIT licence](references/upstream/LICENSE). Copyright (c) 2026 Affaan Mustafa.