dhh-rails-style

dhh-rails-style is a skill for Claude Code from tajmahal226/compound-engineering-plugin. It costs 115 tokens per session (1,631 once invoked), scanned A, a copy of dhh-rails-style, MIT.

A Ruby and Rails coding guide based on DHH’s style associated with 37signals, the company behind Basecamp and Ruby on Rails.

In plain words
What is it for?
Use it when writing or reviewing Ruby and Rails models, controllers, concerns, authentication, authorization, background work, APIs, and database rules.
Why use it?
It helps keep Rails applications straightforward by favoring built-in Rails features, direct database-backed designs, and code that is easy to understand.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the compound-engineering plugin — 20 skills, 17 commands, 1 MCP server shipped together

Good fit Use it when writing or reviewing Ruby and Rails models, controllers, concerns, authentication, authorization, background work, APIs, and database rules.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tajmahal226/compound-engineering-plugin/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 tajmahal226/compound-engineering-plugin --skill dhh-rails-style
Clone the repo
git clone --depth 1 https://github.com/tajmahal226/compound-engineering-plugin

Made for: Claude Code.

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

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/tajmahal226/compound-engineering-plugin/dhh-rails-style/github.svg)](https://agentmods.dev/skills/tajmahal226/compound-engineering-plugin/dhh-rails-style)
Your own site
<a href="https://agentmods.dev/skills/tajmahal226/compound-engineering-plugin/dhh-rails-style"><img src="https://agentmods.dev/badge/skills/tajmahal226/compound-engineering-plugin/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/tajmahal226/compound-engineering-plugin/dhh-rails-style"><img src="https://agentmods.dev/badge/skills/tajmahal226/compound-engineering-plugin/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 84% copy Near-identical to another mod 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 $0.00057 $0.00816
Sonnet 5 $0.00023 $0.00326
Haiku 4.5 $0.00012 $0.00163

Measured 11d ago against content hash 1e99ea5d4f78, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, 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 11d 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

This is a copy

84% identical to dhh-rails-style — 6 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

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. 11d 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 tajmahal226/compound-engineering-plugin (4 stars, last pushed 6mo ago), licensed MIT. It adds 115 tokens to every session and 1,631 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. It is 84% identical to dhh-rails-style, differing in 6 lines, and is treated as a copy.

Related

Other skills, from other repositories

rails-expert

Rails 7+ specialist that optimizes Active Record queries with includes/eagerload, implements Turbo Frames and Turbo Streams for partial page updates, configures Action Cable for WebSocket connections, sets up Sidekiq workers for background job processing, and writes comprehensive RSpec test suites. Use when building…

Jeffallan/claude-skills · 104 tokens

new

Create a new project to start development quickly.

clacky-ai/openclacky · 10 tokens

rails-conventions

Rootstrap Rails conventions. Use when writing, reviewing, or editing any Rails code — controllers, models, migrations, routes, views, mailers, initializers, locale files, or Rails config. Covers routing, ActiveRecord, migrations, i18n, time zones, mailers, assets, Bundler groups, and logging.

rootstrap/rails_api_base · 71 tokens

ruby-rails

Conventions and best practices for building web applications with Ruby on Rails. Use when scaffolding Rails apps or generators, designing ActiveRecord models and migrations, wiring up Hotwire/Turbo/Stimulus interactivity, setting up background jobs or caching, or writing RSpec/Minitest coverage for Rails code.

Mindrally/skills · 65 tokens

ruby-expert

Expert-level Ruby development with Rails, modern features, testing, and best practices. Use when the user mentions Ruby on Rails, RSpec, gem, Sinatra, or metaprogramming, or when the task involves Ruby 3+ Features, Object-Oriented, Functional Features, or Pattern Matching.

personamanagmentlayer/pcl · 64 tokens

rails-dev

Opinionated Rails conventions: rich models, concerns, CRUD-everything, state-as-records, minimal dependencies, Minitest with fixtures. Load this skill BEFORE any code-level thinking, not only before editing a file. It is required the moment a task touches Rails code in ANY way: designing or even just discussing a data…

tech-leads-club/agent-skills · 199 tokens