hotwire-patterns

hotwire-patterns is a skill for Claude Code from maquina-app/rails-claude-code. It costs 152 tokens per session (2,924 once invoked), scanned A, original, MIT.

Guidance for building and debugging Rails applications with Hotwire, a set of tools that updates web pages with server-rendered HTML and small amounts of JavaScript.

In plain words
What is it for?
It covers Turbo Drive, Frames, Streams, morphing, ActionCable updates, Stimulus controllers, caching, and Hotwire Native apps for iOS and Android.
Why use it?
It helps choose between full-page refreshes, partial updates, and small browser-side behaviors without adding unnecessary client-side complexity.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the hotwire-patterns plugin — 1 skill shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/maquina-app/rails-claude-code/hotwire-patterns
Any agent
npx skills add maquina-app/rails-claude-code --skill hotwire-patterns
Clone the repo
git clone --depth 1 https://github.com/maquina-app/rails-claude-code

Made for: Claude Code.

Or install hotwire-patterns, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for hotwire-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/maquina-app/rails-claude-code/hotwire-patterns.svg)](https://agentmods.dev/skills/maquina-app/rails-claude-code/hotwire-patterns)
Your own site
<a href="https://agentmods.dev/skills/maquina-app/rails-claude-code/hotwire-patterns"><img src="https://agentmods.dev/badge/skills/maquina-app/rails-claude-code/hotwire-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 152 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,924 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00152 $0.02924
Opus 5 $0.00076 $0.01462
Sonnet 5 $0.00030 $0.00585
Haiku 4.5 $0.00015 $0.00292

Measured 6d ago against content hash 83a1e7579cbd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

hotwire-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

hotwire-patterns/skills/hotwire-patterns/SKILL.md · 105 lines

How it starts

The opening of the file, as written. The whole thing — 105 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Hotwire Patterns

Internals-informed patterns for building and debugging Hotwire applications. Core philosophy: enhance the browser, don't reinvent it. Start by imagining a JS-free, plain-HTML version of every feature, then compose the separate pages into an integrated UI with Turbo. HTML is the source of truth for state, everywhere.

The escalation ladder (choose the cheapest tool that works)

Hotwire is a cost/benefit dial, not a single approach. Escalate only when the previous rung stops being a good tradeoff:

  1. Turbo Drive + Morphing refreshes — re-render everything server-side; fastest to build.
  2. Turbo Frames — decompose the page; localize updates without touching the rest.
  3. Turbo Stream actions — surgical DOM updates; more precise, more maintenance cost.
  4. Stimulus — small client-side behavior where a server round-trip makes no sense.
  5. Island of reactive framework (React/Vue) or API calls — only for genuinely high-interactivity widgets (maps, editors).

Different parts of one app can sit on different rungs; it all composes.

Turbo Drive essentials

  • Drive intercepts link clicks and form submissions, fetches via fetch, replaces <body> wholesale, and diff-merges <head> children (identical nodes untouched → assets not re-parsed; that's the speed win). Order of head children isn't preserved and doesn't matter.
  • Assets must live in <head>. Modern async scripts + HTTP/2 remove old reasons for body-bottom scripts.
  • UJS replacements: data: {turbo_method: :delete} for non-GET links; data: {turbo_confirm: "..."} for confirm dialogs (works on forms and non-GET links; add turbo_method: :get to use on plain links). Customize globally via Turbo.config.forms.confirm = (message, formEl, submitter) => Promise<boolean>.
  • Submit buttons auto-disable during submission. turbo:submit-start / turbo:submit-end events carry event.detail.formSubmission.submitter — use for loaders.
  • Failed form submissions must return 4xx (render :new, status: :unprocessable_entity). Turbo requires a redirect on success; it renders 4xx bodies happily.
  • Turbo.visit(location) is the programmatic navigation entry point; Turbo.visit(location, { frame }) navigates a frame.
  • Non-GET links work by Turbo building a hidden form on the fly and submitting it — everything true of forms is true of these links.
  • Visit types: advance (link click), replace (redirect after form submit), restore (history). This matters for morphing (below).
  • Link prefetch fires after 100ms hover on plain GET links (no turbo-stream expectation, no confirm dialog). GET idempotency becomes mandatory; the X-Sec-Purpose: prefetch header identifies prefetches server-side if you must special-case.

Read the full file on GitHub · 105 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 105 lines · 152 tokens per session scan A 83a1e7579cbd

Subscribe to this mod's changes

hotwire-patterns is a skill published in the GitHub repository maquina-app/rails-claude-code (47 stars, last pushed 20d ago), licensed MIT. It adds 152 tokens to every session and 2,924 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

debug-optimize-lcp

Guides debugging and optimizing Largest Contentful Paint (LCP) using Chrome DevTools MCP tools. Use this skill whenever the user asks about LCP performance, slow page loads, Core Web Vitals optimization, or wants to understand why their page's main content takes too long to appear. Also use when the user mentions…

ChromeDevTools/chrome-devtools-mcp · 99 tokens

systematic-debugging

Use when debugging a failing test, build error, or runtime issue that isn't immediately obvious. Guides a 4-phase root cause analysis instead of random fix attempts.

open-metadata/OpenMetadata · 37 tokens

diagnose

Trace from a reproduced symptom to the source code that causes it. Pin the specific file and approximate line, rate confidence in the cause and clarity of the fix independently, and always propose a concrete fix.

emdash-cms/emdash · 43 tokens

azsdk-common-pipeline-analysis

Analyze Azure SDK CI/CD pipeline failures into a structured diagnosis, and define the required output format. Load this skill before calling azsdkanalyzepipeline, which returns raw failure data that this skill interprets and formats. USE FOR: "pipeline failed", "build failure", "CI check failing", "tests failing in…

Azure/azure-sdk-for-net · 192 tokens

repro-admin

Reproduce an EmDash admin UI bug. Attach a container, start the demo dev server, drive the admin with agent-browser using the dev-bypass session, and capture the reproduction as screenshots plus a replayable transcript.

emdash-cms/emdash · 48 tokens

log-error-digest

Analyze log files to troubleshoot errors, identify peak error periods, and produce error clustering, frequency statistics, and time distribution reports. Supports JSON, syslog, and Nginx formats with automatic detection. Use when a user uploads a .log file and asks to analyze errors, find patterns, debug issues, or…

zebbern/claude-code-guide · 71 tokens