dhh-rails-style

dhh-rails-style is a skill for Claude Code from davekilleen/Dex. It costs 115 tokens per session (1,631 once invoked), scanned A, original, MIT.

A guide for writing Ruby and Rails code in the style associated with DHH and 37signals. Rails is a Ruby framework for building web applications.

In plain words
What is it for?
Use it when creating or reviewing Ruby files, Rails models, controllers, and other Rails application code.
Why use it?
It provides consistent guidance for code written in that particular style across new work, refactoring, and reviews.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Part of the compound-engineering plugin — 17 skills, 19 commands shipped together

Good fit Use it when creating or reviewing Ruby files, Rails models, controllers, and other Rails application code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/davekilleen/dex/dhh-rails-style
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add davekilleen/Dex --skill dhh-rails-style
Clone the repo
git clone --depth 1 https://github.com/davekilleen/Dex

Made for: Claude Code.

Or install compound-engineering, the plugin that ships this one along with the rest of its 17 skills, 19 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for dhh-rails-style

README.md
[![agentmods](https://agentmods.dev/badge/skills/davekilleen/dex/dhh-rails-style/github.svg)](https://agentmods.dev/skills/davekilleen/dex/dhh-rails-style)
Your own site
<a href="https://agentmods.dev/skills/davekilleen/dex/dhh-rails-style"><img src="https://agentmods.dev/badge/skills/davekilleen/dex/dhh-rails-style/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for dhh-rails-style

Your own site · 80×15
<a href="https://agentmods.dev/skills/davekilleen/dex/dhh-rails-style"><img src="https://agentmods.dev/badge/skills/davekilleen/dex/dhh-rails-style.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 115 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,631 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00115 $0.01631
Opus 5.5 $0.00046 $0.00652
Sonnet 5.5 $0.00023 $0.00326
Haiku 4.5 $0.00012 $0.00163

Measured 1mo ago against content hash 1e99ea5d4f78, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

dhh-rails-style scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

4 near-identical copies found in the catalogue:

.claude/plugins/compound-engineering/skills/dhh-rails-style/SKILL.md · 186 lines

How it starts

The opening of the file, as written. The whole thing — 186 lines — stays where its author put it; the contents beside it link to each section on GitHub.

<essential_principles>

Core Philosophy

"The best code is the code you don't write. The second best is the code that's obviously correct."

Vanilla Rails is plenty:

  • Rich domain models over service objects
  • CRUD controllers over custom actions
  • Concerns for horizontal code sharing
  • Records as state instead of boolean columns
  • Database-backed everything (no Redis)
  • Build solutions before reaching for gems

What they deliberately avoid:

  • devise (custom ~150-line auth instead)
  • pundit/cancancan (simple role checks in models)
  • sidekiq (Solid Queue uses database)
  • redis (database for everything)
  • view_component (partials work fine)
  • GraphQL (REST with Turbo sufficient)
  • factory_bot (fixtures are simpler)
  • rspec (Minitest ships with Rails)
  • Tailwind (native CSS with layers)

Development Philosophy:

  • Ship, Validate, Refine - prototype-quality code to production to learn
  • Fix root causes, not symptoms
  • Write-time operations over read-time computations
  • Database constraints over ActiveRecord validations </essential_principles>
  1. Controllers - REST mapping, concerns, Turbo responses, API patterns
  2. Models - Concerns, state records, callbacks, scopes, POROs
  3. Views & Frontend - Turbo, Stimulus, CSS, partials
  4. Architecture - Routing, multi-tenancy, authentication, jobs, caching
  5. Testing - Minitest, fixtures, integration tests
  6. Gems & Dependencies - What to use vs avoid
  7. Code Review - Review code against DHH style
  8. General Guidance - Philosophy and conventions

Specify a number or describe your task.

Response Reference to Read
1, controller controllers.md
2, model models.md
3, view, frontend, turbo, stimulus, css frontend.md
4, architecture, routing, auth, job, cache architecture.md
5, test, testing, minitest, fixture testing.md
6, gem, dependency, library gems.md
7, review Read all references, then review code
8, general task Read relevant references based on context

After reading relevant references, apply patterns to the user's code.

<quick_reference>

Read the full file on GitHub · 186 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 186 lines · 115 tokens per session scan A 1e99ea5d4f78

Subscribe to this mod's changes

dhh-rails-style is a skill published in the GitHub repository davekilleen/Dex (508 stars, last pushed 3d ago), licensed MIT. It adds 115 tokens to every session and 1,631 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

fastapi-templates

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

wshobson/agents · 37 tokens

temporal-python-testing

Test Temporal workflows with pytest, time-skipping, and mocking strategies. Covers unit testing, integration testing, replay testing, and local development setup. Use when implementing Temporal workflow tests or debugging test failures.

wshobson/agents · 45 tokens

rubyllm

Build and maintain Ruby or Rails applications with the RubyLLM AI framework. Use for chats, agents, tools, MCP servers, structured output, judgments, evaluations, media generation, transcription, OCR, moderation, embeddings, reranking, tracing, Rails integration, and RubyLLM upgrades; not for contributing to the…

crmne/ruby_llm · 70 tokens

programming

Applies strict, modern language practice (typed errors, exhaustive match, tests that can fail) for Python, Rust, TypeScript, JavaScript, and Go. Use for work on .py, .rs, .ts, .js, or .go files.

code-yeongyu/oh-my-openagent · 57 tokens

ruby

Ruby development guidelines covering idiomatic code style, Ruby 3.x features, testing with RSpec, and best practices for building maintainable Ruby applications.

Mindrally/skills · 32 tokens

ruby-patterns

Ruby/Rails: blocks, metaprogramming, ActiveRecord, Sidekiq, RSpec, Sorbet, Hanami. Triggers: Ruby, Rails, ActiveRecord, Sidekiq, RSpec, Gemfile, bundler, Hanami, Sorbet.

softspark/ai-toolkit · 60 tokens