dhh-rails-style

Enforce DHH Rails styling conventions for Ruby and Rails code.

2|1|Updated Apr 17, 2026
One-click install
npx skills add https://github.com/wangrenzhu-ola/GaleHarnessCodingCLI --skill dhh-rails-style-wangrenzhu-ola
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dhh-rails-style
Source: https://github.com/wangrenzhu-ola/GaleHarnessCodingCLI/tree/main/plugins/galeharness-cli/skills/dhh-rails-style
Command: npx skills add https://github.com/wangrenzhu-ola/GaleHarnessCodingCLI --skill dhh-rails-style-wangrenzhu-ola

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Promotes an opinionated, pragmatic Rails coding style based on 37signals/DHH patterns to keep Ruby and Rails code readable, maintainable, and aligned with RESTful design.

Core Features & Use Cases

  • REST-oriented controller structure with dedicated resources (closures, archives, comments) to keep controllers slim and models expressive.
  • State-as-record patterns and horizontal concerns to enable reusable, composable domain logic.
  • Clear testing guidance (Minitest with fixtures) and front-end patterns (Turbo/Stimulus) to support end-to-end workflows.
  • Guidance for routing, architecture, and authorization patterns to ensure consistent, safe code practices across teams.

Quick Start

Start by aligning your codebase with DHH conventions: identify key domain models, extract cross-cutting concerns, and replace ad-hoc actions with resource-based controllers and Rails-native patterns.

Frequently Asked Questions about dhh-rails-style

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

FAQPage Schema
How do I enforce DHH Rails coding conventions for Ruby and Rails code?

To enforce DHH Rails coding conventions, align your codebase with RESTful controller structures, heavy-domain models, and state-as-record patterns. This keeps Ruby and Rails code readable, maintainable, and aligned with 37signals design principles.

What is the best way to structure Rails controllers using RESTful patterns?

The best way to structure Rails controllers using RESTful patterns is to use dedicated resources like closures, archives, and comments. This keeps controllers slim and models expressive while adhering to DHH Rails style conventions.

How do I handle cross-cutting concerns and domain logic in Rails according to DHH style?

Handle cross-cutting concerns and domain logic in Rails by applying state-as-record patterns and horizontal concerns. This approach enables reusable, composable domain logic without bloating controllers or models.

Does the DHH Rails style guide work with Minitest and fixtures?

Yes, the DHH Rails style guide works with Minitest and fixtures, providing clear testing guidance to support end-to-end workflows. It also includes front-end patterns using Turbo and Stimulus for integrated testing.

Can I use DHH Rails style for refactoring existing Rails applications?

Yes, you can use DHH Rails style for refactoring existing Rails applications. It guides you to identify key domain models, extract cross-cutting concerns, and replace ad-hoc actions with resource-based controllers.

When should I not use DHH Rails style for my Ruby application?

You should not use DHH Rails style if your Ruby application does not follow Rails conventions or if you prefer alternative testing frameworks over Minitest, as this style heavily relies on Rails-native RESTful patterns and specific testing guidance.