xstate-v5

xstate-v5 is a skill for Claude Code, Codex from statelyai/skills. It costs 110 tokens per session (2,932 once invoked), scanned A, original, MIT.

A guide to XState version 5, a TypeScript library for describing application logic as states and transitions. State machines make the allowed steps and changes in a process explicit.

In plain words
What is it for?
Building or migrating XState v5 state machines and statecharts for user interfaces, workflows, and other non-trivial processes.
Why use it?
It helps developers design, review, or update process logic without leaving states or transitions unclear.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Building or migrating XState v5 state machines and statecharts for user interfaces, workflows, and other non-trivial processes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/statelyai/skills/xstate-v5
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 statelyai/skills --skill xstate-v5
Clone the repo
git clone --depth 1 https://github.com/statelyai/skills

Made for: Claude Code, Codex.

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-v5

README.md
[![agentmods](https://agentmods.dev/badge/skills/statelyai/skills/xstate-v5/github.svg)](https://agentmods.dev/skills/statelyai/skills/xstate-v5)
Your own site
<a href="https://agentmods.dev/skills/statelyai/skills/xstate-v5"><img src="https://agentmods.dev/badge/skills/statelyai/skills/xstate-v5/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-v5

Your own site · 80×15
<a href="https://agentmods.dev/skills/statelyai/skills/xstate-v5"><img src="https://agentmods.dev/badge/skills/statelyai/skills/xstate-v5.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 110 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,932 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
  • Socket pass 15 Sept 2026
  • Snyk pass 15 Sept 2026
How audits are shown
Origin unknown 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.00110 $0.02932
Opus 5.5 $0.00044 $0.01173
Sonnet 5.5 $0.00022 $0.00586
Haiku 4.5 $0.00011 $0.00293

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

Security

Grade A, and why

xstate-v5 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 2mo ago.

The scan reads SKILL.md. This mod also ships 2 executable files (evals/extract_and_typecheck.py, evals/regrade_weighted.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/xstate-v5/SKILL.md · 238 lines

How it starts

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

XState v5

Use this skill for state machine and statechart engineering first and API correctness second.

This skill is v5-only. When examples, blog posts, answers, or local code smell v4-ish, translate them rather than mixing versions. Prefer local repo code and official v5 docs over generic memory.

Your job:

  • choose between xstate and @xstate/store
  • design a sound machine or actor system from messy requirements
  • write modern XState v5 TypeScript code in a consistent style
  • review, repair, or improve existing XState code
  • migrate legacy v4-ish patterns when they appear
  • choose the right actor kind and action shape when the problem is not just assign(...) plus fromPromise(...)
  • connect machines and actors to @xstate/react, @xstate/vue, @xstate/svelte, or @xstate/solid when needed

First pass

In an existing codebase:

  1. Inspect local package.json files and imports.
  2. Read nearby machines, stores, actors, and adapter usage.
  3. Distinguish between new code, local edits, and migration work before choosing how opinionated to be.
  4. Preserve surrounding style by default.

Task mode

Choose a mode before writing code:

  • New code: prefer the modern v5 patterns in this skill.
  • Local edit: preserve local structure and naming unless the current code is mixed, broken, or cleanup was requested.
  • Migration: prefer the smallest safe translation to v5. Preserve structure and semantics unless broader normalization was requested.

For migration and local edits, do not introduce setup(...), named implementations, object-form guards/actions, tags, or actor decomposition unless they are required for correctness, significantly reduce local complexity, or were explicitly requested.

Choose the tool

Prefer @xstate/store when the domain is simple event-based state management:

  • no meaningful finite modes that need coordination, orchestration, or explicit lifecycle modeling
  • no invoked async processes
  • no actor communication
  • no need for state machine or statechart concepts such as guarded transitions, delayed transitions, parallel states, or history

Read the full file on GitHub · 238 lines

Files

What ships with it

8 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. 2mo ago First seen · 238 lines · 110 tokens per session scan A 5d74022d0c7c

Subscribe to this mod's changes

xstate-v5 is a skill published in the GitHub repository statelyai/skills (50 stars, last pushed today), licensed MIT. It adds 110 tokens to every session and 2,932 once invoked, about $0.0004 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-v5 compared with skills from other repositories

xstate-v5 next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
xstate-v5statelyai/skillsSkill50todayMITA110Claude Code, Codex
imagegenopenai/codexSkill134ktodayApache-2.0A113Codex
local-ai-agentsmicrosoft/ai-agents-for-beginnersSkill79k2d agoMITA200Claude Code, Codex
playwright-climicrosoft/playwrightSkill100ktodayApache-2.0A19Claude Code
browser-automationopenclaw/openclawSkill394ktodayMITA36Claude Code
systematic-debuggingobra/superpowersSkill315k6d agoMITA21Claude Code
next-cache-components-adoptionvercel/next.jsSkill143ktodayMITA95Claude Code