Skip to content

Typed Zustand store patterns with subscribeWithSelector, split state and actions, and selector-based rendering.

CCM score
49 of 100
skills.sh installs
254
GitHub stars
50.5K
last updated
Jun 3, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers store creation with subscribeWithSelector middleware, separated state and action interfaces, and out-of-React subscriptions
  • Demonstrates individual selectors that limit re-renders to changes in the specific state slice a component reads
  • Specifies integration steps: create the store in src/frontend/src/store/, export it from index.ts, and add *.test.ts files
  • Designed for React projects using Zustand that want consistent store structure and typed state management

Install

$ npx -y skills add sickn33/agentic-awesome-skills --skill zustand-store-ts -y

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

Files

Zustand Store

Create Zustand stores following established patterns with proper TypeScript types and middleware.

Quick Start

No assets/template.ts is bundled. Adapt the inline examples to the installed Zustand version and actual project types; these are fragments, not a complete application.

Use subscribeWithSelector for selector subscriptions

import { create } from 'zustand';
import { subscribeWithSelector } from 'zustand/middleware';

export const useMyStore = create<MyStore>()(
  subscribeWithSelector((set, get) => ({
    // state and actions
  }))
);

Separate State and Actions

export interface MyState {
  items: Item[];
  isLoading: boolean;
}

export interface MyActions {
  addItem: (item: Item) => void;
  loadItems: () => Promise<void>;
}

export type MyStore = MyState & MyActions;

Use Individual Selectors

// Good - only re-renders when `items` changes
const items = useMyStore((state) => state.items);

// Avoid - re-renders on any state change
const { items, isLoading } = useMyStore();

Subscribe Outside React

Details

Repository
github.com/sickn33/agentic-awesome-skills
Categories
Frontend & UI Code, Testing & QA
First seen
Jun 3, 2026

Questions

What does the zustand-store-ts skill do?

It helps an agent create Zustand stores that follow established patterns, with proper TypeScript types and middleware. The SKILL.md shows fragments such as subscribeWithSelector middleware, separating state and actions into interfaces, and using individual selectors to limit re-renders.

How do I install the zustand-store-ts skill?

Run npx -y skills add sickn33/agentic-awesome-skills --skill zustand-store-ts -y inside your project. Once installed, the agent can write Zustand stores and place them in the store folder with tests.

Which skills lead the Frontend & UI Code category?

zustand-store-ts sits in the Frontend & UI Code category on Claude Marketplaces, alongside vercel-react-best-practices, web-design-guidelines, design-taste-frontend, vercel-composition-patterns and lark-apps. It focuses narrowly on Zustand store design rather than general frontend guidance.

Does the zustand-store-ts skill need any extra setup?

The SKILL.md bundles no template file, so the agent adapts inline examples to the Zustand version and project types already in use. Store files go in src/frontend/src/store/, with an index export and tests beside them.

More from sickn33/agentic-awesome-skills

All 682

Similar to Zustand Store Ts

More Frontend & UI Code