dhh-rails-style

Apply DHH Rails conventions to Ruby and Rails codebases.

1|Updated Jan 11, 2025
One-click install
npx skills add https://github.com/krbylit/dotfiles --skill dhh-rails-style-krbylit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dhh-rails-style
Source: https://github.com/krbylit/dotfiles/tree/main/cm-util/pkg-backups/beads-compound/0.6.8/gemini/skills/dhh-rails-style
Command: npx skills add https://github.com/krbylit/dotfiles --skill dhh-rails-style-krbylit

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill helps Ruby and Rails teams apply DHH's 37signals style consistently across codebases, reducing stylistic drift and improving maintainability.

Core Features & Use Cases

  • RESTful Controllers: Prefer CRUD controllers and resource-oriented routing over custom actions.
  • Model-centric Design: Encourage fat models with concerns and POROs, avoiding overuse of service objects.
  • Code Review Guidance: Provides a checklist to audit for DHH patterns during reviews and refactors.
  • Guided Architecture: Emphasizes database-backed design, Current attributes, and Turbo/Stimulus integration.
  • Consistency Across Layers: Ensures alignment between models, controllers, and views with Rails-first patterns.

Quick Start

Describe your Ruby or Rails task and I will apply DHH Rails style guidance.

Frequently Asked Questions about dhh-rails-style

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

FAQPage Schema
How do I apply DHH Rails style to my Ruby codebase during a refactor?

Apply DHH Rails style by preferring RESTful controllers, fat models using concerns and POROs, and thin controllers. This ensures alignment with Rails-first patterns and reduces stylistic drift across your codebase.

What is the best way to structure Rails controllers following DHH conventions?

Structure Rails controllers following DHH conventions by preferring CRUD actions and resource-oriented routing over custom actions. This RESTful approach keeps controllers thin and maintains domain-model-centric design.

Does DHH Rails style encourage service objects for domain logic?

DHH Rails style discourages overusing service objects for domain logic. Instead, it promotes fat models using concerns and POROs to maintain a domain-model-centric design within your Rails application.

Can I use DHH Rails style guidance for code reviews?

Yes, you can use DHH Rails style guidance for code reviews. It provides a checklist to audit Ruby code for DHH patterns, ensuring compatibility with tests and proper Turbo/Stimulus integration across views and controllers.

When do I need to use concerns and Current attributes in Rails?

Use concerns and Current attributes in Rails when adopting a database-backed, domain-model-centric design. This approach is central to DHH Rails style, ensuring guided architecture and consistency across your application layers.