aio-xstate

aio-xstate is a skill for Claude Code from aiocean/claude-plugins. It costs 103 tokens per session (1,301 once invoked), scanned A, original, MIT.

A strict guide to building XState version 5 state machines in TypeScript and React. State machines model an application's allowed states and the events that move it between them.

In plain words
What is it for?
Use it to design and implement state machines, actors, statecharts, and React integrations with XState v5.
Why use it?
It reduces common mistakes by requiring typed states and events, current XState patterns, and compiler checks before the code is accepted.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the aio-xstate plugin — 1 skill shipped together

Good fit Use it to design and implement state machines, actors, statecharts, and React…

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

Made for: Claude Code.

Or install aio-xstate, the plugin that ships this one along with the rest of its 1 skill.

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 aio-xstate

README.md
[![agentmods](https://agentmods.dev/badge/skills/aiocean/claude-plugins/aio-xstate.svg)](https://agentmods.dev/skills/aiocean/claude-plugins/aio-xstate)
Your own site
<a href="https://agentmods.dev/skills/aiocean/claude-plugins/aio-xstate"><img src="https://agentmods.dev/badge/skills/aiocean/claude-plugins/aio-xstate.svg" alt="Measured on agentmods" height="20"></a>
Per session 103 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,301 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.
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.00103 $0.01301
Opus 5 $0.00051 $0.00651
Sonnet 5 $0.00021 $0.00260
Haiku 4.5 $0.00010 $0.00130

Measured 3d ago against content hash 746f57d49460, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

aio-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 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/aio-xstate/skills/aio-xstate/SKILL.md · 128 lines

How it starts

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

XState v5 Strict Skill

Environment

  • tsc: !tsc --version 2>/dev/null || echo "NOT INSTALLED"

XState v5 ONLY. Requires TypeScript 5.0+. Never use v4 patterns.

Workflow

  1. Design first (unless user says skip): produce planning artifacts before code
  2. Types first: types.context, types.events, types.input (+ types.output)
  3. Implement: setup({...}).createMachine({...}) with all implementations in setup
  4. Validate: tsc --noEmit, no any leaks, no string events, no v4 imports

Quick Reference

import { setup, assign, fromPromise, createActor } from "xstate"

const machine = setup({
  types: {
    context: {} as { count: number },
    events: {} as { type: "inc" } | { type: "add"; amount: number },
    input: {} as { initialCount?: number },
  },
  actions: {
    inc: assign({ count: ({ context }) => context.count + 1 }),
    add: assign({
      count: ({ context }, params: { amount: number }) => context.count + params.amount,
    }),
  },
  guards: {
    isPositive: ({ context }) => context.count > 0,
  },
}).createMachine({
  id: "counter",
  context: ({ input }) => ({ count: input.initialCount ?? 0 }),
  initial: "active",
  states: {
    active: {
      on: {
        inc: { actions: "inc" },
        add: {
          actions: {
            type: "add",
            params: ({ event }) => ({ amount: event.amount }),
          },
        },
      },
    },
  },
})

const actor = createActor(machine, { input: { initialCount: 0 } })
actor.subscribe((snapshot) => console.log(snapshot.context.count))
actor.start()
actor.send({ type: "inc" })

Hard Rules

  1. setup({...}).createMachine({...}) for all machines
  2. All implementations in setup(): actions, guards, actors
  3. Typed params: actions/guards take (_, params: { ... }) second arg
  4. Event objects only: actor.send({ type: "X" }), never strings
  5. No god-machine: unrelated domains = separate actors/machines
  6. No state-mirroring booleans: use state nodes for modes, context for data
  7. invoke has onError: always handle failure
  8. No v4 patterns: no interpret, Machine, cond, send, pure, choose

Read the full file on GitHub · 128 lines

Files

What ships with it

2 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. 3d ago First seen · 128 lines · 103 tokens per session scan A 746f57d49460

Subscribe to this mod's changes

aio-xstate is a skill published in the GitHub repository aiocean/claude-plugins (4 stars, last pushed 4d ago), licensed MIT. It adds 103 tokens to every session and 1,301 once invoked, about $0.0005 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-09-03.

Related

Other skills, from other repositories

frontend-component

Create React/Vue component with TypeScript, tests, and styles. Auto-invoke when user says "create component", "add component", "new component", or "build component".

alekspetrov/navigator · 40 tokens

coding-standards

A set of general coding standards and practical patterns for TypeScript, JavaScript, React, and Node.js. It covers readable naming, simple designs, avoiding repetition, and delaying unnecessary features.

loulanyue/awesome-claude-notes · 41 tokens

react-component-generator

Generate React components with TypeScript, proper props, hooks, and accessibility. Use when creating new React components, UI elements, or refactoring existing components.

OneWave-AI/claude-skills · 35 tokens

react-dev

Explicit /react-dev reference for advanced React/TypeScript typing and integration patterns. Do not auto-use for routine React implementation.

Dannykkh/skill-olympus · 29 tokens

react-modernization

Upgrade React applications to latest versions, migrate from class components to hooks, and adopt concurrent features. Use when modernizing React codebases, migrating to React Hooks, or upgrading to latest React versions.

HermeticOrmus/LibreUIUX-Claude-Code · 43 tokens

senior-frontend

Frontend development skill for React, Next.js, TypeScript, and Tailwind CSS applications. Use when building React components, optimizing Next.js performance, analyzing bundle sizes, scaffolding frontend projects, implementing accessibility, or reviewing frontend code quality.

composio-community/awesome-claude-plugins · 52 tokens