rails-dev
Installation
SKILL.md
Rails Conventions
Core Philosophy
- Rich models - Business logic lives in models, not service objects
- Everything is CRUD - New resource over new action (
resource :closurenotpost :close) - State as records -
Closuremodel instead ofclosed: boolean - Concerns for composition -
Closeable,Watchable,Commentable - Explicit over clever - Inline until repetition is real; an abstraction earns its place, it isn't built on speculation
- Small interfaces - No public method without a caller
- Let it crash - Bang methods (
create!), handle failures at the boundary, not by pre-guarding (references/error-handling.md) - Invariants in the schema - Hard rules (presence, uniqueness, ranges) are NOT NULL / unique / check constraints; validations are for user-facing messages, not the source of truth. References stay soft: no foreign keys, integrity at the model layer
- Minimal dependencies - Build it yourself before reaching for gems. No Devise, Pundit, RSpec, FactoryBot, ViewComponent, service/form objects, or decorators
- Database-backed - Solid Queue/Cache/Cable, no Redis
- Test coverage - Maintain roughly 1:1 test ratio (1 line test per line of code)
Reference Selection
This table is an index, not the content. The conventions live in the reference files, not in this table, the codebase, or general Rails knowledge. Match the task to the rows below and read those files end to end before you design, write, review, or analyze the code. Reading the row is not reading the reference; guessing from the codebase is how the wrong convention gets shipped.