dhh-rails-style

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

A set of coding guidelines for Ruby and Rails applications based on DHH's style, associated with the creators of the Ruby on Rails framework. It favors straightforward Rails features, domain models, CRUD controllers, and database-backed designs.

In plain words
What is it for?
Writing, reviewing, or refactoring Ruby and Rails code, including models, controllers, concerns, database rules, authentication, and web responses.
Why use it?
It provides consistent design choices for Rails work and helps avoid adding extra libraries or layers when the framework already supports the needed behavior.

Skill for Claude Code

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

Part of the compound-engineering plugin — 41 skills, 1 MCP server shipped together

Good fit Writing, reviewing, or refactoring Ruby and Rails code, including models, controllers, concerns, database rules, authentication, and web responses.

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

Made for: Claude Code.

Or install compound-engineering, the plugin that ships this one along with the rest of its 41 skills, 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/gvkhosla/compound-engineering-pi/dhh-rails-style/github.svg)](https://agentmods.dev/skills/gvkhosla/compound-engineering-pi/dhh-rails-style)
Your own site
<a href="https://agentmods.dev/skills/gvkhosla/compound-engineering-pi/dhh-rails-style"><img src="https://agentmods.dev/badge/skills/gvkhosla/compound-engineering-pi/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/gvkhosla/compound-engineering-pi/dhh-rails-style"><img src="https://agentmods.dev/badge/skills/gvkhosla/compound-engineering-pi/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-10, 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 gvkhosla/compound-engineering-pi (51 stars, last pushed 4mo 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

openapi-to-typescript

Converts OpenAPI 3.0 JSON/YAML to TypeScript interfaces and type guards. This skill should be used when the user asks to generate types from OpenAPI, convert schema to TS, create API interfaces, or generate TypeScript types from an API specification.

softaworks/agent-toolkit · 60 tokens

write-swift

How to write modern Swift well — modeling with value types, Swift 6 data-race safety and approachable concurrency (@concurrent, main-actor-by-default, actors, task groups), protocols and generics (some vs any), API design, performance and ARC, Swift Testing, macros, and the modern language features agents don't know…

wangmiaozero/pi-harness · 107 tokens

migrate-to-shoehorn

Migrate test files from as type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace as in tests, or needs partial test data.

wangmiaozero/pi-harness · 48 tokens

pi-dev-workflow

Como configurar o workflow de desenvolvimento de extensões e pacotes pi. Use quando o usuário estiver desenvolvendo extensões em um monorepo, precisar alternar entre código local e pacotes publicados, ou tiver conflitos de carregamento de pacotes.

aretw0/agents-lab · 55 tokens

Ruby Patterns

Use this skill when working in Ruby projects (Rails or otherwise) and you want clean object boundaries, predictable dependency management, and maintainable code organization.

AmariahAK/atlarix-skills · 2 tokens

create-pi-extension

Como criar uma extensão TypeScript para pi. Use quando o usuário precisar de hooks, tools customizadas, UI no TUI, ou persistência de estado.

aretw0/agents-lab · 37 tokens