This gives you solid Zustand 5 patterns for React state management without the boilerplate of Redux. You get basic stores, selectors with the new useShallow hook to prevent unnecessary renders, persist middleware for localStorage, async actions, and the slices pattern for organizing larger stores. The Immer middleware examples are genuinely useful if you're tired of spreading objects everywhere. It covers the practical stuff like accessing state outside React and using DevTools. If you're reaching for Context API and prop drilling is annoying you, or Redux feels like overkill, these patterns are a good middle ground. Clean, typed examples throughout.

skills.sh installs
207
GitHub stars
665
last updated
Aug 21, 2026

Install

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

Installs into .claude/skills of the current project.

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;
}

Sponsors

Details

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

More from gentleman-programming/gentleman-skills

All 13
1oguzhan18 avatarangular-testingoguzhan18/angular-ecosystem-skillsALWAYS use when writing tests for Angular applications, including unit tests, component tests, service tests, or E2E tests with Jasmine, Karma, Vitest, or Cypre197skills.sh installs
2personamanagmentlayer avatarreact-expertpersonamanagmentlayer/pclExpert-level React development with hooks, performance optimization, state management, and modern patterns197skills.sh installs
3travisjneuman avatargeneric-react-design-systemtravisjneuman/.claudeComplete design system reference for React applications. Covers colors, typography, spacing, component patterns, glassmorphism effects, GPU-accelerated animatio187skills.sh installs
4oguzhan18 avatarangular-viewchildoguzhan18/angular-ecosystem-skillsALWAYS use when working with Angular ViewChild, ContentChild, ViewChildren, or accessing DOM elements and child components in Angular.174skills.sh installs
5andrelandgraf avatarnextjs-on-vercelandrelandgraf/fullstackrecipesCreate a Next.js app running on Bun, configure the development environment, and deploy to Vercel with automatic deployments on push.164skills.sh installs
6posthog avatarfeature-flags-nextjsposthog/skillsPostHog feature flags for Next.js applications139skills.sh installs