[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FEFFJZCAG2TZ67BEV15043":3,"skill-same:01M6FEFFJZCAG2TZ67BEV15043":48},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":21,"linkOnly":22,"markdownContent":23,"markdownBody":23,"frontMatter":24,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M6FEFFJZCAG2TZ67BEV15043","rails-hotwire",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fpproenca\u002Fdot-skills\u002Frails-hotwire\u002FSKILL.md",[],[18,19,20],"rails hotwire","rails","hotwire","2026-11-10 10:12:30",false,"# Community Rails Hotwire Best Practices\n\nComprehensive 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.\n\n## When to Apply\n\nReference these guidelines when:\n- Configuring Turbo Drive navigation, prefetching, and caching behavior\n- Adding Turbo Frames for partial page updates and lazy loading\n- Delivering Turbo Streams for surgical DOM mutations\n- Broadcasting real-time updates over ActionCable\n- Enabling Turbo 8 morphing for page refreshes\n- Writing Stimulus controllers for client-side behavior\n- Handling errors in Turbo navigation, frames, and WebSocket connections\n- Choosing between Drive, Frames, Streams, Morphing, and Stimulus\n- Testing Hotwire interactions in system and integration tests\n\n## Rule Categories by Priority\n\n| Priority | Category | Impact | Prefix |\n|----------|----------|--------|--------|\n| 1 | Navigation & Drive | CRITICAL | `drive-` |\n| 2 | Turbo Frames | CRITICAL | `frame-` |\n| 3 | Turbo Streams | HIGH | `stream-` |\n| 4 | Broadcasting & Real-Time | HIGH | `bcast-` |\n| 5 | Morphing & Page Refresh | HIGH | `morph-` |\n| 6 | Performance Optimization | MEDIUM-HIGH | `perf-` |\n| 7 | Stimulus Patterns | MEDIUM-HIGH | `stim-` |\n| 8 | Architecture Decisions | MEDIUM | `arch-` |\n| 9 | Testing Hotwire | MEDIUM | `test-` |\n\n## Quick Reference\n\n### 1. Navigation & Drive (CRITICAL)\n\n- [`drive-prefetch-links`](references\u002Fdrive-prefetch-links.md) - Enable link prefetching for instant navigation\n- [`drive-form-submissions`](references\u002Fdrive-form-submissions.md) - Use Turbo Drive for form submissions\n- [`drive-visit-actions`](references\u002Fdrive-visit-actions.md) - Control history with visit actions\n- [`drive-cache-control`](references\u002Fdrive-cache-control.md) - Configure Turbo cache for preview pages\n- [`drive-selective-disable`](references\u002Fdrive-selective-disable.md) - Disable Turbo Drive on incompatible pages\n- [`drive-progress-bar`](references\u002Fdrive-progress-bar.md) - Customize the Turbo progress bar\n- [`drive-confirm-dialog`](references\u002Fdrive-confirm-dialog.md) - Use data-turbo-confirm for destructive actions\n- [`drive-error-recovery`](references\u002Fdrive-error-recovery.md) - Handle Turbo navigation and fetch errors gracefully\n\n### 2. Turbo Frames (CRITICAL)\n\n- [`frame-lazy-loading`](references\u002Fframe-lazy-loading.md) - Defer frame loading until viewport entry\n- [`frame-scope-navigation`](references\u002Fframe-scope-navigation.md) - Scope navigation within frames\n- [`frame-src-navigation`](references\u002Fframe-src-navigation.md) - Use src for dynamic frame content\n- [`frame-break-out`](references\u002Fframe-break-out.md) - Handle frame breakout for redirects\n- [`frame-promote-visits`](references\u002Fframe-promote-visits.md) - Promote frame navigation to page visits\n- [`frame-dom-id`](references\u002Fframe-dom-id.md) - Use dom_id for frame identification\n- [`frame-empty-state`](references\u002Fframe-empty-state.md) - Provide meaningful frame loading states\n\n### 3. Turbo Streams (HIGH)\n\n- [`stream-progressive-enhance`](references\u002Fstream-progressive-enhance.md) - Always provide HTML fallback for streams\n- [`stream-action-selection`](references\u002Fstream-action-selection.md) - Choose the right stream action for DOM mutations\n- [`stream-multi-target`](references\u002Fstream-multi-target.md) - Use targets for multi-element updates\n- [`stream-http-delivery`](references\u002Fstream-http-delivery.md) - Deliver streams via HTTP for form responses\n- [`stream-websocket-source`](references\u002Fstream-websocket-source.md) - Connect WebSocket sources in the body\n- [`stream-custom-actions`](references\u002Fstream-custom-actions.md) - Register custom stream actions for complex DOM updates\n\n### 4. Broadcasting & Real-Time (HIGH)\n\n- [`bcast-model-broadcasts`](references\u002Fbcast-model-broadcasts.md) - Use broadcasts_refreshes for simple model updates\n- [`bcast-debounce-n1`](references\u002Fbcast-debounce-n1.md) - Debounce broadcasts to prevent N+1 broadcast storms\n- [`bcast-scope-streams`](references\u002Fbcast-scope-streams.md) - Scope broadcast streams to accounts or users\n- [`bcast-refresh-over-replace`](references\u002Fbcast-refresh-over-replace.md) - Prefer broadcast refresh over granular stream updates\n- [`bcast-avoid-view-logic-in-models`](references\u002Fbcast-avoid-view-logic-in-models.md) - Keep broadcasting logic out of models\n- [`bcast-signed-stream-names`](references\u002Fbcast-signed-stream-names.md) - Use signed stream names for security\n- [`bcast-reconnect-handling`](references\u002Fbcast-reconnect-handling.md) - Handle WebSocket disconnection and reconnection\n\n### 5. Morphing & Page Refresh (HIGH)\n\n- [`morph-enable-page-refresh`](references\u002Fmorph-enable-page-refresh.md) - Enable morphing for page refreshes\n- [`morph-permanent-elements`](references\u002Fmorph-permanent-elements.md) - Mark stateful elements as permanent\n- [`morph-scroll-preservation`](references\u002Fmorph-scroll-preservation.md) - Preserve scroll position during morphing\n- [`morph-stimulus-reconnect`](references\u002Fmorph-stimulus-reconnect.md) - Handle Stimulus controller reconnection after morph\n- [`morph-frame-refresh`](references\u002Fmorph-frame-refresh.md) - Use refresh='morph' on frames for additive content\n- [`morph-vs-streams`](references\u002Fmorph-vs-streams.md) - Choose morphing over complex stream orchestration\n\n### 6. Performance Optimization (MEDIUM-HIGH)\n\n- [`perf-optimistic-ui`](references\u002Fperf-optimistic-ui.md) - Implement optimistic UI updates before server confirmation\n- [`perf-batch-streams`](references\u002Fperf-batch-streams.md) - Batch multiple stream updates into single responses\n- [`perf-frame-caching`](references\u002Fperf-frame-caching.md) - Cache Turbo Frame responses with fragment caching\n- [`perf-prefetch-strategic`](references\u002Fperf-prefetch-strategic.md) - Disable prefetch on expensive endpoints\n- [`perf-memory-leak-prevention`](references\u002Fperf-memory-leak-prevention.md) - Clean up subscriptions and event listeners\n\n### 7. Stimulus Patterns (MEDIUM-HIGH)\n\n- [`stim-outlets-communication`](references\u002Fstim-outlets-communication.md) - Use outlets for cross-controller communication\n- [`stim-values-reactive-state`](references\u002Fstim-values-reactive-state.md) - Use Values API for reactive controller state\n- [`stim-action-descriptors`](references\u002Fstim-action-descriptors.md) - Use declarative action descriptors over addEventListener\n- [`stim-small-reusable-controllers`](references\u002Fstim-small-reusable-controllers.md) - Keep Stimulus controllers small and reusable\n\n### 8. Architecture Decisions (MEDIUM)\n\n- [`arch-progressive-enhancement`](references\u002Farch-progressive-enhancement.md) - Follow the progressive enhancement hierarchy\n- [`arch-frame-vs-stream-decision`](references\u002Farch-frame-vs-stream-decision.md) - Use frames for scoped navigation, streams for multi-target updates\n- [`arch-importmap-management`](references\u002Farch-importmap-management.md) - Pin JavaScript dependencies with import maps\n- [`arch-avoid-client-state`](references\u002Farch-avoid-client-state.md) - Keep state on the server, not the client\n- [`arch-stimulus-boundaries`](references\u002Farch-stimulus-boundaries.md) - Use Stimulus only for client-side behavior\n\n### 9. Testing Hotwire (MEDIUM)\n\n- [`test-system-test-async`](references\u002Ftest-system-test-async.md) - Wait for Turbo updates in system tests\n- [`test-stream-assertions`](references\u002Ftest-stream-assertions.md) - Use Turbo Stream test helpers in integration tests\n- [`test-broadcast-assertions`](references\u002Ftest-broadcast-assertions.md) - Assert broadcasts with Turbo test helpers\n- [`test-frame-navigation`](references\u002Ftest-frame-navigation.md) - Test frame navigation with scoped assertions\n- [`test-websocket-timing`](references\u002Ftest-websocket-timing.md) - Handle WebSocket connection timing in system tests\n\n## How to Use\n\nRead individual reference files for detailed explanations and code examples:\n\n- [Section definitions](references\u002F_sections.md) - Category structure and impact levels\n- [Rule template](assets\u002Ftemplates\u002F_template.md) - Template for adding new rules\n\n## Reference Files\n\n| File | Description |\n|------|-------------|\n| [references\u002F_sections.md](references\u002F_sections.md) | Category definitions and ordering |\n| [assets\u002Ftemplates\u002F_template.md](assets\u002Ftemplates\u002F_template.md) | Template for new rules |\n| [metadata.json](metadata.json) | Version and reference information |\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Fpproenca\u002Fdot-skills\u002Frails-hotwire",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill rails-hotwire",{"tool":40,"command":41},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill rails-hotwire",{"tool":43,"command":44},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill rails-hotwire","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fpproenca\u002Fdot-skills\u002Frails-hotwire\u002FSKILL.md",true,[],[49,58,67,76,82,88],{"skillNo":50,"name":51,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":21},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[55,56,57],"model","model hierarchy","model hierarchy skill",{"skillNo":59,"name":60,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":21},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[64,65,66],"MCP","zoom","zoom mcp",{"skillNo":68,"name":69,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":21},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[73,74,75,65],"sdk","zoom apps sdk","apps",{"skillNo":77,"name":78,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":21},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[78],{"skillNo":83,"name":84,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":21},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[84],{"skillNo":89,"name":90,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":21},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[90]]