hotwire-patterns

hotwire-patterns is a skill for Claude Code, Codex from slbug/claude-ruby-grape-rails. It costs 49 tokens per session (1,430 once invoked), scanned A, original, MIT.

A set of patterns for Hotwire, Rails tools for building interactive web pages with little JavaScript, including partial updates and live changes.

In plain words
What is it for?
Use it for Turbo Frames, Turbo Streams, Stimulus controllers, live updates, model broadcasts, and Action Cable integrations in Rails apps.
Why use it?
It helps choose between page navigation, scoped updates, server-sent changes, and small browser controllers without duplicating application state.

Skill for Claude CodeCodex

Part of the ruby-grape-rails plugin — 23 skills, 19 agents, 17 hooks 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/slbug/claude-ruby-grape-rails/hotwire-patterns
Any agent
npx skills add slbug/claude-ruby-grape-rails --skill hotwire-patterns
Clone the repo
git clone --depth 1 https://github.com/slbug/claude-ruby-grape-rails

Made for: Claude Code, Codex.

Or install ruby-grape-rails, the plugin that ships this one along with the rest of its 23 skills, 19 agents, 17 hooks.

Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,430 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 $0.00049 $0.01430
Opus 5 $0.00024 $0.00715
Sonnet 5 $0.00010 $0.00286
Haiku 4.5 $0.00005 $0.00143

Measured 3d ago against content hash 2b984b3a09ca, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 3d 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.

plugins/ruby-grape-rails/skills/hotwire-patterns/SKILL.md · 176 lines

How it starts

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

Hotwire Patterns

Iron Laws

  1. Keep server-rendered interactions simple before reaching for custom JS.
  2. Broadcast after commit when Turbo Stream updates depend on committed state.
  3. Keep Stimulus controllers focused on browser concerns, not business rules.
  4. Avoid duplicating the same state in DOM, session, cache, and Current without a clear source of truth.
  5. Use Turbo Frames for scoped navigation; Turbo Streams for server-driven updates.
  6. Progressive enhancement: pages work without JavaScript, enhanced with it.

Overview

Hotwire provides tools for building modern web applications with minimal JavaScript:

  • Turbo Drive — Handles page navigation without full reloads
  • Turbo Frames — Scoped page updates, independent navigation
  • Turbo Streams — Server-driven page changes via WebSocket or HTTP
  • Stimulus — JavaScript controllers for progressive enhancement

Quick Decision Guide

Use Case Tool Example
Page navigation Turbo Drive Click links, instant page loads
Modal/dialog Turbo Frame Login modal, settings panel
Independent scrollable area Turbo Frame Comments section, sidebar
Real-time updates Turbo Streams Notifications, live comments
Form validation Stimulus Character counter, date picker
Complex UI interaction Stimulus Drag and drop, autocomplete

Turbo Frames

<!-- Frame that updates independently -->
<%= turbo_frame_tag "comments" do %>
  <%= render @comments %>
<% end %>

<!-- Link targets specific frame -->
<%= link_to "Load more", comments_path(page: 2), data: { turbo_frame: "comments" } %>

See Turbo Architecture for Drive, Frames, and Streams.

Turbo Streams

<!-- Broadcast from model -->
<%= turbo_stream_from @post %>

<!-- In view, streams update automatically -->
<%= turbo_frame_tag dom_id(@post) do %>
  <%= render @post %>
<% end %>
# Controller action
class CommentsController < ApplicationController
  def create
    @comment = @post.comments.create!(comment_params)
    
    respond_to do |format|
      format.turbo_stream
      format.html { redirect_to @post }
    end
  end
end

Read the full file on GitHub · 176 lines

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. 3d ago First seen · 176 lines · 49 tokens per session scan A 2b984b3a09ca

Subscribe to this mod's changes

hotwire-patterns is a skill published in the GitHub repository slbug/claude-ruby-grape-rails (7 stars, last pushed 4d ago), licensed MIT. It adds 49 tokens to every session and 1,430 once invoked, about $0.0002 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-31.

Related

Other skills, from other repositories

working-with-coreai

Use this skill whenever the user mentions coreai-torch, TorchConverter, coreai-build, AIModel, AIProgram, .aimodel, or wants to export/compile/run a PyTorch model on Apple silicon (iPhone, iPad, Mac). Also triggers for "deploy on device", "optimize for on-device performance", onboarding new models to Core AI, or…

apple/coreai-models · 91 tokens

ai-model-wechat

Use this skill for WeChat Mini Program AI via wx.cloud.extend.AI (小程序, 企业微信小程序, wx.cloud apps). Features generateText and streamText with callbacks (onText, onEvent, onFinish). Models via wx.cloud.extend.AI.createModel with groups hunyuan-exp (小程序成长计划), cloudbase (main managed), or custom-. Model IDs…

TencentCloudBase/CloudBase-AI-Toolkit · 254 tokens

pinme-llm

Use this skill when a PinMe project (Worker TypeScript) needs to call OpenRouter-backed LLM APIs, including models, chat/completions, streaming, or OpenRouter web search. Guides AI to generate correct Worker TS code.

glitternetwork/pinme · 54 tokens

android-pentest

安卓应用渗透测试 — APK分析、Hook、自动化测试、运行态驱动、签名恢复、抓包分析.

Netw0rkNoob/VulnClaw · 32 tokens

firebase-ai

Use when setting up firebaseai, generating text/chat with Gemini, streaming AI output, building multimodal prompts, or handling AI errors.

evanca/flutter-ai-rules · 30 tokens

flutter-app

Bootstrap a new Flutter mobile app with clean architecture, Riverpod, FVM-pinned SDK, current packages, and no deprecated APIs. Use when the user wants to start, scaffold, or set up a new Flutter app, a cross-platform mobile app, an Android or iOS app in Dart, or asks to "create a new flutter app". Handles BYOK LLM…

ccplugins/awesome-claude-code-plugins · 96 tokens