dhh-rails-style

Enforce DHH Rails style conventions on Ruby and Rails code.

102|4|Updated Apr 15, 2009
One-click install
npx skills add https://github.com/mikker/dotfiles --skill dhh-rails-style-mikker
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dhh-rails-style
Source: https://github.com/mikker/dotfiles/tree/main/agents.symlink/skills/dhh-rails-style
Command: npx skills add https://github.com/mikker/dotfiles --skill dhh-rails-style-mikker

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This guide codifies DHH Rails conventions to reduce divergence and improve readability and maintainability of Ruby and Rails code, reflecting 37signals' architectural preferences.

Core Features & Use Cases

  • Enforces RESTful CRUD patterns with resource-based controllers and dedicated endpoints for state changes (e.g., closure, goldness).
  • Promotes behavior reuse via concerns and models that track state with dedicated records rather than booleans.
  • Supports Turbo/Stimulus-driven UI and straightforward Minitest-based testing aligned with the style guide.

Quick Start

Start by applying the Closeable, Watchable, and Eventable patterns to your models and routing as described in the references.

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 style conventions in my Ruby codebase?

To enforce DHH Rails style conventions, apply resource-based controllers, RESTful CRUD patterns, and state-as-records models. This promotes consistency and readability across your Ruby on Rails application architecture.

What is the best way to structure Rails controllers for state changes like closure?

The best way to structure Rails controllers for state changes is using dedicated endpoints within resource-based controllers. This enforces RESTful CRUD design and aligns with DHH Rails styling preferences for clear state management.

How does DHH Rails style handle model behavior reuse and state management?

DHH Rails style handles behavior reuse through concerns and manages state using dedicated records rather than simple booleans. Applying patterns like Closeable, Watchable, and Eventable ensures clear state tracking in models.

Can I use Turbo and Stimulus integration with DHH Rails conventions?

Yes, you can use Turbo and Stimulus integration with DHH Rails conventions. The style guide supports Turbo/Stimulus-driven UI alongside straightforward Minitest-based testing to ensure consistent frontend and testing practices.

Does DHH Rails style require Minitest for testing?

DHH Rails style promotes straightforward Minitest-based testing aligned with the style guide. It enforces testing practices that reflect 37signals' architectural preferences for maintainable Rails applications.

When should I use concerns instead of standard model inheritance in Rails?

You should use concerns instead of standard model inheritance when promoting horizontal behavior reuse across Rails models. DHH Rails style enforces specific concerns naming and architecture decisions to maintain readability and reduce divergence.