dhh-rails-style

Apply DHH and 37signals Rails conventions to Ruby code.

11|Updated Jun 19, 2013
One-click install
npx skills add https://github.com/MadBomber/experiments --skill dhh-rails-style-madbomber
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dhh-rails-style
Source: https://github.com/MadBomber/experiments/tree/main/ai_misc/skills/dhh-rails-style
Command: npx skills add https://github.com/MadBomber/experiments --skill dhh-rails-style-madbomber

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers write Ruby and Rails code that adheres to the established conventions and philosophies of David Heinemeier Hansson (DHH) and 37signals, promoting clarity, maintainability, and efficiency.

Core Features & Use Cases

  • Code Generation & Refactoring: Apply DHH's principles to new code or refactor existing codebases.
  • Rails Architecture Guidance: Understand and implement patterns like fat models, thin controllers, REST purity, and Hotwire.
  • Use Case: You're building a new feature in a Rails app and want to ensure your models are rich, controllers are lean, and you're leveraging Turbo for frontend updates in the most idiomatic way.

Quick Start

Apply DHH's Rails conventions to the provided Ruby code snippet.

Frequently Asked Questions about dhh-rails-style

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

FAQPage Schema
How do I write idiomatic Ruby on Rails code following DHH conventions?

Idiomatic Rails code following DHH conventions prioritizes clarity over cleverness by using fat models, thin controllers, REST purity, and Current attributes to keep controllers lean and models rich.

What is the best way to structure a Rails controller to keep it thin?

The best way to keep a Rails controller thin is by pushing business logic into fat models and using Current attributes, ensuring controllers handle only RESTful routing and request management.

How do I refactor existing Ruby code to match 37signals production patterns?

Refactoring Ruby code to match 37signals patterns involves applying vanilla Rails solutions, embracing Hotwire for frontend updates, and favoring REST purity and clarity over clever implementations.

When should I use Hotwire and Turbo in my Rails application?

You should use Hotwire and Turbo in your Rails application when implementing frontend updates idiomatically, adhering to DHH's pattern of leveraging vanilla Rails solutions for dynamic page interactions.

Does vanilla Rails favor fat models and thin controllers over service objects?

Yes, vanilla Rails favors fat models and thin controllers over service objects, adhering to 37signals conventions that prioritize clarity and REST purity without adding unnecessary architectural abstractions.

Why does DHH prefer vanilla Rails solutions over custom architectural patterns?

DHH prefers vanilla Rails solutions because they prioritize clarity over cleverness, ensuring maintainability and efficiency by relying on built-in conventions like REST and fat models instead of custom patterns.