hotwire
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "hotwire" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-65e675baffdb56f2829b22479b42aec7c7e96325889bba290def05c79ac274c0. Verify the upstream source and version against https://github.com/TerminalSkills/skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Hotwire (HTML Over The Wire) specialist: guidance on using Turbo (Drive, Frames, Streams) to send HTML instead of JSON for SPA-like navigation and partial updates, and using Stimulus for lightweight JavaScript behavior—building server-rendered apps that achieve near-SPA experiences with minimal client-side JavaScript.
Introduction source: third_party · TerminalSkills · 1.0.0 Reference
SkillPi interpretation
- Software, accounts and paid services
- import * as Turbo from "@hotwired/turbo"; import { Application } from "@hotwired/stimulus"; const application = Application.start(); ```
- Testing
- Not tested
Browse files
Frontmatter
name: hotwire
description: >-
You are an expert in Hotwire (HTML Over The Wire), the collection of
techniques for building modern web applications by sending HTML instead of
JSON. You help developers use Turbo (Drive, Frames, Streams) for SPA-like
navigation and partial updates, and Stimulus for lightweight JavaScript
behavior — building fast, server-rendered applications that feel like SPAs
with minimal client-side JavaScript.
license: Apache-2.0
compatibility: ''
metadata:
author: terminal-skills
version: 1.0.0
category: Web Frameworks
tags:
- html-over-the-wire
- turbo
- stimulus
- server-rendered
- rails
- django
- low-javascriptHotwire — HTML Over the Wire
You are an expert in Hotwire (HTML Over The Wire), the collection of techniques for building modern web applications by sending HTML instead of JSON. You help developers use Turbo (Drive, Frames, Streams) for SPA-like navigation and partial updates, and Stimulus for lightweight JavaScript behavior — building fast, server-rendered applications that feel like SPAs with minimal client-side JavaScript.
Core Capabilities
Turbo Drive (SPA-like navigation)
<!-- Turbo Drive is automatic — no configuration needed -->
<!-- All link clicks and form submissions are intercepted -->
<!-- Only the <body> is replaced; <head> assets are preserved -->
<!-- Opt out specific links -->
<a href="/external" data-turbo="false">External Link</a>
<!-- Prefetch on hover for instant navigation -->
<a href="/dashboard" data-turbo-prefetch="true">Dashboard</a>
<!-- Progress bar appears automatically during navigation -->
<style>
.turbo-progress-bar {
background-color: #6366f1;
height: 3px;
}
</style>
Turbo Frames (partial page updates)
<!-- Only the content inside matching turbo-frame is replaced -->
<turbo-frame id="messages">
<h2>Messages</h2>
<div class="message-list">
<!-- Messages rendered server-side -->
<div class="message">Hello from server!</div>
</div>
<!-- This link only updates THIS frame -->
<a href="/messages?page=2">Load more</a>
</turbo-frame>
<!-- Lazy-loaded frame (loads on page appear) -->
<turbo-frame id="notifications" src="/notifications" loading="lazy">
<p>Loading notifications...</p>
</turbo-frame>
<!-- Frame that targets another frame -->
<turbo-frame id="sidebar">
<a href="/users/42" data-turbo-frame="main-content">View Profile</a>
</turbo-frame>
<turbo-frame id="main-content">
<!-- Profile loads here -->
</turbo-frame>
Turbo Streams (real-time updates)
<!-- Server sends these HTML snippets to update the page -->
<!-- Via form response, WebSocket, or SSE -->
<!-- Append a new message to the list -->
<turbo-stream action="append" target="messages">
<template>
<div id="message_42" class="message">
<strong>Alice:</strong> New message just arrived!
</div>
</template>
</turbo-stream>
<!-- Replace an existing element -->
<turbo-stream action="replace" target="message_42">
<template>
<div id="message_42" class="message edited">
<strong>Alice:</strong> Edited message content
</div>
</template>
</turbo-stream>
<!-- Remove an element -->
<turbo-stream action="remove" target="message_42"></turbo-stream>
<!-- Update element content (keep the wrapper) -->
<turbo-stream action="update" target="unread-count">
<template>5</template>
</turbo-stream>
<!-- Available actions: append, prepend, replace, update, remove, before, after -->
Stimulus (lightweight JS behavior)
// src/controllers/dropdown_controller.js
import { Controller } from "@hotwired/stimulus";
export default class extends Controller {
static targets = ["menu"]; // data-dropdown-target="menu"
static values = { open: Boolean }; // data-dropdown-open-value="false"
static classes = ["active"]; // data-dropdown-active-class="opacity-100"
toggle() {
this.openValue = !this.openValue;
}
openValueChanged() {
this.menuTarget.classList.toggle(this.activeClass, this.openValue);
this.menuTarget.classList.toggle("hidden", !this.openValue);
}
// Close on click outside
close(event) {
if (!this.element.contains(event.target)) {
this.openValue = false;
}
}
}
<!-- HTML with Stimulus controller -->
<div data-controller="dropdown"
data-dropdown-active-class="opacity-100"
data-action="click@window->dropdown#close">
<button data-action="dropdown#toggle">Menu ▾</button>
<ul data-dropdown-target="menu" class="hidden">
<li><a href="/profile">Profile</a></li>
<li><a href="/settings">Settings</a></li>
<li><a href="/logout">Logout</a></li>
</ul>
</div>
Installation
# With import maps (Rails 7+, no bundler)
bin/importmap pin @hotwired/turbo @hotwired/stimulus
# With npm
npm install @hotwired/turbo @hotwired/stimulus
# JavaScript setup
import * as Turbo from "@hotwired/turbo";
import { Application } from "@hotwired/stimulus";
const application = Application.start();
Best Practices
- Server-first — Render HTML on the server; Turbo handles making it feel like an SPA
- Frames for partials — Use Turbo Frames to update sections independently; no full-page reloads needed
- Streams for real-time — Use Turbo Streams over WebSocket/SSE for live updates (chat, notifications, dashboards)
- Stimulus for behavior — Only add JS for interactive behavior (dropdowns, modals, form validation); not for rendering
- Minimal JavaScript — A typical Hotwire app has 10-20 small Stimulus controllers vs. 500+ React components
- Progressive enhancement — Everything works without JavaScript; Turbo enhances with speed, Stimulus adds behavior
- Works with any backend — Designed for Rails but works with Django, Laravel, Express, Go — any server that renders HTML
- Cache effectively — Turbo caches pages; use
data-turbo-cache="false"on pages that should never be cached
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- Hotwire 是现代化 Web 开发的重要技术栈,解决 SPA 与 SSR 的平衡问题
- 提供完整的 Turbo Drive/Frames/Streams 和 Stimulus 技术方案
- 适用于 Rails、Django、Laravel 等多种后端框架
Highlights
- description 明确描述了 Hotwire 技术栈的核心能力
- 覆盖 Turbo Drive、Frames、Streams 和 Stimulus 等关键组件
- 触发词精准,边界清晰
Areas to improve
-
缺少 When to Use 章节 Reported severity: Minor
文档结构完整但缺少明确的适用场景说明章节
Recommendation: 建议添加 When to Use 章节,明确说明何时使用 Hotwire 技术栈
Highlights
- 文档结构清晰,包含核心能力、安装、最佳实践等完整章节
- 提供了丰富的代码示例和详细说明
- frontmatter 完整,包含必要的元数据信息
Areas to improve
-
缺少错误处理说明 Reported severity: Minor
代码示例中缺少对异常情况的处理说明
Recommendation: 建议在 Stimulus 控制器示例中添加错误处理机制
Highlights
- 提供了完整的代码示例和配置说明
- 工具来源明确,使用官方 @hotwired 包
- 覆盖了主要的 Hotwire 使用场景和最佳实践
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Install or fetch external dependencies
Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.
Mentioned in main document · lines 167
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
import * as Turbo from "@hotwired/turbo"; import { Application } from "@hotwired/stimulus"; const application = Application.start(); ```
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.