/phoenix-liveview-client-state:phoenix-liveview-client-statefrom phoenix-liveview-client-state
Rules for keeping Phoenix LiveView UI responsive with client-side Phoenix.LiveView.JS commands, optimistic updates, restrained topbar loading, and localhost latency simulation. Use when building or reviewing LiveView templates, modals, drawers, tabs, toggles, or assets/js/app.js LiveSocket setup. Don't use for LiveView hook API reference (phoenix-hooks, phoenix-colocated-hooks) or embedding LiveView into controller pages (phoenix-live-islands).
Ships in phoenix-liveview-client-state. 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.
Read when SKILL.md points to them.
Server tracks data; client owns ephemeral UI state. Use Phoenix.LiveView.JS for instant DOM updates and reserve socket round-trips for persisted data.
Read references/examples.md before writing or reviewing LiveView interactions, modals, drawers, tabs, optimistic toggles, or assets/js/app.js.
Handle modals, drawers, popovers, dropdowns, accordions, tab switches, and copy buttons strictly on the client with Phoenix.LiveView.JS (JS.show, JS.hide, JS.toggle, JS.add_class, JS.remove_class, JS.toggle_class) or native <details> / <dialog>.
@show_modal, @active_tab) or round-trip handle_event("open_modal") just to toggle visibility.class="hidden" or style="display: none;") so JS.show/1 opens them in 0ms.phx-click-away and phx-window-keydown (phx-key="Escape") to the same client-side close JS pipeline.For quick mutations (toggles, switches, dismissing rows) or opening a drawer that lazy-loads data, chain immediate JS DOM changes ahead of JS.push/2:
JS.toggle_class(...) |> JS.push("toggle", ...) or JS.show(to: "#drawer") |> JS.push("inspect", ...)), then let the server patch reconcile authoritative state or roll back on error.Phoenix.LiveView.JS, pair a colocated hook (phoenix-colocated-hooks) or Alpine.js with push_event/3.app.js via dom.onBeforeElUpdated calling window.Alpine.clone(from, to).Default Phoenix app.js triggers topbar.show() on every phx:page-loading-start, causing a loading bar flicker on clicks, toggles, and form changes.
topbar.show() to actual page navigation (info.detail.kind === "redirect").phx-click-loading:opacity-50, phx-submit-loading:opacity-50) or local button loading states.localhost in devKeep a latency simulator in assets/js/app.js gated to localhost so accidental server round-trips on basic UI clicks are immediately noticeable while developing:
if (window.location.hostname === "localhost") {
liveSocket.enableLatencySim(300)
}
Never enable enableLatencySim outside localhost.
phx-debounce="300" (or "blur") on phx-change search and filter inputs so typing does not flood the socket.raw_payload, large text blobs) out of list/feed queries and PubSub broadcasts; open the detail drawer immediately on the client and fetch the full record by id.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub dvcrn/skills --plugin phoenix-liveview-client-state