xstate-store
БесплатноБез исполняемых скриптовНе проверенBuild, test, integrate, or migrate XState Store v4: transitions, effects, schemas, selectors, atoms, extensions, React bindings, and fromStore. Excludes…
от pedronauck★ 661 звезда на GitHubОб этом скилле
XState Store
Targets @xstate/store v4 and @xstate/store-react v2 (TypeScript 5.4+). Read the reference matched by the API or behavior being changed. Load adjacent references only for concerns the change crosses; reuse relevant context already read.
Pick the primitive first
| State | Primitive | Why |
|---|---|---|
| Domain state updated through named events | createStore({ context, on }) |
Typed trigger, can, emitted events, replayable transitions |
| Per-instance state built from input | createStoreLogic({ context: (input) => … }) |
One definition, many instances; selectors come along |
| A single value set directly | createAtom(value) |
No event vocabulary to justify a store |
| A value computed from other atoms or selectors | createAtom(() => …) |
Read-only, recomputes on dependency change |
| Modes, guards, delays, hierarchical or parallel states | xstate machine |
A store models data, not lifecycle |
Done when: the primitive is chosen from this table and its justification holds.
Branches
| When you are… | Reference |
|---|---|
Creating a store, writing transitions, using trigger/send/can, or Immer |
references/store-core.md |
| Enqueuing effects, emitting events, or doing async work | references/effects-and-events.md |
Declaring schemas or turning on runtime validation |
references/schemas-and-validation.md |
Reading state with store.select, atoms, derived/async/reducer atoms |
references/selectors-and-atoms.md |
Building reusable/per-instance stores with createStoreLogic, input, or selectors |
references/store-logic-and-input.md |
Adding persist, undoRedo, reset, or composing .with(...) |
references/extensions.md |
| Wiring a store into React components | references/react.md |
| Testing transitions, inspecting a store, or interoperating with XState | references/testing-and-interop.md |
| Upgrading a v3 store to v4, or porting an existing Zustand store over | references/migration-v4.md |
Apply the technical rules relevant to the changed behavior.
Tripwires
Transitions — return the complete next context (spread the old one); return undefined to mark an event disallowed, which is what store.can.*() reports.
Effects — call enqueue.effect, enqueue.emit.*, and enqueue.trigger.* synchronously inside the transition; async work goes inside enqueue.effect(async () => …) and reports back by triggering another event.
Imports — framework bindings come from @xstate/store-react (and siblings), never @xstate/store/react; extensions come from @xstate/store/persist, /undo, /reset, /validate.
Schemas — schemas types the store; only .with(validateSchemas()) validates at runtime.
Atoms — computed atoms read dependencies via .get(); their first parameter is the previous computed value, so annotate createAtom<T>(…) when using it.
React — module-scoped stores for app-wide state, useStore(logic, input) for component-scoped state; subscribe through useSelector/useAtom rather than getSnapshot().
Установить xstate-store в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл xstate-store?
Build, test, integrate, or migrate XState Store v4: transitions, effects, schemas, selectors, atoms, extensions, React bindings, and fromStore. Excludes XState state-machine design, other stores, and Query server state.
Как установить скилл xstate-store?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл xstate-store запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic