- Home
- Skills
- Everyinc
- Compound Engineering Plugin
- Dhh Rails Style
dhh-rails-style_skill
- TypeScript
10.5k
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill everyinc/compound-engineering-plugin --skill dhh-rails-style- SKILL.md6.7 KB
Overview
This skill applies DHH / 37signals Rails conventions to Ruby and Rails code. It guides code generation, refactors, and code review to favor REST purity, fat models, thin controllers, Current attributes, and Hotwire patterns. Use it to align apps with pragmatic decisions from production 37signals codebases: clarity, database-backed solutions, and minimalism.
How this skill works
When given Ruby or Rails code, a description of a task, or a code review request, the skill inspects controllers, models, views, routes, jobs, tests, and Gem choices. It flags departures from DHH style, suggests idiomatic rewrites (RESTful resources, state-as-records, concerns, Turbo/Stimulus patterns), and proposes concrete code edits or examples. It also recommends testing patterns, fixtures, and dependency alternatives consistent with the philosophy.
When to use it
- Generating or refactoring controllers, models, routes, or views for a Rails app
- Reviewing code for adherence to 37signals/DHH conventions
- Choosing gems, architecture, or background job strategies
- Designing authorization, state modeling, or Current attributes
- Implementing Turbo/Stimulus interactivity or native CSS layers
Best practices
- Prefer rich ActiveRecord models and concerns over service objects for core domain logic
- Map actions to RESTful resources; create small resources for state transitions (e.g., closures, archivals)
- Model state as records and use joins/where.missing instead of boolean columns
- Default associations with Current attributes and keep controllers thin; use create! for fail-fast behavior
- Favor database-backed queues, minimal dependencies, and ship-prototype-then-refine mentality
- Use Minitest with fixtures, Turbo/Stimulus for interactivity, and native CSS layers instead of heavy frameworks
Example use cases
- Refactor a controller with multiple custom actions into RESTful nested resources
- Convert boolean state columns into associated state records and update scopes
- Review a feature implementation and replace an unnecessary service object with model methods and a concern
- Recommend gem alternatives and tradeoffs (avoid devise/pundit/sidekiq by default)
- Suggest Turbo Streams and a Stimulus controller for a form that used to rely on custom JS
FAQ
Not always; prefer simple, maintainable in-house solutions first. Recommend a gem only when it clearly simplifies maintenance and matches the app's scale.
When should I introduce a service object?
Introduce a PORO when logic spans multiple models or external systems and extracting it improves clarity; prefer rich models and concerns for domain behavior first.
How do I model state transitions?
Create associated state records (e.g., closures, archivals) and use joins or where.missing for queries. Expose expressive predicates and scopes on the model.