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.
Implements Hotwire patterns for interactive Rails UIs using Turbo Frames, Turbo Streams, and Stimulus controllers.
npx claudepluginhub chaserx/cpcThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/stimulus-patterns.mdreferences/turbo-frames-patterns.mdreferences/turbo-streams-patterns.mdHotwire (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+)Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.
Search, retrieve, and install Agent Skills from the prompts.chat registry using MCP tools. Use when the user asks to find skills, browse skill catalogs, install a skill for Claude, or extend Claude's capabilities with reusable AI agent components.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.