智能体工作流

xstate-v5

statelyai/skills

Design, implement, review, and migrate XState v5 state machines and statecharts in TypeScript using modern v5 patterns. Use this whenever the user mentions XState, actors, state machines, statecharts, guards, transitions, workflows, or Stately, or is modeling non-trivial UI/app/process logic in a codebase that uses XState. Prefer a short machine sketch before code when requirements are fuzzy. If the problem is too simple for a state machine, say so and recommend @xstate/store instead.

  • 500 次安装
  • 48 星标
  • 收录于

安装命令

npx skills add https://github.com/statelyai/skills --skill xstate-v5

SKILL.md

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: