zustand — Claude Code skill: state management with json-render
This skill integrates Zustand into json-render to sync application state. Use it when your project already relies on Zustand and you need to connect it with components rendered by json-render.
npx skills add vercel-labs/json-render --skill zustand -a claude-codeWhat zustand does
The skill provides a zustandStateStore adapter that wraps a Zustand vanilla store into the StateStore interface for json-render. Create a store using createStore from zustand/vanilla, pass it to the adapter, and wire it to StateProvider from @json-render/react. Reads and writes flow through Zustand.
The adapter supports slicing state with a selector and custom updates via updater. For nested state, pick a slice with the selector and define how changes apply. Requires Zustand v5 or later — v4 is not supported due to breaking changes in the vanilla store API.
What it helps with
- connect a Zustand store to json-render components
- keep state synchronized across app layers
- work with nested slices of Zustand state
Example prompts for the agent
- Integrate Zustand into json-render to manage a counter and name through one store
- Create an adapter for a nested ui slice and use it in the json-render provider
- Wire a Zustand store with a custom updater for full state replacement
How to install zustand
1Skills CLI (Vercel)
npx skills add vercel-labs/json-render --skill zustand -a claude-code2Manually: put the files in place
~/.claude/skills/zustand/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/zustand/
1Skills CLI (Vercel)
npx skills add vercel-labs/json-render --skill zustand -a codex2Manually: put the files in place
.agents/skills/zustand/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add vercel-labs/json-render --skill zustand -a cursor2Manually: put the files in place
.cursor/skills/zustand/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install vercel-labs/json-render zustand2Manually: put the files in place
.github/skills/zustand/SKILL.md1Skills CLI (Vercel)
npx skills add vercel-labs/json-render --skill zustand -a gemini-cli2Platform CLI
gemini skills install https://github.com/vercel-labs/json-render --path skills/zustandManually: put the files in place
.devin/skills/zustand/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add vercel-labs/json-render --skill zustand -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set20
The whole set →Similar
Questions about zustand
How do I install zustand in Claude Code?
Run npx skills add vercel-labs/json-render --skill zustand -a claude-code, then open ~/.claude/skills/zustand/SKILL.md.
What does the zustand skill do?
It creates an adapter that wires a Zustand store to json-render as the state backend. json-render reads and writes state through Zustand, keeping components in sync.
Which versions of Zustand are supported?
Zustand v5 and above only. Version v4 is not compatible due to API changes in the vanilla store.
Source text
SKILL.md · Apache-2.0
---
name: zustand
description: Zustand adapter for json-render's StateStore interface. Use when integrating json-render with Zustand for state management via @json-render/zustand.
---
# @json-render/zustand
Zustand adapter for json-render's `StateStore` interface. Wire a Zustand vanilla store as the state backend for json-render.
## Installation
```bash
npm install @json-render/zustand @json-render/core @json-render/react zustand
```
Requires Zustand v5+. Zustand v4 is not supported due to breaking API changes in the vanilla store interface.
## Usage
```tsx
import { createStore } from "zustand/vanilla";
import { zustandStateStore } from "@json-render/zustand";
import { StateProvider } from "@json-render/react";
// 1. Create a Zustand vanilla store
const bearStore = createStore(() => ({
count: 0,
name: "Bear",
}));
// 2. Create the json-render StateStore adapter
const store = zustandStateStore({ store: bearStore });
// 3. Use it
<StateProvider store={store}>
{/* json-render reads/writes go through Zustand */}
</StateProvider>
```
### With a Nested Slice
```tsx
const appStore = createStore(() => ({
ui: { count: 0 },
auth: { token: null },
}));
const store = zustandStateStore({
store: appStore,
selector: (s) => s.ui,
updater: (next, s) => s.setState({ ui: next }),
});
```
## API
### `zustandStateStore(options)`
Creates a `StateStore` backed by a Zustand store.
| Option | Type | Required | Description |
|--------|------|----------|-------------|
| `store` | `StoreApi<S>` | Yes | Zustand vanilla store (from `createStore` in `zustand/vanilla`) |
| `selector` | `(state) => StateModel` | No | Select the json-render slice. Defaults to entire state. |
| `updater` | `(nextState, store) => void` | No | Apply next state to the store. Defaults to shallow merge. Override for nested slices, or use `(next, s) => s.setState(next, true)` for full replacement. |
© vercel-labs · Apache-2.0 · vercel-labs/json-render