dhh-rails-style

Align Ruby and Rails code with DHH's 37signals conventions.

Updated Jan 16, 2026
One-click install
npx skills add https://github.com/8b-is/8b-is-mp --skill dhh-rails-style-8b-is
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dhh-rails-style
Source: https://github.com/8b-is/8b-is-mp/tree/main/plugins/compound-engineering/skills/dhh-rails-style
Command: npx skills add https://github.com/8b-is/8b-is-mp --skill dhh-rails-style-8b-is

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill helps software engineers align Ruby and Rails code with DHH's 37signals conventions.

Core Features & Use Cases

  • Enforces REST-first, resource-oriented design to keep controllers slim and models rich.
  • Guides code reviews and refactoring to maintain DHH-style discipline.
  • Triggers on Ruby/Rails code generation, refactoring requests, code review, or when the user mentions DHH, 37signals, Basecamp, HEY, or Campfire style.

Quick Start

Refactor a Rails model to follow DHH style: implement a fat model, a slim controller, and RESTful routes; integrate Current attributes and Turbo patterns where appropriate.

Frequently Asked Questions about dhh-rails-style

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor a Rails controller to follow DHH style conventions?

DHH Rails style enforces fat models and thin controllers by moving domain logic into model objects and keeping controllers strictly RESTful. Refactoring involves simplifying controller actions, using resource-oriented routes, and ensuring business rules live in the model layer.

What are Current attributes in Rails and how do I implement them?

Current attributes in Rails provide a thread-safe way to access global request context like the current user. DHH style implements them as singleton objects to avoid passing context explicitly through every method, keeping domain logic clean and readable.

When do I need to use Turbo patterns in a Ruby on Rails application?

You need Turbo patterns in Rails when building modern, single-page-like interactions without heavy JavaScript. DHH style integrates Turbo to handle partial page updates and form submissions, ensuring fast navigation and maintaining RESTful, server-driven application architecture.

Does DHH Rails style require giving up custom routes for strict REST?

DHH Rails style prioritizes REST purity and resource-oriented design but does not strictly forbid custom routes. It encourages keeping controllers slim by favoring standard RESTful actions, moving complex logic into fat models rather than adding non-RESTful controller endpoints.

How do I conduct a code review for a Rails app using 37signals conventions?

Conduct a Rails code review using 37signals conventions by checking for REST purity, slim controllers, and rich models. Verify that Current attributes and Turbo patterns are applied correctly, ensuring the domain logic remains readable and structurally aligned with Basecamp and HEY standards.

What is the best way to structure domain logic in Ruby on Rails models?

The best way to structure domain logic in Rails models following DHH style is creating fat models with readable, explicit business rules. Move complex operations out of controllers into model methods, ensuring the code aligns with 37signals conventions and remains maintainable.