hotwire
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "hotwire":https://skillpi.com/zh/skills/deepskill-65e675baffdb56f2829b22479b42aec7c7e96325889bba290def05c79ac274c0。安装前核对上游来源和版本:https://github.com/TerminalSkills/skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
github.com
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
Hotwire(HTML Over The Wire)专家:指导使用 Turbo(Drive、Frames、Streams)通过发送 HTML 而非 JSON 来实现类似单页应用的导航与局部更新,并使用 Stimulus 为页面添加轻量级 JavaScript 行为,以构建以服务端渲染为主、在尽量少客户端 JavaScript 下获得近似 SPA 体验的 Web 应用。
介绍来源: third_party · TerminalSkills · 1.0.0 参考来源
SkillPi 解读
- 软件、账号及付费要求
- 翻译待完成,请参阅来源文档。
- 实测状态
- 未测试
文件浏览
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
当前收录版本
1.0.0
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- Hotwire 是现代化 Web 开发的重要技术栈,解决 SPA 与 SSR 的平衡问题
- 提供完整的 Turbo Drive/Frames/Streams 和 Stimulus 技术方案
- 适用于 Rails、Django、Laravel 等多种后端框架
亮点
- description 明确描述了 Hotwire 技术栈的核心能力
- 覆盖 Turbo Drive、Frames、Streams 和 Stimulus 等关键组件
- 触发词精准,边界清晰
待提升项
-
缺少 When to Use 章节 原报告严重程度:轻微
文档结构完整但缺少明确的适用场景说明章节
改进建议:建议添加 When to Use 章节,明确说明何时使用 Hotwire 技术栈
亮点
- 文档结构清晰,包含核心能力、安装、最佳实践等完整章节
- 提供了丰富的代码示例和详细说明
- frontmatter 完整,包含必要的元数据信息
待提升项
-
缺少错误处理说明 原报告严重程度:轻微
代码示例中缺少对异常情况的处理说明
改进建议:建议在 Stimulus 控制器示例中添加错误处理机制
亮点
- 提供了完整的代码示例和配置说明
- 工具来源明确,使用官方 @hotwired 包
- 覆盖了主要的 Hotwire 使用场景和最佳实践
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
-
安装或获取外部依赖
使用官方来源并锁定版本,在隔离环境检查安装脚本。当前文档检查不覆盖后续下载的代码。
主文档提及 · 第 167 行
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
翻译待完成,请参阅来源文档。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。