zustand-store-ts – Coding skill for AI agents
Create Zustand stores following established patterns with proper TypeScript types and middleware.
Install the zustand-store-ts skill with one command
Pick the tool you use, copy the command and paste it in your terminal. The skill lands in that tool's skills folder and is ready in your next session.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/zustand-store-ts-84670.tgz | tar xz -C ~/.claude/skills
Call it in Claude Code: /zustand-store-ts – then describe the task you want done.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/zustand-store-ts-84670.tgz | tar xz -C ~/.codex/skills
Call it in Codex: $zustand-store-ts – then describe the task you want done.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/zustand-store-ts-84670.tgz | tar xz -C ~/.hermes/skills
Call it in Hermes Agent: /zustand-store-ts – then describe the task you want done.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/zustand-store-ts-84670.tgz | tar xz -C ~/.deepcode/skills
Call it in DeepSeek: /zustand-store-ts – then describe the task you want done.
SKILL.md content
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
useMyStore.subscribe(
(state) => state.selectedId,
(selectedId) => console.log('Selected:', selectedId)
);Integration Steps
1. Create store in src/frontend/src/store/
2. Export from src/frontend/src/store/index.ts
3. Add tests in src/frontend/src/store/*.test.ts
When to Use
This skill is applicable to execute the workflow or actions described in the overview.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Related skills
- ab-testing – When the user wants to plan, design, or implement an A/B test or experiment, or build a…
- adaptyv – Uses the Adaptyv Bio Foundry API and Python SDK to design protein characterization…
- ab-test-setup – When the user wants to plan, design, or implement an A/B test or experiment. Also use…
- access-lifecycle – Use when preparing or running a user access review, checking that leavers lost their…
- aspnet-core – Build, review, refactor, or architect ASP.NET Core web applications using current…
- deepcode-self-refer – Answers questions about Deep Code CLI itself — including features, configuration…
- api-noauth-hunt – Use when an API may expose data or privileged operations without authentication.
- algorithmic-art – Creating algorithmic art using p5.js with seeded randomness and interactive parameter…