From rails-specialist
Use when adding interactive UI to a Rails application without custom JavaScript — inline editing, live updates, real-time notifications, or partial page navigation. Also applies when choosing between Turbo Frames, Turbo Streams, and Stimulus, or reviewing Hotwire implementation for correctness.
npx claudepluginhub chaserx/cpc --plugin rails-specialistThis skill uses the workspace's default tool permissions.
Hotwire (HTML Over The Wire) provides a modern approach to building interactive Rails applications with minimal JavaScript. It consists of Turbo (Drive, Frames, Streams) and Stimulus.
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
Hotwire (HTML Over The Wire) provides a modern approach to building interactive Rails applications with minimal JavaScript. It consists of Turbo (Drive, Frames, Streams) and Stimulus.
| Component | Purpose | When to Use |
|---|---|---|
| Turbo Drive | Full page navigation without reload | Default — enabled automatically |
| Turbo Frames | Independently updatable page sections | Inline editing, tabbed content, scoped navigation |
| Turbo Streams | Targeted DOM updates via CRUD actions | Multi-element updates from form submissions |
| ActionCable + Streams | Real-time server-pushed updates | Chat, notifications, live dashboards |
| Stimulus | Lightweight client-side behavior | Toggles, form feedback, debounced search |
Stimulus controllers add client-side behavior to HTML elements using data attributes.
data-controller="search" maps to search_controller.jsdata-search-target="input" accesses this.inputTargetdata-action="input->search#search" calls search() methoddata-search-url-value="/api/search" accesses this.urlValuedata-search-active-class="highlighted" accesses this.activeClassDeclare targets, values, and classes as static properties. Always implement disconnect() to clean up event listeners and timers.
Turbo Frames decompose pages into independently updatable sections. Key principles:
dom_id helper for unique, meaningful frame IDsdata-turbo-frame="_top" to break out of frame scope| Action | Description |
|---|---|
append | Add to end of container |
prepend | Add to beginning of container |
replace | Replace entire element |
update | Update content of element |
remove | Remove element |
before | Insert before element |
after | Insert after element |
morph | Morph element (Rails 7.1+) |
refresh | Reload page via morph (Rails 7.1+) |
Respond with format.turbo_stream in controllers. Use .turbo_stream.erb templates for complex responses, or render inline for simple cases.
name_controller.js)event->controller#method)disconnect() cleans up event listeners and timersdom_id helper)| Need | Solution |
|---|---|
| Navigate without reload | Turbo Drive (default) |
| Update part of a page | Turbo Frames |
| Multiple DOM updates | Turbo Streams |
| Real-time server push | ActionCable + Turbo Streams |
| Client-side behavior | Stimulus controller |
| Form with live updates | Turbo Frame wrapping form |
| Toast notifications | Turbo Stream append |
| Infinite scroll | Turbo Frame with lazy loading |
For detailed code examples and implementation patterns, consult:
references/stimulus-patterns.md — Stimulus controller examples (search, toggle, form feedback) and conventions tablereferences/turbo-frames-patterns.md — Turbo Frames examples (basic frames, lazy loading, inline editing, breaking out) and Turbo Drive configurationreferences/turbo-streams-patterns.md — Turbo Streams controller responses, templates, inline streams, ActionCable model broadcasting, custom broadcasting, and morphing (Rails 7.1+)