Skip to content

Concise Zustand 5 store patterns covering selectors, middleware, slices, and async actions for React state.

CCM score
57 of 100
skills.sh installs
214
GitHub stars
681
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers basic stores, persist, immer, and devtools middleware with a store-per-concern layout
  • Includes useShallow selector guidance and a slices pattern for combining user and cart state
  • Enforces selecting specific fields instead of the whole store to avoid unnecessary re-renders
  • Designed for React projects that manage client state with Zustand and need async fetch handling

Install

$ npx -y skills add gentleman-programming/gentleman-skills --skill zustand-5 -y

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

Files

Basic Store

import { create } from "zustand";

interface CounterStore {
  count: number;
  increment: () => void;
  decrement: () => void;
  reset: () => void;
}

const useCounterStore = create<CounterStore>((set) => ({
  count: 0,
  increment: () => set((state) => ({ count: state.count + 1 })),
  decrement: () => set((state) => ({ count: state.count - 1 })),
  reset: () => set({ count: 0 }),
}));

// Usage
function Counter() {
  const { count, increment, decrement } = useCounterStore();
  return (
    <div>
      <span>{count}</span>
      <button onClick={increment}>+</button>
      <button onClick={decrement}>-</button>
    </div>
  );
}

Persist Middleware

import { create } from "zustand";
import { persist } from "zustand/middleware";

interface SettingsStore {
  theme: "light" | "dark";
  language: string;
  setTheme: (theme: "light" | "dark") => void;
  setLanguage: (language: string) => void;
}

Details

Repository
github.com/gentleman-programming/gentleman-skills
Category
Frontend & UI Code
First seen
Jun 3, 2026

Questions

What is the zustand-5 skill for?

The zustand-5 skill teaches an AI assistant Zustand 5 state management patterns for React. It covers basic stores, persist, selectors with useShallow, async actions, slices, Immer, DevTools and using a store outside React.

How do I install the zustand-5 skill?

Run npx -y skills add gentleman-programming/gentleman-skills --skill zustand-5 -y in a project. The skill then lets the agent write React state code with Zustand 5 following these patterns.

Which category does zustand-5 belong to and what leads it?

zustand-5 sits in the Frontend and UI Code category on Claude Marketplaces. It is listed alongside vercel-react-best-practices, web-design-guidelines, design-taste-frontend, vercel-composition-patterns and lark-apps, and it focuses specifically on Zustand state stores.

Does zustand-5 help avoid unnecessary re-renders?

Yes, the skill shows selecting specific fields in Zustand 5 selectors and using useShallow for multiple fields. It warns against selecting the entire store, which re-renders on any state change.

More from gentleman-programming/gentleman-skills

All 13

Similar to Zustand 5

More Frontend & UI Code