xstate
Skill17 starsChanged 7 months agoApache-2.0View on GitHub
Design, implement, and review XState v5 state machines and @xstate/react integrations in TypeScript. Use when modeling finite workflows, async actors, statecharts, guarded transitions, delayed transitions, actor systems, or machine-driven React behavior.
6 other projects use a version of this.
Adopted by
Most recently taken up by
- vercel-labs/json-rendertheir own version, first seen Oct 29, 2026
- conjurer-rich/skillstheir own version, first seen Oct 25, 2026
- kjanat/skillstheir own version, first seen Jun 30, 2026
- FelipeAngeli/skillstheir own version, first seen Apr 10, 2026
- pedronauck/skillstheir own version, first seen Apr 3, 2026
- justSteve/XState-Skilltheir own version, first seen Oct 29, 2025
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- vercel-labs/json-render★ 19ksame name
- pedronauck/skills★ 649same name
- justSteve/XState-Skill★ 19same name
- FelipeAngeli/skills★ 2same name
- conjurer-rich/skills★ 1same name
- kjanat/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository19 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-browserSkill
- agentic-legibilitySkill
- babysit-prSkill
- better-result-adoptSkill
- code-breaking-changesSkill
- code-review-change-sizeSkill
- code-reviewSkill
- code-review-testingSkill
- drizzle-migration-conflict-resolutionSkill
- gh-pr-writingSkill
- knip-deadcodeSkill
- onequery-blog-imagesSkill
- onequery-bugSkill
- onequery-pr-bodySkill
- protobufSkill
- react-no-use-effectSkill
- tanstack-query-best-practicesSkill
- tanstack-router-best-practicesSkill
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 6 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Use XState when the domain has meaningful modes, transitions, async lifecycle, cancellation, guards, delays, or actor boundaries.
- Very specific: line 25
Prefer setup({ types, actors, actions, guards, delays }).createMachine(...) for typed machines with named implementations.
- Distinctive: line 26
Put finite modes in states.
- Distinctive: line 27
Put durable facts in context.
- Distinctive: line 28
Put side effects behind actors, actions, guards, and delays.
- Very specific: line 29
Put request data in invoke.input.
- Very specific: line 30
Put UI decisions on snapshots: matches, hasTag, can, and selected context.
- Distinctive: line 37
Read only the references needed for the task:
- Distinctive: line 56
Test behavior at the actor boundary.
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
XState
Use XState when the domain has meaningful modes, transitions, async lifecycle, cancellation, guards, delays, or actor boundaries. The goal is not "state management"; the goal is to make the process explicit, typed, inspectable, and hard to misuse.
Core Standard
- Prefer
setup({ types, actors, actions, guards, delays }).createMachine(...)for typed machines with named implementations. - Put finite modes in states.
- Put durable facts in context.
- Put side effects behind actors, actions, guards, and delays.
- Put request data in
invoke.input. - Put UI decisions on snapshots:
matches,hasTag,can, and selected context. - Initialize each actor instance with
input. - Define default implementations in
setup(...); replace runtime implementations with.provide(...). - Model later external changes as keyed remounts, domain events, or subscription actors.
Reading Guide
Read only the references needed for the task:
- Modeling: states, state types, context, events, guards, tags, delays.
- Transitions: guarded, eventless, delayed, and pure transitions.
- Actors: async work, actor choice, invocation, outputs, cancellation.
- Promises:
fromPromise, request input, output, errors, abort signals. - Callbacks: subscriptions, imperative APIs,
sendBack,receive, cleanup. - Observables: observable snapshots and observable event streams.
- Child Actors:
invoke,spawn,spawnChild, child ownership, inspection. - React:
@xstate/react,.provide(...), actor input, selectors. - Testing: actor tests,
waitFor, provided implementations, timing.
Working Loop
- Name the process and its legal modes.
- Define the domain events.
- Decide what data survives transitions.
- Move effects into actors or named implementations.
- Connect UI through actor hooks and snapshot reads.
- Test behavior at the actor boundary.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

