/web:xstatefrom web
Models typed statecharts for async workflows, concurrency, retries, cancellation, polling, and interruptible interactions. Builds, reviews, tests, and visualises XState 5 actors with @xstate/react and renders Mermaid state diagrams.
Ships in web. 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.
Treat a statechart as an executable ownership model for time, concurrency, and resource lifetimes.
Each of these is a lifecycle already modelled by hand:
useState flag for work in flight: isSubmitting, isLoading, pending;.then, .catch, or await block that sets two or more pieces of state in sequence;if (submitting) return;useEffect that starts asynchronous work and needs an ignore flag in its cleanup;isLoading with error;setTimeout or setInterval for retry, debounce, or polling that something must clear;pointerdown, dragstart, or gesture handler that binds listeners to the document and must unbind them;Any one of them leads to step 1, however small the request and whether or not the file imports xstate. When the code already exists, name each defect it has today and the wrong behaviour a user would see before proposing the machine that removes it (principle-capture-the-baseline).
For a visualisation-only request, inspect the current machine source and go to step 6 instead.
Inventory the mounted journey, external authority, live resources, concurrent concerns, retry and cancellation policy, and every source of stale or duplicate work. Inspect existing actors and runtime integrations, and confirm the installed XState major version; the XState 4 and 5 APIs differ.
Use XState only where ordering, concurrency, retries, cancellation, stale results, or resource lifetimes make the behaviour temporal. Classify with two tests, by what they show, not by what the state renders:
State belongs to the UI framework only when both tests come back empty: one event sets the value completely, leaving no phase to interrupt and nothing to dispose.
Complete when: every temporal responsibility has one named owner, and every proposed actor owns at least one distinct lifecycle or resource.
Read modelling.md before creating or changing a machine. Apply it to the actor boundary, typed factory, event and command unions, lifecycle states, transition placement, hierarchy, parallel regions, and readiness joins.
Before creating the file, find which layer owns machines: architecture tests, import-boundary rules such as eslint-plugin-boundaries or dependency-cruiser, CLAUDE.md, architecture decision records, and the directory holding existing machines. A correct machine in a forbidden directory fails CI.
Complete when: the machine sits in the layer the repository's own rules assign to machines, mutually exclusive meanings are states, independent concerns are parallel only when they have independent lifecycles, and each transition sits at the narrowest state that owns it (principle-model-the-domain).
Read lifecycles.md whenever the feature invokes asynchronous work, owns a live handle, retries, cancels, accepts optimistic state, or waits for external authority. Keep handles inside invoked actors and fence work by identity.
Complete when: state exit or parent stop disposes every resource, stale and duplicate results are harmless, retry timers cancel with their lifecycle, and authoritative convergence—not an optimistic acknowledgement—confirms completion.
Read react.md for any @xstate/react surface. Let the route or feature boundary own useActorRef, expose typed actor refs to descendants, and subscribe through focused selectors.
Run both step 1 tests over every useState you write or keep, and state the verdict in your reply so the user can overrule it. Where the tests are decisive, act and report the call in one line: "isSubmitting is set by the request, so it moved into the machine as submitting." Where the call is genuinely close (a real but small lifecycle, or a machine the repository's layer rules would push far from its component), ask the user before building: name the state, name the phase that makes it a lifecycle, and ask whether it belongs in the machine.
Complete when: every retained useState holds a value one event sets completely, no React state duplicates a fact an external answer owns, actor-derived status and permissions have one pure derivation, and each component subscribes only to values it renders or uses (principle-derive-from-one-owner).
Read testing.md before writing or reviewing tests. Drive real actors with typed public events and fake ports; cover positive behaviour, negative space, stale identities, retries, cancellation, convergence, and teardown (principle-test-behavior-not-implementation).
Complete when: tests observe public actor behaviour, exactly-once cleanup is demonstrated, sendParent behaviour is exercised through a listening parent, and any model-based graph coverage is justified by chart complexity.
Read diagramming.md whenever the user asks for a diagram. After designing or changing any machine, render or update its diagrams even unasked.
Complete when: every designed or changed machine has a source-grounded diagram, composite and concurrent boundaries are legal, parser-sensitive labels are safe, and render validation is reported accurately.
Type-check the code against the project's installed XState and React adapters, run the actor and UI tests, and regenerate the diagrams from the final machine definitions.
Complete when: the implementation, tests, and diagrams account for every temporal branch and resource lifetime, without duplicating authoritative truth or presentation derivations.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
10 skills in this plugin
/browser-testingWHEN authoring or repairing real-browser journeys or automated screenshot comparisons with the project's selected runner; NOT DOM-only tests, interactive visual judgement or verification-recipe maintenance; provides native-runner fixtures, assertions and visual-comparison guidance./chatgpt-app-sdkWHEN building ChatGPT apps using the OpenAI Apps SDK and MCP; NOT for OpenAI API chat completions, agent frameworks, or MCP servers with no ChatGPT widget; create conversational, composable experiences with proper UX, UI, state management, and server patterns./cssUSE WHEN writing, fixing or reviewing plain CSS or Sass for a web page, even a one-line change, including a rule that loses to another, a third-party stylesheet you cannot edit, units, spacing between components, shorthands, skip links, hidden and focus styles, or deleting styles that look unused; NOT WHEN the project uses Tailwind (tailwind.config.js, utility classes, CVA variants, Tailwind theme tokens); produces CSS that wins the cascade without ID selectors or reactive !important, scales with the reader's text size, keeps spacing in the parent and deletes styles only on evidence./frontend-testingUSE WHEN testing non-React UI (vanilla JavaScript or TypeScript DOM code, a web component, or a Vue, Svelte or Angular component) with DOM Testing Library in Vitest or Jest with jsdom: writing, fixing or reviewing a test, or a request to add an end-to-end journey or a layout check to that suite; NOT WHEN the code or project uses React or React Testing Library (use web:react-testing), for XState actors (web:xstate), or for Playwright, Cypress or screenshot-comparison work in a real browser; covers queries, accessible names, userEvent, async results, network stubs and assertions that pass for the wrong reason, and declines what jsdom cannot prove while offering the part that fits./reactUSE WHEN changing the logic, data, props, state, Effects or rendered text of a React component, hook or page, even a one-line change; NOT WHEN the request is styling only (class names, Tailwind, CSS, dark mode, spacing, shadows) or tests only, or when it models submit, in-flight, loading, retry or failure states, even for a named React form (xstate covers that, including its React wiring); applies React 19 composition, state, Effect, structure, API and performance rules with only the project's installed libraries./react-testingUSE WHEN writing, fixing or reviewing a React Testing Library test for a component, hook or context provider, even one small test, or when asked for an end-to-end journey inside a Vitest or React Testing Library suite; NOT WHEN changing the component itself (react), testing XState actors or @xstate/react (xstate), or writing a Playwright or Cypress test; covers renderHook, providers, async results, forms and false-pass anti-patterns, and declines end-to-end journeys with the testable slices.npx claudepluginhub mintuz/skills --plugin webOther plugins' skills for the same job