xstate

xstate is a skill for Claude Code, Codex from mintuz/skills. It costs 118 tokens per session (1,456 once invoked), scanned A, original, MIT.

A set of instructions for using XState 5 to model application state, such as loading, errors, retries, cancellation, polling, and drag interactions. A state machine describes which states an application can be in and how it moves between them.

In plain words
What is it for?
It guides building, reviewing, testing, and visualising state machines in React applications. It applies when state changes depend on asynchronous answers or interruptible user actions.
Why use it?
It helps prevent conflicting flags, stale asynchronous results, forgotten timers, and event listeners that remain active after an interaction ends.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present. Also seen: mentions CLAUDE.md.

Part of the web plugin — 10 skills, 4 agents shipped together

Good fit It guides building, reviewing, testing, and visualising state machines in React applications. It applies when state changes depend on asynchronous answers or interruptible user actions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mintuz/skills/xstate
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.

Any agent
npx skills add mintuz/skills --skill xstate
Clone the repo
git clone --depth 1 https://github.com/mintuz/skills

Made for: Claude Code, Codex.

Or install web, the plugin that ships this one along with the rest of its 10 skills, 4 agents.

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 xstate

README.md
[![agentmods](https://agentmods.dev/badge/skills/mintuz/skills/xstate/github.svg)](https://agentmods.dev/skills/mintuz/skills/xstate)
Your own site
<a href="https://agentmods.dev/skills/mintuz/skills/xstate"><img src="https://agentmods.dev/badge/skills/mintuz/skills/xstate/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for xstate

Your own site · 80×15
<a href="https://agentmods.dev/skills/mintuz/skills/xstate"><img src="https://agentmods.dev/badge/skills/mintuz/skills/xstate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 118 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,456 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00118 $0.01456
Opus 5.5 $0.00047 $0.00582
Sonnet 5.5 $0.00024 $0.00291
Haiku 4.5 $0.00012 $0.00146

Measured 1mo ago against content hash bd953d828e06, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

xstate 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 1mo 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.

src/web/skills/xstate/SKILL.md · 80 lines

How it starts

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

XState

Treat a statechart as an executable ownership model for time, concurrency, and resource lifetimes.

Recognise a hand-rolled statechart

Each of these is a lifecycle already modelled by hand:

  • a useState flag for work in flight: isSubmitting, isLoading, pending;
  • a .then, .catch, or await block that sets two or more pieces of state in sequence;
  • a re-entry guard such as if (submitting) return;
  • a line that clears an error or a stale result before a retry;
  • a useEffect that starts asynchronous work and needs an ignore flag in its cleanup;
  • two booleans that must never both be true, such as isLoading with error;
  • a setTimeout or setInterval for retry, debounce, or polling that something must clear;
  • a pointerdown, dragstart, or gesture handler that binds listeners to the document and must unbind them;
  • handling for a response that arrives after cancel, replacement, or unmount.

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.

1. Establish the temporal boundary

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:

  1. An external answer (a network response, a timer, another actor, the platform) makes state temporal whatever it looks like on screen. A disabled button or a spinner presents temporal state; it is not presentation state.
  2. Direct user input creates a lifecycle whenever the interaction has an interruptible middle: a drag holds pointer capture, cancels on Escape, and must release on unmount; a panel that animates shut has a closing phase.

Read the full file on GitHub · 80 lines

Files

What ships with it

6 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. 1mo ago Changed · +1 lines bd953d828e06
  2. 2mo ago Changed d736796308d0
  3. 3mo ago First seen · 79 lines · 118 tokens per session scan A 3c485a2ceb3e

Subscribe to this mod's changes

xstate is a skill published in the GitHub repository mintuz/skills (38 stars, last pushed 7d ago), licensed MIT. It adds 118 tokens to every session and 1,456 once invoked, about $0.0005 per session on Opus 5.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

xstate compared with skills from other repositories

xstate next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
xstatemintuz/skillsSkill387d agoMITA118Claude Code, Codex
build-ghost-appTryGhost/GhostSkill56ktodayMITA44Claude Code, Codex
r3f-best-practiceszebbern/claude-code-guideSkill4.7ktodayMITA74Claude Code, Codex
implementation-readinessHoangNguyen0403/agent-skills-standardSkill598yesterdayMITA27Codex
devtools-event-clientTanStack/devtoolsSkill519todayMITA79Claude Code, Codex
test-loopHoangNguyen0403/agent-skills-standardSkill598yesterdayMITA25Codex
building-product-empty-statesPostHog/posthogSkill41ktodaynoneA133Claude Code, Codex