Skip to main content
skill CX Codex

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add vercel-labs/json-render --skill xstate -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/xstate/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/xstate/

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

Similar skills

Everything for Frontend and UI →

From the same set23

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor