Skillshub rails-hotwire

Community Rails Hotwire Best Practices

install
source · Clone the upstream repo
git clone https://github.com/ComeOnOliver/skillshub
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ComeOnOliver/skillshub "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/pproenca/dot-skills/rails-hotwire" ~/.claude/skills/comeonoliver-skillshub-rails-hotwire && rm -rf "$T"
manifest: skills/pproenca/dot-skills/rails-hotwire/SKILL.md
source content

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 & DriveCRITICAL
drive-
2Turbo FramesCRITICAL
frame-
3Turbo StreamsHIGH
stream-
4Broadcasting & Real-TimeHIGH
bcast-
5Morphing & Page RefreshHIGH
morph-
6Performance OptimizationMEDIUM-HIGH
perf-
7Stimulus PatternsMEDIUM-HIGH
stim-
8Architecture DecisionsMEDIUM
arch-
9Testing HotwireMEDIUM
test-

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