$npx skillfedfor your agent

zustand-state

Zustand State is a minimal state management solution designed for React and vanilla JavaScript applications. It eliminates boilerplate by removing the need for providers and offers fine-grained control through selectors to optimize component rerenders. The skill covers store creation, state updates, performance patterns, and integration with middleware like persistence and devtools.

Zustand State provides lightweight global state management for React with minimal boilerplate and no provider setup required.

AI-generated summary based on this skill's SKILL.md

74 10 Apache-2.0updated by existential-birds

Decision gist · record as of 2026-07-21

Zustand State provides lightweight global state management for React with minimal boilerplate and no provider setup required. Zustand State is a minimal state management solution designed for React and vanilla JavaScript applications. It eliminates boilerplate by removing the need for providers and offers fine-grained control through selectors to optimize component rerenders. The skill covers store creation, state updates, performance patterns, and integration with middleware like persistence and devtools.

manual: git clone https://github.com/existential-birds/beagle → cp -r beagle/plugins/beagle-react/skills/zustand-state ~/.claude/skills/zustand-state
plugins/beagle-react/skills/zustand-state/SKILL.md · version ef794953

Use it when

  • Zustand State selectors let you pick specific state slices to prevent unnecessary rerenders.
  • Zustand State includes a persist middleware that automatically syncs state to localStorage.

Verify before relying

Read SKILL.md below before installing (7 files). Open directory: indexed for reading, not audited.

Same gist for agents: .md · .json

Install

existential-birds/beagle/zustand-state · repository language: TypeScript

Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

How do I create a zustand store?

Zustand State lets you create a store by calling `create()` with a function that receives `set` and `get`. Define your state and actions directly: `const useStore = create((set) => ({ count: 0, increment: () => set(state => ({ count: state.count + 1 })) }))`. No providers needed—import and use the hook anywhere in your React app. Zustand State handles subscriptions automatically.

What is zustand selector performance and how does useShallow help?

Zustand State selectors let you pick specific state slices to prevent unnecessary rerenders. Use `useStore((state) => state.count)` to subscribe only to `count` changes. The `useShallow` hook compares shallow equality on objects or arrays, reducing rerenders when nested state changes but the shallow structure stays the same. This optimization keeps your components efficient.

How can I persist zustand state to localStorage?

Zustand State includes a persist middleware that automatically syncs state to localStorage. Wrap your store with `persist()`: `create(persist((set) => ({ ... }), { name: 'my-store' }))`. On app load, the stored state hydrates automatically. You can customize storage, merge strategies, and which fields persist.

Can I access and update zustand state outside React components?

Yes. Zustand State stores expose `getState()` and `setState()` methods. Call `useStore.getState()` to read state or `useStore.setState({ count: 5 })` to update it from anywhere—event handlers, API calls, or vanilla JavaScript. You can also subscribe to changes with `useStore.subscribe()` without React hooks.

How do I integrate zustand devtools for debugging?

Zustand State works with Redux DevTools via the devtools middleware. Wrap your store: `create(devtools((set) => ({ ... }), { name: 'MyStore' }))`. You'll see all state changes, time-travel debugging, and action history in the Redux DevTools browser extension. Combine it with persist for full state management visibility.

Is zustand state management suitable for vanilla JavaScript without React?

Yes. Zustand State works in vanilla JavaScript by creating stores without React hooks. Use `create()` to define state and actions, then call `getState()`, `setState()`, and `subscribe()` directly. No React dependency required—ideal for vanilla apps, Node.js scripts, or non-React frameworks needing lightweight global state.

SKILL.md

Rendered from the published skill. Quoted content, verbatim.

Zustand State Management

Minimal state management - no providers, minimal boilerplate.

Quick Reference

import { create } from 'zustand'

interface BearState {
  bears: number
  increase: (by: number) => void
}

const useBearStore = create<BearState>()((set) => ({
  bears: 0,
  increase: (by) => set((state) => ({ bears: state.bears + by })),
}))

// In component - select only what you need
const bears = useBearStore((state) => state.bears)
const increase = useBearStore((state) => state.increase)

State Updates

```typescript // Flat updates (auto-merged at one level) set({ bears: 5 }) set((state) => ({ bears: state.bears + 1 }))

// Nested objects (manual spread required) set((state) => ({ nested: { ...state.nested, count: state.nested.count + 1 } }))

// Replace entire state (no merge) set({ bears: 0 },

(truncated - see the full file via the links below)

File tree — 7 files
plugins/beagle-react/skills/zustand-state/MIDDLEWARE.md
plugins/beagle-react/skills/zustand-state/PATTERNS.md
plugins/beagle-react/skills/zustand-state/SKILL.md
plugins/beagle-react/skills/zustand-state/TYPESCRIPT.md
plugins/beagle-react/skills/zustand-state/references/middleware.md
plugins/beagle-react/skills/zustand-state/references/patterns.md
plugins/beagle-react/skills/zustand-state/references/typescript.md

Let your AI agent find skills like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.

wish › “Set up and use Zustand for global state management in React apps”

Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →

Related skills

Zustand
by oakoss · oakoss/agent-skills

Zustand is a minimal state manager for React built on useSyncExternalStore, offering type-safe stores, atomic selectors to prevent unnecessary re-renders, and composable middleware like persist and devtools. It handles client-side global state, persistent preferences, and multi-domain stores while keeping bundle size lean.

no license declared → metadata onlyupdated Mar 2026
★ 13repo stars
zustand-state-management
by Mindrally · Mindrally/skills

This skill covers Zustand fundamentals for building efficient client-side state in React and Next.js applications. You'll learn store architecture, selector patterns to minimize re-renders, middleware for persistence and debugging, and integration strategies with server state libraries. Error handling, testing approaches, and TypeScript typing round out production-ready patterns.

Apache-2.0updated Jun 2026
★ 202repo stars
zustand
by bobmatnyc · bobmatnyc/claude-mpm-skills

Zustand provides lightweight state management for React using hooks instead of providers or complex patterns. It's designed for apps needing global state without Redux overhead, offering direct mutations and flexible hydration for server-side rendering.

MITupdated Jul 2026
★ 62repo stars
zustand-state-management
by secondsky · secondsky/claude-skills

Zustand State Management teaches you to build type-safe global state for React without boilerplate. Master the three core patterns—basic stores, TypeScript-first setup, and persistent storage—while avoiding common pitfalls like hydration mismatches and infinite render loops.

MITupdated Jul 2026
★ 196repo stars
Zustand
by pedronauck · pedronauck/skills

This skill teaches you how to build and organize Zustand stores for managing shared client state across your application. It covers store structure, the recommended middleware stack (devtools, persist, immer), and how to create selector hooks for performance. Follow the patterns and validation checklist to keep stores focused, type-safe, and production-ready.

no license declared → metadata onlyupdated Jul 2026
★ 541repo stars
zustand-patterns
by yonatangross · yonatangross/orchestkit

Master Zustand 5.x state management with practical patterns for React applications. This reference covers store creation, middleware composition, selector optimization, and persistence strategies—all with TypeScript examples and clear anti-patterns to avoid.

MITupdated Jul 2026
★ 208repo stars

More skills zustand (Apache-2.0) · zustand-5 (MIT) · zustand-5 (Apache-2.0) · state-management (MIT)

Tags
state-containerhook-based-apiprovider-lessselector-optimizationmiddleware-extensiblevanilla-js-supportdev-toolingpersistence-layer