dhh-rails-style

Enforce DHH 37signals Rails conventions for controllers, models, and views.

Updated Nov 11, 2023
One-click install
npx skills add https://github.com/michaelvolz/redmuffin.Blazor.StaticWeb --skill dhh-rails-style-michaelvolz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dhh-rails-style
Source: https://github.com/michaelvolz/redmuffin.Blazor.StaticWeb/tree/main/.opencode/skills/ce/dhh-rails-style
Command: npx skills add https://github.com/michaelvolz/redmuffin.Blazor.StaticWeb --skill dhh-rails-style-michaelvolz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Keeps Ruby and Rails code aligned with DHH's 37signals philosophy so every controller, model, or review request honors REST purity, fat models, Current attributes, and Turbo/Hotwire simplicity instead of drifting into heavy service layers or unfamiliar gems.

Core Features & Use Cases

  • Holistic guidance covering controllers, models, views, architecture, testing, dependency choices, and code review decisions anchored in DHH's RESTful noun resources, state-as-records, and Current attribute defaults.
  • Reference-driven advice that points to specialized files for controllers, models, frontend, architecture, testing, and gems whenever the task mentions Ruby, Rails, Turbo, Hotwire, or the 37signals lineage.
  • Stylistic guardrails that champion RESTful CRUD mapping, fat models, concerns for horizontal behavior, Turbo/Stimulus UI patterns, minimal Minitest fixtures, and native CSS over extraneous dependencies.

Quick Start

Ask for a Ruby or Rails transformation that uses REST nouns, fat models, Current attributes, and Turbo/Stimulus interactions while following DHH's 37signals conventions.

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 conventions for fat models and thin controllers?

To enforce DHH Rails conventions, author code using RESTful noun resources, state-as-records, and Current attributes while keeping controllers thin and logic in fat models. Avoid heavy service layers and extraneous gems in favor of native Rails patterns.

What is the 37signals approach to Rails frontend architecture?

The 37signals Rails frontend approach uses Turbo and Stimulus Hotwire patterns instead of heavy JavaScript frameworks. It champions native CSS and avoids extraneous dependencies to maintain simplicity and application speed.

How do I structure RESTful controllers in Ruby on Rails?

Structure RESTful controllers in Ruby on Rails by mapping actions to standard CRUD operations using noun-based resources. Keep controllers thin by pushing business logic into fat models and using concerns for horizontal behavior sharing.

Why avoid service objects and heavy gems in Rails applications?

Avoid service objects and heavy gems in Rails applications to prevent architectural drift from 37signals conventions. DHH style favors state-as-records, Current attributes, and native framework features over unfamiliar dependencies and complex service layers.

Can I use Minitest fixtures following DHH's Rails testing style?

Yes, you can use Minitest fixtures following DHH's Rails testing style. The 37signals convention requires minimal Minitest fixtures rather than expansive testing setups or external testing frameworks to validate application behavior.

When should I use Current attributes in Rails models?

Use Current attributes in Rails models as a default pattern for managing request-scoped context like the current user. This DHH convention replaces passing parameters explicitly through service layers or controller methods.