37signals-style

Rich models over service objects, state as records, CRUD-only routing, no authorization or auth gems

Automatic · raw .md · GitHub

Install

npx skills add marckohlbrugge/skills --skill 37signals-style

Or tell your agent:

Install the skill at https://marc.md/37signals-style.md

Or by hand, for Claude Code:

mkdir -p ~/.claude/skills/37signals-style && curl -fsSL https://marc.md/37signals-style.md -o ~/.claude/skills/37signals-style/SKILL.md

37signals Style

The opinionated layer on top of rails-best-practices-core. Distilled from 37signals codebases (Campfire, Fizzy) and DHH's review patterns. Not everyone writes Rails this way; apply it where the app already does, or where the user asks for it.

Rich Models, No Service Layer

State as Records, Not Booleans

Instead of closed: boolean, create a Closure record with creator and timestamps. You get who/when for free, and scoping is trivial:

has_one :closure, dependent: :destroy
scope :closed, -> { joins(:closure) }
scope :open, -> { where.missing(:closure) }

Request Context

Everything Is CRUD

Authorization Without a Library

Vanilla Rails Over Gems

Before adding a gem ask: is 50-150 lines in-repo simpler than a dependency? Commonly skipped: Devise, Pundit, ViewComponent, RSpec, FactoryBot, Redis (Solid Queue/Cache/Cable use the DB), service objects, form objects, decorators, GraphQL, SPA frameworks, Tailwind.

Testing in this style: 37signals-testing. Review in DHH's voice: dhh.

Always Flag