wordbricks/onequery · Archived

xstate

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.

Installation

$ npx skills add wordbricks/onequery --skill xstate

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from wordbricks/onequery · top by installs.

npx skills add wordbricks/onequery

Browse all from wordbricks/onequery

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 17
License LICENSE
Default branch main
Open issues 0
Status Archived

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,670 B
  • docs SUMMARY.md 268 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

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](references/modeling.md): states, state types, context, events, guards, tags, delays.
  • [Transitions](references/transitions.md): guarded, eventless, delayed, and pure transitions.
  • [Actors](references/actors.md): async work, actor choice, invocation, outputs, cancellation.
  • [Promises](references/promises.md): fromPromise, request input, output, errors, abort signals.
  • [Callbacks](references/callbacks.md): subscriptions, imperative APIs, sendBack, receive, cleanup.
  • [Observables](references/observables.md): observable snapshots and observable event streams.
  • [Child Actors](references/child-actors.md): invoke, spawn, spawnChild, child ownership, inspection.
  • [React](references/react.md): @xstate/react, .provide(...), actor input, selectors.
  • [Testing](references/testing.md): actor tests, waitFor, provided implementations, timing.

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.