Agent skill
vanilla-rails
Use when building Rails + Hotwire applications - covers REST routing, thin controllers, rich models, Turbo Streams/Frames, and Stimulus patterns from 37signals
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/vanilla-rails
SKILL.md
Rails + Hotwire Patterns
Overview
Patterns from 37signals' approach to Rails development. Emphasizes REST purity, thin controllers calling rich models, and Hotwire for dynamic interfaces without heavy JavaScript.
Read vanilla-rails.md for complete patterns and examples (~3000 tokens).
When to Use This Skill
Use when working on Rails applications with Hotwire:
- Adding new routes, controllers, or actions
- Implementing Turbo Streams or Turbo Frames
- Writing Stimulus controllers
- Organizing model concerns
- Building real-time features with broadcasts
Quick Reference
Routing
Model actions as resources. Custom actions become nested resources:
# Instead of: post :close, :reopen on cards
resources :cards do
resource :closure # create = close, destroy = reopen
end
Controllers
Thin controllers call rich model methods:
class Cards::ClosuresController < ApplicationController
def create
@card.close(user: Current.user)
end
def destroy
@card.reopen(user: Current.user)
end
end
Models
Small, focused concerns. One behavior per concern:
class Card < ApplicationRecord
include Closeable, Watchable, Pinnable
end
Turbo Streams
Array-based DOM IDs for scoped targets:
<%= turbo_stream.replace [@card, :container], partial: "cards/container" %>
Stimulus
Private methods with #, dispatch events for coordination:
export default class extends Controller {
#timer
open() {
this.dispatch("show")
}
}
Core Principles
- REST purity - Actions are CRUD on resources
- Thin controllers - Controllers call models, models contain behavior
- Small concerns - One behavior per concern
- Turbo-first - Server renders HTML, Turbo handles updates
- Stimulus for sprinkles - JavaScript enhances, doesn't replace
Bottom Line
Read vanilla-rails.md for the complete guide. These patterns work together - routing informs controller design, controllers return Turbo Streams, Stimulus coordinates the UI.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?