dhh-rails-style

Enforces DHH/37signals Rails conventions for controllers, models, and tests.

Updated Apr 22, 2026
One-click install
npx skills add https://github.com/yxc023/agent-config-studio --skill dhh-rails-style-yxc023
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dhh-rails-style
Source: https://github.com/yxc023/agent-config-studio/tree/main/.opencode/skills/dhh-rails-style
Command: npx skills add https://github.com/yxc023/agent-config-studio --skill dhh-rails-style-yxc023

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill codifies DHH/37signals Rails conventions to guide Ruby and Rails code toward readable, RESTful, domain-driven patterns with a bias toward models and database-backed state over heavy service objects.

Core Features & Use Cases

  • Enforces RESTful resources and CRUD-aligned controllers instead of verb-based actions.
  • Promotes state as records (e.g., Closure, Goldness) for auditability and queryability.
  • Provides a coherent playbook for controllers, models, testing, and architecture aligned with DHH principles.
  • Use Case: refactor a Rails app to clearer domain boundaries with Turbo/Stimulus and simple authorization.

Quick Start

Begin by auditing domain boundaries, introducing dedicated state models, and aligning tests to Minitest fixtures.

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 Rails controllers to follow DHH conventions?

DHH Rails conventions enforce RESTful resources and CRUD-aligned controllers instead of verb-based actions, pushing domain logic into models to maintain clear boundaries and reduce heavy service objects for readable, domain-driven code.

What is the best way to manage state in Ruby on Rails applications?

The best way to manage state in Rails is using database-backed records (e.g., Closure, Goldness) to ensure auditability and queryability. This model-driven approach avoids complex external state machines and keeps logic transparent.

Does the DHH Rails style work with Turbo and Stimulus integration?

Yes, the DHH Rails style provides patterns for Turbo and Stimulus integration while maintaining minimal external dependencies. It aligns frontend interactions with RESTful resources and model-driven state for cohesive full-stack development.

How do I test Rails models following 37signals conventions?

Testing Rails models following 37signals conventions aligns with Minitest and fixtures. The playbook guides structuring tests to validate model-driven state and domain boundaries without relying on heavy mocking or external testing frameworks.

When should I avoid using service objects in Ruby on Rails?

You should avoid heavy service objects in Ruby on Rails when you can express domain logic and state transitions directly within models. DHH conventions favor model-driven state and database-backed records for better auditability and queryability.