"The best code is the code you don't write. The second best is the code that's obviously correct."
Vanilla Rails is plenty:
- Rich domain models over service objects
- CRUD controllers over custom actions
- Concerns for horizontal code sharing
- Records as state instead of boolean columns
- Database-backed everything (no Redis)
- Build solutions before reaching for gems
What they deliberately avoid:
- devise (custom ~150-line auth instead)
- pundit/cancancan (simple role checks in models)
- sidekiq (Solid Queue uses database)
- redis (database for everything)
- view_component (partials work fine)
- GraphQL (REST with Turbo sufficient)
- factory_bot (fixtures are simpler)
- rspec (Minitest ships with Rails)
- Tailwind (native CSS with layers)
Development Philosophy:
- Ship, Validate, Refine - prototype-quality code to production to learn
- Fix root causes, not symptoms
- Write-time operations over read-time computations
- Database constraints over ActiveRecord validations
- Controllers - REST mapping, concerns, Turbo responses, API patterns
- Models - Concerns, state records, callbacks, scopes, POROs
- Views & Frontend - Turbo, Stimulus, CSS, partials
- Architecture - Routing, multi-tenancy, authentication, jobs, caching
- Testing - Minitest, fixtures, integration tests
- Gems & Dependencies - What to use vs avoid
- Code Review - Review code against DHH style
- General Guidance - Philosophy and conventions
Specify a number or describe your task.
After reading relevant references, apply patterns to the user's code.
Verbs: card.close, card.gild, board.publish (not set_style methods)
Predicates: card.closed?, card.golden? (derived from presence of related record)
Concerns: Adjectives describing capability (Closeable, Publishable, Watchable)
Controllers: Nouns matching resources (Cards::ClosuresController)
Scopes:
chronologically, reverse_chronologically, alphabetically, latest
preloaded (standard eager loading name)
indexed_by, sorted_by (parameterized)
active, unassigned (business terms, not SQL-ish)
REST Mapping
Instead of custom actions, create new resources:
POST /cards/:id/close → POST /cards/:id/closure
DELETE /cards/:id/close → DELETE /cards/:id/closure
POST /cards/:id/archive → POST /cards/:id/archival
Ruby Syntax Preferences
# Symbol arrays with spaces inside brackets
before_action :set_message, only: %i[ show edit update destroy ]
# Private method indentation
private
def set_message
@message = Message.find(params[:id])
end
# Expression-less case for conditionals
case
when params[:before].present?
messages.page_before(params[:before])
else
messages.last_page
end
# Bang methods for fail-fast
@message = Message.create!(params)
# Ternaries for simple conditionals
@room.direct? ? @room.users : @message.mentionees
Key Patterns
State as Records:
Card.joins(:closure) # closed cards
Card.where.missing(:closure) # open cards
Current Attributes:
belongs_to :creator, default: -> { Current.user }
Authorization on Models:
class User < ApplicationRecord
def can_administer?(message)
message.creator == self || admin?
end
end
All detailed patterns in references/:
| File |
Topics |
| controllers.md |
REST mapping, concerns, Turbo responses, API patterns, HTTP caching |
| models.md |
Concerns, state records, callbacks, scopes, POROs, authorization, broadcasting |
| frontend.md |
Turbo Streams, Stimulus controllers, CSS layers, OKLCH colors, partials |
| architecture.md |
Routing, authentication, jobs, Current attributes, caching, database patterns |
| testing.md |
Minitest, fixtures, unit/integration/system tests, testing patterns |
| gems.md |
What they use vs avoid, decision framework, Gemfile examples |
|
|
Important Disclaimers:
- LLM-generated guide - may contain inaccuracies
- Code examples from Fizzy are licensed under the O'Saasy License
- Not affiliated with or endorsed by 37signals
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: dhh-rails-style3description: This skill should be used when writing Ruby and Rails code in DHH's distinctive 37signals style. It applies when writing Ruby code, Rails applications, creating models, controllers, or any Ruby file. Triggers on Ruby/Rails code generation, refactoring requests, code review, or when the user mentions DHH, 37signals, Basecamp, HEY, or Campfire style. Embodies REST purity, fat models, thin controllers, Current attributes, Hotwire patterns, and the "clarity over cleverness" philosophy. Use when this capability is needed.4---56<objective>7Apply 37signals/DHH Rails conventions to Ruby and Rails code. This skill provides comprehensive domain expertise extracted from analyzing production 37signals codebases (Fizzy/Campfire) and DHH's code review patterns.8</objective>910<essential_principles>11## Core Philosophy1213"The best code is the code you don't write. The second best is the code that's obviously correct."1415**Vanilla Rails is plenty:**16- Rich domain models over service objects17- CRUD controllers over custom actions18- Concerns for horizontal code sharing19- Records as state instead of boolean columns20- Database-backed everything (no Redis)21- Build solutions before reaching for gems2223**What they deliberately avoid:**24- devise (custom ~150-line auth instead)25- pundit/cancancan (simple role checks in models)26- sidekiq (Solid Queue uses database)27- redis (database for everything)28- view_component (partials work fine)29- GraphQL (REST with Turbo sufficient)30- factory_bot (fixtures are simpler)31- rspec (Minitest ships with Rails)32- Tailwind (native CSS with layers)3334**Development Philosophy:**35- Ship, Validate, Refine - prototype-quality code to production to learn36- Fix root causes, not symptoms37- Write-time operations over read-time computations38- Database constraints over ActiveRecord validations39</essential_principles>4041<intake>42What are you working on?43441. **Controllers** - REST mapping, concerns, Turbo responses, API patterns452. **Models** - Concerns, state records, callbacks, scopes, POROs463. **Views & Frontend** - Turbo, Stimulus, CSS, partials474. **Architecture** - Routing, multi-tenancy, authentication, jobs, caching485. **Testing** - Minitest, fixtures, integration tests496. **Gems & Dependencies** - What to use vs avoid507. **Code Review** - Review code against DHH style518. **General Guidance** - Philosophy and conventions5253**Specify a number or describe your task.**54</intake>5556<routing>57| Response | Reference to Read |58|----------|-------------------|59| 1, "controller" | [controllers.md](./references/controllers.md) |60| 2, "model" | [models.md](./references/models.md) |61| 3, "view", "frontend", "turbo", "stimulus", "css" | [frontend.md](./references/frontend.md) |62| 4, "architecture", "routing", "auth", "job", "cache" | [architecture.md](./references/architecture.md) |63| 5, "test", "testing", "minitest", "fixture" | [testing.md](./references/testing.md) |64| 6, "gem", "dependency", "library" | [gems.md](./references/gems.md) |65| 7, "review" | Read all references, then review code |66| 8, general task | Read relevant references based on context |6768**After reading relevant references, apply patterns to the user's code.**69</routing>7071<quick_reference>72## Naming Conventions7374**Verbs:** `card.close`, `card.gild`, `board.publish` (not `set_style` methods)7576**Predicates:** `card.closed?`, `card.golden?` (derived from presence of related record)7778**Concerns:** Adjectives describing capability (`Closeable`, `Publishable`, `Watchable`)7980**Controllers:** Nouns matching resources (`Cards::ClosuresController`)8182**Scopes:**83- `chronologically`, `reverse_chronologically`, `alphabetically`, `latest`84- `preloaded` (standard eager loading name)85- `indexed_by`, `sorted_by` (parameterized)86- `active`, `unassigned` (business terms, not SQL-ish)8788## REST Mapping8990Instead of custom actions, create new resources:9192```93POST /cards/:id/close → POST /cards/:id/closure94DELETE /cards/:id/close → DELETE /cards/:id/closure95POST /cards/:id/archive → POST /cards/:id/archival96```9798## Ruby Syntax Preferences99100```ruby101# Symbol arrays with spaces inside brackets102before_action :set_message, only: %i[ show edit update destroy ]103104# Private method indentation105 private106 def set_message107 @message = Message.find(params[:id])108 end109110# Expression-less case for conditionals111case112when params[:before].present?113 messages.page_before(params[:before])114else115 messages.last_page116end117118# Bang methods for fail-fast119@message = Message.create!(params)120121# Ternaries for simple conditionals122@room.direct? ? @room.users : @message.mentionees123```124125## Key Patterns126127**State as Records:**128```ruby129Card.joins(:closure) # closed cards130Card.where.missing(:closure) # open cards131```132133**Current Attributes:**134```ruby135belongs_to :creator, default: -> { Current.user }136```137138**Authorization on Models:**139```ruby140class User < ApplicationRecord141 def can_administer?(message)142 message.creator == self || admin?143 end144end145```146</quick_reference>147148<reference_index>149## Domain Knowledge150151All detailed patterns in `references/`:152153| File | Topics |154|------|--------|155| [controllers.md](./references/controllers.md) | REST mapping, concerns, Turbo responses, API patterns, HTTP caching |156| [models.md](./references/models.md) | Concerns, state records, callbacks, scopes, POROs, authorization, broadcasting |157| [frontend.md](./references/frontend.md) | Turbo Streams, Stimulus controllers, CSS layers, OKLCH colors, partials |158| [architecture.md](./references/architecture.md) | Routing, authentication, jobs, Current attributes, caching, database patterns |159| [testing.md](./references/testing.md) | Minitest, fixtures, unit/integration/system tests, testing patterns |160| [gems.md](./references/gems.md) | What they use vs avoid, decision framework, Gemfile examples |161</reference_index>162163<success_criteria>164Code follows DHH style when:165- Controllers map to CRUD verbs on resources166- Models use concerns for horizontal behavior167- State is tracked via records, not booleans168- No unnecessary service objects or abstractions169- Database-backed solutions preferred over external services170- Tests use Minitest with fixtures171- Turbo/Stimulus for interactivity (no heavy JS frameworks)172- Native CSS with modern features (layers, OKLCH, nesting)173- Authorization logic lives on User model174- Jobs are shallow wrappers calling model methods175</success_criteria>176177<credits>178Based on [The Unofficial 37signals/DHH Rails Style Guide](https://github.com/marckohlbrugge/unofficial-37signals-coding-style-guide) by [Marc Köhlbrugge](https://x.com/marckohlbrugge), generated through deep analysis of 265 pull requests from the Fizzy codebase.179180**Important Disclaimers:**181- LLM-generated guide - may contain inaccuracies182- Code examples from Fizzy are licensed under the O'Saasy License183- Not affiliated with or endorsed by 37signals184</credits>185186---187> Converted and distributed by [TomeVault](https://tomevault.io/claim/i3ringit) — claim your Tome and manage your conversions.188<!-- tomevault:4.0:skill_md:2026-04-13 -->