dhh-ruby-style
Write Ruby and Rails code in DHH's distinctive 37signals style. Use this skill when writing Ruby code, Rails applications, creating models, controllers, or any Ruby file.
Install / Use
npx skills add Microck/ordinary-claude-skills --skill dhh-ruby-styleInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Content & MediaSupported Platforms
Our assessment of dhh-ruby-style
dhh-ruby-style scores 83/100 on our quality scale, 899th of 1,187 Content & Media skills we index.
Its SKILL.md is 5.6 KB long, well organised into 23 sections with 7 code examples: a solid amount of guidance for an agent.
It has 399 GitHub stars, a meaningful sign that others use it.
Maintenance, license and trust
- The repository was last updated 30 days ago, so dhh-ruby-style is actively maintained.
- No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
- Its trust signals score 88/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
dhh-ruby-style compared with similar skills
All 4 of these similar skills score higher than dhh-ruby-style; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| dhh-ruby-style (this skill)by Microck | 83 | 399 | 30d ago | SKILL.md |
| siyuanby siyuan-note | 100 | 46.6k | today | MCP Server |
| algorithmic-artby anthropics | 100 | 177.9k | 14d ago | SKILL.md |
| pptxby anthropics | 100 | 177.9k | 14d ago | SKILL.md |
| designby nextlevelbuilder | 100 | 130.2k | 15d ago | SKILL.md |
Frequently asked questions
- How do I install dhh-ruby-style?
- Run
npx skills add Microck/ordinary-claude-skills --skill dhh-ruby-style. The install tabs above show the steps for each supported agent. - Which AI agents does dhh-ruby-style work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is dhh-ruby-style safe to use?
- It declares no license and scores 88/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is dhh-ruby-style still maintained?
- The repository was last updated 30 days ago, so dhh-ruby-style is actively maintained.
Skill content
View source on GitHubname: dhh-ruby-style description: Write Ruby and Rails code in DHH's distinctive 37signals style. Use this skill when writing Ruby code, Rails applications, creating models, controllers, or any Ruby file. Triggers on Ruby/Rails code generation, refactoring requests, code review, or when the user mentions DHH, 37signals, Basecamp, HEY, or Campfire style. Embodies REST purity, fat models, thin controllers, Current attributes, Hotwire patterns, and the "clarity over cleverness" philosophy.
DHH Ruby/Rails Style Guide
Write Ruby and Rails code following DHH's philosophy: clarity over cleverness, convention over configuration, developer happiness above all.
Quick Reference
Controller Actions
- Only 7 REST actions:
index,show,new,create,edit,update,destroy - New behavior? Create a new controller, not a custom action
- Action length: 1-5 lines maximum
- Empty actions are fine: Let Rails convention handle rendering
class MessagesController < ApplicationController
before_action :set_message, only: %i[ show edit update destroy ]
def index
@messages = @room.messages.with_creator.last_page
fresh_when @messages
end
def show
end
def create
@message = @room.messages.create_with_attachment!(message_params)
@message.broadcast_create
end
private
def set_message
@message = @room.messages.find(params[:id])
end
def message_params
params.require(:message).permit(:body, :attachment)
end
end
Private Method Indentation
Indent private methods one level under private keyword:
private
def set_message
@message = Message.find(params[:id])
end
def message_params
params.require(:message).permit(:body)
end
Model Design (Fat Models)
Models own business logic, authorization, and broadcasting:
class Message < ApplicationRecord
belongs_to :room
belongs_to :creator, class_name: "User"
has_many :mentions
scope :with_creator, -> { includes(:creator) }
scope :page_before, ->(cursor) { where("id < ?", cursor.id).order(id: :desc).limit(50) }
def broadcast_create
broadcast_append_to room, :messages, target: "messages"
end
def mentionees
mentions.includes(:user).map(&:user)
end
end
class User < ApplicationRecord
def can_administer?(message)
message.creator == self || admin?
end
end
Current Attributes
Use Current for request context, never pass current_user everywhere:
class Current < ActiveSupport::CurrentAttributes
attribute :user, :session
end
# Usage anywhere in app
Current.user.can_administer?(@message)
Ruby Syntax Preferences
# Symbol arrays with spaces inside brackets
before_action :set_message, only: %i[ show edit update destroy ]
# Modern hash syntax exclusively
params.require(:message).permit(:body, :attachment)
# Single-line blocks with braces
users.each { |user| user.notify }
# Ternaries for simple conditionals
@room.direct? ? @room.users : @message.mentionees
# Bang methods for fail-fast
@message = Message.create!(params)
@message.update!(message_params)
# Predicate methods with question marks
@room.direct?
user.can_administer?(@message)
@messages.any?
# Expression-less case for cleaner conditionals
case
when params[:before].present?
@room.messages.page_before(params[:before])
when params[:after].present?
@room.messages.page_after(params[:after])
else
@room.messages.last_page
end
Naming Conventions
| Element | Convention | Example |
|---------|------------|---------|
| Setter methods | set_ prefix | set_message, set_room |
| Parameter methods | {model}_params | message_params |
| Association names | Semantic, not generic | creator not user |
| Scopes | Chainable, descriptive | with_creator, page_before |
| Predicates | End with ? | direct?, can_administer? |
Hotwire/Turbo Patterns
Broadcasting is model responsibility:
# In model
def broadcast_create
broadcast_append_to room, :messages, target: "messages"
end
# In controller
@message.broadcast_replace_to @room, :messages,
target: [ @message, :presentation ],
partial: "messages/presentation",
attributes: { maintain_scroll: true }
Error Handling
Rescue specific exceptions, fail fast with bang methods:
def create
@message = @room.messages.create_with_attachment!(message_params)
@message.broadcast_create
rescue ActiveRecord::RecordNotFound
render action: :room_not_found
end
Architecture Preferences
| Traditional | DHH Way | |-------------|---------| | PostgreSQL | SQLite (for single-tenant) | | Redis + Sidekiq | Solid Queue | | Redis cache | Solid Cache | | Kubernetes | Single Docker container | | Service objects | Fat models | | Policy objects (Pundit) | Authorization on User model | | FactoryBot | Fixtures |
Detailed References
For comprehensive patterns and examples, see:
references/patterns.md- Complete code patterns with explanationsreferences/resources.md- Links to source material and further reading
Philosophy Summary
- REST purity: 7 actions only; new controllers for variations
- Fat models: Authorization, broadcasting, business logic in models
- Thin controllers: 1-5 line actions; extract complexity
- Convention over configuration: Empty methods, implicit rendering
- Minimal abstractions: No service objects for simple cases
- Current attributes: Thread-local request context everywhere
- Hotwire-first: Model-level broadcasting, Turbo Streams, Stimulus
- Readable code: Semantic naming, small methods, no comments needed
- Pragmatic testing: System tests over unit tests, real integrations
Related Skills
siyuan
46.6kAn open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
pptx
177.9kUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an em…
design
130.2kComprehensive design skill: brand identity, design tokens, UI styling, logo generation (55 styles, Gemini, Atlas Cloud, or MuAPI AI), corporate identity program (50 deliverables, CIP mockups), HTML presentations (Chart.js), banner design (22 styles, social/ads/web/print), icon design (15 styles, SVG…
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
