xstate-v6
БесплатноБез исполняемых скриптовНе проверенWrite, review, test, and migrate XState v6 machines and actors by reading the documentation that ships inside the installed xstate package. Use when a project…
от statelyai★ 86 звёзд на GitHubОб этом скилле
XState v6
XState v6 ships its documentation in the package, versioned with the code. Read those docs instead of relying on memory, blog posts, or v5 examples. This skill says where to find them, what to read first, and how to verify the result.
Find the version and the docs
- Read the importing workspace's
package.jsonand lockfile. In a monorepo, each workspace can resolve a differentxstate.xstate5.x: use the xstate-v5 skill, unless the user asked to migrate to v6. Then go to Migrate from v5.xstate6.x: continue.- No
xstate: ask before adding it. v6 is in beta (npmlatestis still 5.x); say so when you propose it.
- Open
node_modules/xstate/docs/index.mdfrom that workspace. Its title is the exact installed version, and it links every page.npx xstate docsprints the same location. - Read
docs/agents.mdin full before writing code. It is the authoring contract: transition syntax, context patches, effects, serialization, the JSON CLI, and how to verify. - Read only the pages the task needs, from the index. Use
docs/cheatsheet.mdfor syntax anddocs/api-stability.jsonbefore using an export: it marks public, experimental, and internal exports for that version.
When the package is not installed and you may not install it, download the
tarball to a temporary directory and read its docs/ folder there:
dir=$(mktemp -d) && cd "$dir" && npm pack xstate@beta && tar xzf xstate-*.tgz
Say which version you read when it is not the one the project will install.
Rules worth repeating
These cause most v6 mistakes, so check them even after reading the docs:
- Transitions are objects or one function:
on: { GO: { target: 'done' } }. A bare string such ason: { GO: 'done' }and transition arrays are v5 syntax.initial: 'idle'stays a string. xstate/fsmexportscreateFSM, notcreateMachine.- Do not copy v5 code, including from this repository's xstate-v5 skill, without
translating it.
docs/xstate-v5-to-v6.mdlists every difference. - Keep I/O, time, and randomness out of transition calculation. Queue effects or
invoke actors, as
agents.mddescribes.
Design before code
- When the logic is a few independent values, say a machine is unnecessary and
suggest plain state or
@xstate/store. - When requirements are unclear, sketch the states and events (a short list or a JSON config) and confirm it before writing TypeScript.
- Keep target literals visible so the graph can be inspected and visualized.
Verify
- Typecheck without suppressions or broad casts.
- Run the project's tests. Add tests for the paths you changed, including failure, cancellation, and stop.
- For a data-only definition, use the CLI that ships with the package:
npx xstate validate,simulate,test(withneverandreachablechecks), andreplayfor a saved counterexample. The input formats are inagents.md. A passingtestcovers only the event representatives you supplied; report it that way. - When fixing a bug, save the failing event sequence first and replay it after the fix.
Migrate from v5
Follow docs/xstate-v5-to-v6.md and the @xstate/codemod loop in
agents.md: baseline, then migrate, fix the reported manualSites, then
verify against the baseline. Do not report a migration as done until
verify exits 0.
To view or check a machine in Stately, use the stately skill.
Установить xstate-v6 в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл xstate-v6?
Write, review, test, and migrate XState v6 machines and actors by reading the documentation that ships inside the installed xstate package. Use when a project depends on xstate 6 (including betas), when the user asks for XState v6, or when migrating XState v5 code to v6. For a project on xstate 5, use the xstate-v5 skill instead.
Как установить скилл xstate-v6?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл xstate-v6 запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic