xstate — Claude Code skill: what it does, how to install
Teaches AI assistants how to hook @xstate/store into json-render's state interface. Useful when driving dynamic UI layouts with an XState atom.
npx skills add vercel-labs/json-render --skill xstate -a claude-codeWhat xstate does
This skill guides coding assistants through configuring the @json-render/xstate adapter. It shows how to declare an atom with createAtom, wrap it via xstateStoreStateStore, and supply it directly to StateProvider from @json-render/react. That routes all reading and mutation logic straight through the underlying store.
Setup depends on @xstate/store v3 or newer: running it on earlier releases will break the store contract. The project also requires @json-render/core and @json-render/react to work alongside the adapter.
What it helps with
- wire an @xstate/store atom into the json-render StateStore interface
- configure xstateStoreStateStore to manage dynamic component state
- supply the adapted store to StateProvider in @json-render/react
Example prompts for the agent
- Hook up an @xstate/store atom to json-render using xstateStoreStateStore.
- Show me how to wrap uiAtom into a StateProvider for json-render.
- Generate the setup code to connect @json-render/xstate with @xstate/store v3.
How to install xstate
1Skills CLI (Vercel)
npx skills add vercel-labs/json-render --skill xstate -a claude-code2Manually: put the files in place
~/.claude/skills/xstate/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/xstate/
1Skills CLI (Vercel)
npx skills add vercel-labs/json-render --skill xstate -a codex2Manually: put the files in place
.agents/skills/xstate/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add vercel-labs/json-render --skill xstate -a cursor2Manually: put the files in place
.cursor/skills/xstate/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install vercel-labs/json-render xstate2Manually: put the files in place
.github/skills/xstate/SKILL.md1Skills CLI (Vercel)
npx skills add vercel-labs/json-render --skill xstate -a gemini-cli2Platform CLI
gemini skills install https://github.com/vercel-labs/json-render --path skills/xstateManually: put the files in place
.devin/skills/xstate/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add vercel-labs/json-render --skill xstate -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about xstate
How do I install xstate in Claude Code?
Run npx skills add vercel-labs/json-render --skill xstate -a claude-code. The file will be placed at ~/.claude/skills/xstate/SKILL.md.
What does the xstate skill do?
It provides patterns to bridge @xstate/store atoms with json-render via the @json-render/xstate package.
Which package versions are required?
It requires @xstate/store v3+, alongside @json-render/xstate, @json-render/core, and @json-render/react.
Source text
SKILL.md · Apache-2.0
---
name: xstate
description: XState Store adapter for json-render's StateStore interface. Use when integrating json-render with @xstate/store for state management via @json-render/xstate.
---
# @json-render/xstate
[XState Store](https://stately.ai/docs/xstate-store) adapter for json-render's `StateStore` interface. Wire an `@xstate/store` atom as the state backend for json-render.
## Installation
```bash
npm install @json-render/xstate @json-render/core @json-render/react @xstate/store
```
Requires `@xstate/store` v3+.
## Usage
```tsx
import { createAtom } from "@xstate/store";
import { xstateStoreStateStore } from "@json-render/xstate";
import { StateProvider } from "@json-render/react";
// 1. Create an atom
const uiAtom = createAtom({ count: 0 });
// 2. Create the json-render StateStore adapter
const store = xstateStoreStateStore({ atom: uiAtom });
// 3. Use it
<StateProvider store={store}>
{/* json-render reads/writes go through @xstate/store */}
</StateProvider>
```
## API
### `xstateStoreStateStore(options)`
Creates a `StateStore` backed by an `@xstate/store` atom.
| Option | Type | Required | Description |
|--------|------|----------|-------------|
| `atom` | `Atom<StateModel>` | Yes | An `@xstate/store` atom (from `createAtom`) holding the json-render state model |
© vercel-labs · Apache-2.0 · vercel-labs/json-render