dhh-rails-style

Apply DHH and 37signals Rails conventions to Ruby code.

240|75|Updated Jul 13, 2023
One-click install
npx skills add https://github.com/udecode/plate-playground-template --skill dhh-rails-style-udecode
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dhh-rails-style
Source: https://github.com/udecode/plate-playground-template/tree/main/.codex/skills/dhh-rails-style
Command: npx skills add https://github.com/udecode/plate-playground-template --skill dhh-rails-style-udecode

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps developers write Ruby and Rails code that adheres to the distinctive, pragmatic, and efficient style championed by David Heinemeier Hansson (DHH) and 37signals.

Core Features & Use Cases

  • Code Generation & Refactoring: Generates Ruby/Rails code following DHH's principles (e.g., fat models, thin controllers, REST purity).
  • Code Review: Analyzes existing code against DHH's conventions, providing actionable feedback.
  • Guidance on Best Practices: Offers insights into preferred gems, architectural patterns, and testing strategies.
  • Use Case: A developer is unsure how to implement a new feature in a Rails application and wants to ensure it aligns with the 37signals philosophy, avoiding common "over-engineering" pitfalls.

Quick Start

Use the dhh-rails-style skill to refactor the provided controller code to follow DHH 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 refactor Rails controllers to follow DHH's fat model and thin controller conventions?

To follow DHH's Rails conventions, refactor controllers by moving business logic into fat models and keeping controllers thin. This approach prioritizes REST purity and clarity over cleverness, ensuring Ruby code remains pragmatic and maintainable.

What are DHH's preferred Rails architectural patterns for avoiding over-engineering?

DHH's Rails conventions favor REST purity, Current attributes, and Hotwire patterns to avoid over-engineering. This philosophy emphasizes clarity over cleverness, utilizing fat models and thin controllers to keep application architecture simple and efficient.

Does this approach support code review for existing Ruby on Rails applications?

Yes, this approach analyzes existing Ruby and Rails code against 37signals conventions to provide actionable code review feedback. It evaluates whether your current implementation aligns with DHH's pragmatic style and offers guidance on preferred best practices.

Can I use Hotwire patterns and Current attributes when generating new Rails code?

Yes, you can generate Ruby and Rails code utilizing Hotwire patterns and Current attributes. These specific patterns are core components of the 37signals philosophy, ensuring new features align with DHH's distinctive and efficient coding style.

What is the best way to implement a new Rails feature following 37signals style?

The best way to implement a new Rails feature following 37signals style is to apply REST purity and the clarity over cleverness philosophy. This ensures your code generation and architectural decisions match DHH's pragmatic conventions and avoid common over-engineering pitfalls.

When should I not use DHH's Rails conventions in my Ruby application?

You should reconsider DHH's Rails conventions if your application requires heavy architectural patterns that deviate from REST purity or fat models. This approach intentionally avoids over-engineering, which may conflict with complex enterprise requirements outside the 37signals philosophy.