Skip to content

Minimal React and vanilla JavaScript state store with selectors, persistence, and devtools support, without Redux boilerplate.

CCM score
55 of 100
skills.sh installs
261
GitHub stars
91
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers store creation, selector-based subscriptions, useShallow for multi-value reads, and access outside React components
  • Includes a vanilla createStore path for non-React code, plus middleware references for persist, devtools, and immer
  • Enforces two merge gates: persist must use explicit keys so secrets never reach localStorage, and devtools must be dev-only or justified
  • Designed for React apps that need global state without providers or Redux-level ceremony

Install

$ npx -y skills add existential-birds/beagle --skill zustand-state -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Zustand State Management (v5)

Minimal state management — named exports only (v5 removed default exports), React 18/19 compatible, and no global providers required.

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

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

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

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

Selectors & Performance (v5 useShallow)

Details

Repository
github.com/existential-birds/beagle
Category
Frontend & UI Code
First seen
Jun 3, 2026

Questions

What is the zustand-state skill used for?

zustand-state teaches an agent to build state stores with Zustand v5 for React and vanilla TypeScript. It covers curried create<T>() stores, useShallow selectors, persist with partialize, devtools, immer and React Context injection.

How do I install the zustand-state skill?

Run npx -y skills add existential-birds/beagle --skill zustand-state -y in your project. Once installed, zustand-state lets the agent write Zustand stores that avoid infinite selector re-renders.

Does zustand-state handle persisting state to localStorage safely?

zustand-state explains how to persist state with partialize so only explicit keys are written to storage. Its gate asks that persisted JSON never include auth tokens, API keys or other secrets.

Where does zustand-state stand in the Frontend and UI Code category?

zustand-state is listed in the Frontend and UI Code category on Claude Marketplaces, next to vercel-react-best-practices and web-design-guidelines. It stands apart by focusing on Zustand v5 store patterns, middleware and TypeScript typing.

More from existential-birds/beagle

All 37

Similar to Zustand State

More Frontend & UI Code