DHH Ruby/Rails Style

•
2.8k
•

Generates Ruby and Rails code embodying David Heinemeier Hansson's philosophy of clarity, convention, and developer happiness.

Adopt the opinionated and pragmatic coding style of David Heinemeier Hansson for Ruby and Rails applications. This skill provides comprehensive guidance on writing clear, conventional code, emphasizing REST purity, fat models, thin controllers, and modern Hotwire patterns. Use it to generate new code, refactor existing applications, or review code to ensure it aligns with the 37signals philosophy of developer happiness and clarity over cleverness.

主要功能

01Promotes a 'fat model, thin controller' architecture, placing business logic in models.
02Enforces REST purity with a strict seven-action controller pattern.
032,824 GitHub stars
04Guides the use of Current attributes for managing global request state cleanly.
05Integrates Hotwire and Turbo patterns, with broadcasting logic handled by models.
06Applies specific conventions for syntax, naming, and code formatting for maximum readability.

使用场景

01Refactoring an existing Rails codebase to improve clarity and align with modern conventions.
02Building a new Ruby on Rails application with a consistent, opinionated style.
03Performing code reviews to enforce the 37signals/Basecamp coding standards.