mcpField
R
rails-hotwire

rails-hotwire

github.com/pproencaDevelopment218374 installsUpdated 11w ago
Repository

About rails-hotwire

A reference skill for building interactive Rails applications with Hotwire, covering Turbo and Stimulus practices. Its prioritized rules guide navigation, real-time updates, architecture choices, performance, and testing.

Key features

  1. 0153 rules across nine categories
  2. 02Turbo Drive, Frames, and Streams guidance
  3. 03Broadcasting and page morphing practices
  4. 04Stimulus, architecture, and testing advice

Use cases

  1. 01Configure Turbo navigation and caching
  2. 02Add partial updates and lazy-loaded frames
  3. 03Deliver real-time updates over ActionCable
  4. 04Test Hotwire interactions

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pproenca/dot-skills --skill rails-hotwire

After installing, type/rails-hotwirein Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

metadata.json
assets/templates/
_template.md
references/
_sections.md
arch-avoid-client-state.md
arch-frame-vs-stream-decision.md
arch-importmap-management.md
arch-progressive-enhancement.md
arch-stimulus-boundaries.md
bcast-avoid-view-logic-in-models.md
bcast-debounce-n1.md
bcast-model-broadcasts.md
bcast-reconnect-handling.md
bcast-refresh-over-replace.md
bcast-scope-streams.md
bcast-signed-stream-names.md
drive-cache-control.md
drive-confirm-dialog.md
drive-error-recovery.md
drive-form-submissions.md
drive-prefetch-links.md
drive-progress-bar.md
drive-selective-disable.md
drive-visit-actions.md
frame-break-out.md
frame-dom-id.md
frame-empty-state.md
frame-lazy-loading.md
frame-promote-visits.md
frame-scope-navigation.md
frame-src-navigation.md

Details

From the project README

Community Rails Hotwire Best Practices

Comprehensive guide for building interactive Rails applications with Hotwire (Turbo + Stimulus), maintained by Community. Contains 53 rules across 9 categories, prioritized by impact to guide automated refactoring and code generation. Follows the DHH "One Person Framework" philosophy: the server renders HTML, Turbo makes it feel like an SPA, Stimulus adds the sprinkle of JS where needed.

When to Apply

Reference these guidelines when:

  • Configuring Turbo Drive navigation, prefetching, and caching behavior
  • Adding Turbo Frames for partial page updates and lazy loading
  • Delivering Turbo Streams for surgical DOM mutations
  • Broadcasting real-time updates over ActionCable
  • Enabling Turbo 8 morphing for page refreshes
  • Writing Stimulus controllers for client-side behavior
  • Handling errors in Turbo navigation, frames, and WebSocket connections
  • Choosing between Drive, Frames, Streams, Morphing, and Stimulus
  • Testing Hotwire interactions in system and integration tests

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Navigation & DriveCRITICALdrive-
2Turbo FramesCRITICALframe-
3Turbo StreamsHIGHstream-
4Broadcasting & Real-TimeHIGHbcast-
5Morphing & Page RefreshHIGHmorph-
6Performance OptimizationMEDIUM-HIGHperf-
7Stimulus PatternsMEDIUM-HIGHstim-
8Architecture DecisionsMEDIUMarch-
9Testing HotwireMEDIUMtest-

Quick Reference

1. Navigation & Drive (CRITICAL)
2. Turbo Frames (CRITICAL)
3. Turbo Streams (HIGH)
4. Broadcasting & Real-Time (HIGH)
5. Morphing & Page Refresh (HIGH)
6. Performance Optimization (MEDIUM-HIGH)
7. Stimulus Patterns (MEDIUM-HIGH)
8. Architecture Decisions (MEDIUM)
9. Testing Hotwire (MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information

Comments

Markdown supported