/turbo:turbofrom turbo
Use when writing or debugging Turbo (Hotwire) in server-rendered HTML — Turbo Drive navigation, prefetch and the cache, forms and their redirects and 422s, Turbo Frames (lazy, targeted, "Content missing"), Turbo Streams in form responses and over SSE/WebSockets, page refreshes with morphing, data-turbo-* attributes, turbo:* events, custom stream actions. Any backend; examples are Hono JSX on Void.
Ships in turbo. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Turbo makes server-rendered HTML feel like an app: Drive turns links and forms into fetches, Frames replace one part of a page, and Streams change parts of a page from a form response or a broadcast. The server only ever sends HTML. This skill is the contract between Turbo and the server, and the places where it breaks. For how each part works, read the handbook page before changing that part:
drive, page_refreshes, frames,
streams, building)/reference/events, /reference/streams,
/reference/frames, /reference/drivehttps://raw.githubusercontent.com/hotwired/turbo-site/main/_source/handbook/02_drive.md
(also 03_page_refreshes.md, 04_frames.md, 05_streams.md, 07_building.md) and
…/_source/reference/{attributes,events,streams,frames,drive}.mdThis is Turbo 8 (@hotwired/turbo 8.0.x). Its types are @types/hotwired__turbo. In a Void app, the
helpers named below are in src/turbo.tsx of
the example (hotwire skill).
| Request | Turbo sends | The server answers |
|---|---|---|
| A link, or a GET form | A normal GET, with Accept: text/html, application/xhtml+xml | A whole page. Turbo replaces <body> and merges <head> |
| A form with POST, PUT, PATCH or DELETE | Accept: text/vnd.turbo-stream.html, text/html, application/xhtml+xml | Success: 303 to the next page, or <turbo-stream> elements with Content-Type: text/vnd.turbo-stream.html. Errors: 422 with the page or form rendered again, or 500. A 200 HTML answer is not rendered: Turbo stays put and the form looks dead |
A frame loading (<turbo-frame src>), or a link or form inside a frame | Header Turbo-Frame: <id> | HTML containing <turbo-frame id="<id>">. A whole page works, because Turbo extracts the frame, but answering with only the frame (frameRequest(c) === id) is cheaper. With no matching frame, Turbo shows "Content missing" and fires turbo:frame-missing |
| A redirect to the page already shown | — | Turbo performs a page refresh: it morphs instead of replacing when the page has <meta name="turbo-refresh-method" content="morph"> |
In a Void app: acceptsStream(c), streamResponse(c, streams, 200 | 422), frameRequest(c) and
c.redirect(url, 303).
<turbo-stream action="append" target="messages">
<template><li id="message_42">…</li></template>
</turbo-stream>
append, prepend, replace, update, remove, before, after, refresh. replace and
update take method="morph". Content always goes inside <template>; remove and refresh take none.target is an id. targets is a CSS selector, for many elements.append and prepend first remove a child of the target that has the same id as the new element. So
a broadcast that reaches the page which also got the same stream in its form response shows the item
once. Give every item an id (message_${id}).<turbo-stream> elements: append the new item, and replace the form with an
empty one.standalone field to say which.<turbo-stream-source src="wss://…"> (raw
WebSocket text or SSE message events), or any element passed to
connectStreamSource(element) that dispatches MessageEvent("message", { data: html }). Void's
WebSockets and void/live carry JSON, so the example's <turbo-live-stream-source topic> element
subscribes through void/live and re-dispatches each payload. That is what turbo-rails'
<turbo-cable-stream-source> does over Action Cable.<turbo-stream action="refresh"> makes every page that receives it fetch itself again and morph. It is
the simplest broadcast: no templates, no ids to target. Add request-id="…" (the X-Turbo-Request-Id
header of the request that caused it) so that the page which made the change does not refresh again.import { StreamActions } from "@hotwired/turbo"; StreamActions.highlight = function () { … this.targetElements … }, then <turbo-stream action="highlight" target="x">.<head>, with data-turbo-track="reload" on the bundle's tags. Turbo
keeps the head across visits, and reloads fully when a tracked tag changes, which a deploy does. A
<script> written inside <body> runs again on every visit.turbo:load fires on every visit, not just the first. Behavior belongs in Stimulus controllers, which
connect and disconnect with the elements, and not in DOMContentLoaded or turbo:load handlers.data-turbo-permanent together with an id keeps an element as it is across visits and refreshes (a
player, a theme toggle, an open popover).data-turbo-temporary. Undo DOM changes in turbo:before-cache, or in a controller's disconnect(). Use
<meta name="turbo-cache-control" content="no-cache"> for pages that must never be previewed.data-turbo-prefetch="false" on a link (or an ancestor)
whose GET is costly. A GET must never change anything anyway.data-turbo="false" makes a link or form an ordinary one (a download, another site's form).
data-turbo-method="delete" makes a link submit as a form. data-turbo-confirm="Sure?" asks first, and
data-turbo-submits-with="Saving…" relabels the button while the request runs.<meta name="view-transition" content="same-origin"> animates visits with the View Transitions API.Turbo.config.drive.progressBarDelay = ms and Turbo.config.forms.confirm = fn (the older
Turbo.setProgressBarDelay and Turbo.setConfirmMethod are deprecated).<turbo-frame id="x" src="/x" loading="lazy"> loads when it scrolls into view. Without loading="lazy"
it loads at once.data-turbo-frame="_top" (or
target="_top" on the frame) to leave it, and data-turbo-frame="x" on a link outside to aim at frame
x. data-turbo-action="advance" makes a frame navigation change the URL and history.<meta name="turbo-refresh-method" content="morph"> and <meta name="turbo-refresh-scroll" content="preserve"> make a refresh change only what changed and keep the scroll position. Only the
focused field keeps what was typed in it; every other field goes back to the server's HTML. Exclude an element from
morphing with data-turbo-permanent, or decide per element in turbo:before-morph-element. A Stimulus
controller whose element is morphed stays connected, so react to changed values in …ValueChanged
callbacks (stimulus skill).
| Symptom | Cause |
|---|---|
| A form submits, and nothing happens | The server answered 200 HTML to a POST. Answer 303, 422 or a stream |
| A form with errors shows nothing | The status is 200. Use 422 |
| "Content missing" in a frame | The answer has no <turbo-frame> with that id, or a link inside a frame goes elsewhere without data-turbo-frame="_top" |
| A stream answer arrives, and nothing changes | Content-Type is not text/vnd.turbo-stream.html; the content is not inside <template>; or no element has the target id |
| A broadcast item appears twice | The item has no id, so append cannot tell it is already there |
| JavaScript runs twice, or listeners pile up | It is in a turbo:load handler or an inline body script; move it to a Stimulus controller |
| A stale page flashes on back | The cache preview: data-turbo-temporary, turbo:before-cache, or turbo-cache-control |
| The page does not pick up a deploy until reload | The bundle's tags have no data-turbo-track="reload" |
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub joeblew999/hotwire-skills --plugin turbo