Xstate

From wordbricks/onequery · View interactive version

Xstate is an AI agent skill from the GitHub repository wordbricks/onequery. 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.

How to use this skill

Skill file

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

Reading Guide

Read only the references needed for the task:

Working Loop

  1. Name the process and its legal modes.
  2. Define the domain events.
  3. Decide what data survives transitions.
  4. Move effects into actors or named implementations.
  5. Connect UI through actor hooks and snapshot reads.
  6. Test behavior at the actor boundary.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.