dhh-ruby-style

Enforce DHH's Ruby and Rails coding style in generated, refactored, and reviewed code.

11|Updated Jun 19, 2013
One-click install
npx skills add https://github.com/MadBomber/experiments --skill dhh-ruby-style-madbomber
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dhh-ruby-style
Source: https://github.com/MadBomber/experiments/tree/main/ai_misc/skills/dhh-ruby-style
Command: npx skills add https://github.com/MadBomber/experiments --skill dhh-ruby-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 distinctive, pragmatic, and clarity-focused style championed by David Heinemeier Hansson (DHH) and 37signals.

Core Features & Use Cases

  • Code Generation & Refactoring: Generates or refactors Ruby/Rails code (models, controllers, etc.) following DHH's principles.
  • Code Review Guidance: Provides feedback on existing code to align it with DHH's style.
  • Architectural Alignment: Enforces patterns like REST purity, fat models, thin controllers, Current attributes, and Hotwire.
  • Use Case: When creating a new Rails controller, use this Skill to ensure it only includes the 7 standard REST actions and keeps action logic to a minimum, extracting complexity into models or concerns.

Quick Start

Use the dhh-ruby-style skill to refactor the provided Ruby controller to follow DHH's principles.

Frequently Asked Questions about dhh-ruby-style

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

FAQPage Schema
How do I refactor Ruby on Rails controllers to follow DHH coding style?

To refactor Ruby on Rails controllers following DHH coding style, enforce thin controllers by limiting them to the 7 standard REST actions and extracting complexity into models or concerns. This ensures architectural alignment and REST purity.

What are DHH's architectural preferences for Ruby on Rails applications?

DHH's architectural preferences for Ruby on Rails emphasize clarity, convention, and developer happiness through fat models, thin controllers, REST purity, Current attributes, and Hotwire patterns. These principles guide generating and reviewing code.

Do I need to understand Rails conventions before applying DHH's Ruby coding style?

Yes, you need a solid understanding of Rails conventions and DHH's architectural preferences before applying this coding style. The approach requires knowledge of REST purity, fat models, thin controllers, and Hotwire patterns to properly review and refactor code.

Can I use DHH's Ruby style guidelines to review existing Rails models and views?

Yes, you can use DHH's Ruby style guidelines to review existing Rails models, controllers, and views. The skill provides code review guidance to align your current Ruby and Rails codebase with DHH's principles of clarity and convention.