zustand-store-ts
Skill424 starsChanged 39 days agoMITView on GitHub
Create Zustand stores with TypeScript, subscribeWithSelector middleware, and proper state/action separation. Use when building React state management, creating global stores, or implementing reactive state patterns with Zustand.
4 other projects use a version of this, 3 of them edited.
Adopted by
Most recently taken up by
- microsoft/skillsedited, first seen Oct 13, 2026
- microsoft/agent-skillsedited, first seen Oct 8, 2026
- Adhamxon/claude-code-skillsedited, first seen Jul 30, 2026
- NaviAndrei/AgentFlow-Studiotheir own version, first seen Jun 30, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 3
- microsoft/skills★ 3.2k98% same
- microsoft/agent-skills★ 3.2k98% same
- Adhamxon/claude-code-skills★ 265% same
Wrote their own version · 1
- NaviAndrei/AgentFlow-Studio★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ant-designSkill
- maafwSkill
- mpe-background-artSkill
- react-flow-node-tsSkill
- shadcnSkill
- sync-reference-projectsSkill
- tauri-for-mpeSkill
- ui-ux-pro-maxSkill
- update-local-mfwSkill
- web-design-guidelinesSkill
The file
We split this skill into the rules it gives an agent
3 rules. 1 is common, 0 are distinctive, and 2 are very specific to this project.
1
Common
Most of the 4 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Common: line 12
Create Zustand stores following established patterns with proper TypeScript types and middleware.
- Very specific: line 73
Create store in src/frontend/src/store/
- Very specific: line 75
Add tests in src/frontend/src/store/*.test.ts
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Zustand Store
Create Zustand stores following established patterns with proper TypeScript types and middleware.
Website: https://zustand.nodejs.cn/docs/getting-started/introduction
Quick Start
Copy the template from assets/template.ts and replace placeholders:
{{StoreName}}→ PascalCase store name (e.g.,Project){{description}}→ Brief description for JSDoc
Always Use subscribeWithSelector
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
- Create store in
src/frontend/src/store/ - Export from
src/frontend/src/store/index.ts - Add tests in
src/frontend/src/store/*.test.ts
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

