agent-browser
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling…
Expert guide for Zustand state management patterns, store organization, and best practices. Use when implementing client state management with Zustand, creating stores, or managing shared UI state across components.
Claude Code
$ npx -y skills add pedronauck/skills --skill zustand --agent claude-code
Codex
$ npx skills add pedronauck/skills --skill zustand -a codex -y
Cursor
$ npx skills add pedronauck/skills --skill zustand -a cursor -y
Gemini CLI
$ npx skills add pedronauck/skills --skill zustand -a gemini-cli -y
GitHub Copilot
$ npx skills add pedronauck/skills --skill zustand -a github-copilot -y
OpenCode
$ npx skills add pedronauck/skills --skill zustand -a opencode -y
Windsurf
$ npx skills add pedronauck/skills --skill zustand -a windsurf -y
name: zustand description: Expert guide for Zustand state management patterns, store organization, and best practices. Use when implementing client state management with Zustand, creating stores, or managing shared UI state across components. allowed-tools: Read, Grep, Glob
This skill provides guidelines, patterns, and best practices for working with Zustand in this project.
For detailed store patterns, middleware usage, and comprehensive examples, please refer to `references/patterns.md`.
Use the following middleware combination for production stores:
import { create } from "zustand";
import { devtools, persist } from "zustand/middleware";
import { immer } from "zustand/middleware/immer";
export const useExampleStore = create<ExampleState>()(
devtools(
persist(
immer((set, get) => ({
// state and actions
})),
{ name: "example-storage" }
),
{ name: "example-store" }
)
);interface StoreState {
// State properties
data: DataType | null;
isLoading: boolean;
// Group actions together
actions: {
fetchData: () => Promise<void>;
updateData: (updates: Partial<DataType>) => void;
reset: () => void;
};
}Always create selector hooks for performance optimization:
// Bad - subscribes to entire store
const { user, isLoading } = useAuthStore();
// Good - subscribes only to specific slices
export const useUser = () => useAuthStore((state) => state.user);
export const useIsLoading = () => useAuthStore((state) => state.isLoading);
export const useAuthActions = () => useAuthStore((state) => state.actions);1. **Keep stores focused** on specific domains 2. **Use TypeScript** for full type safety 3. **Leverage middleware** for common patterns (devtools, persist, immer) 4. **Create selector hooks** for performance 5. **Use immer** for complex nested state updates 6. **Persist only necessary state** - use `partialize` option 7. **Test stores thoroughly** 8. **Handle async operations properly** with loading/error states 9. **Implement optimistic updates** when appropriate 10. **Document store structure** and actions
1. Define the state interface with typed actions 2. Create the store with appropriate middleware 3. Export selector hooks for each state slice 4. Add to the feature's barrel export
Use the `persist` middleware with `partialize` to persist only necessary data:
persist(
(set) => ({ /* ... */ }),
{
name: "store-key",
partialize: (state) => ({
// Only persist these fields
user: state.user,
preferences: state.preferences,
}),
}
);Immer allows mutable-style updates that produce immutable state:
immer((set) => ({
updateNested: (id, value) => {
set((state) => {
const item = state.items.find((i) => i.id === id);
if (item) {
item.value = value; // Mutable style, but produces immutable state
}
});
},
}));Before finishing a task involving Zustand:
For detailed rules, examples, and anti-patterns, please consult `references/patterns.md`.
A curated collection of 89 agent skills for Claude Code and compatible AI coding assistants — 43 original (⭐️), 33 hand-picked (💎), and 13 marketing & business (📣).
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling…
Answer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like…
Autonomously optimize any Claude Code skill by running it repeatedly, scoring outputs against binary evals, mutating the prompt,…
Centrifugo real-time messaging server expert for WebSocket PUB/SUB, channel management, JWT authentication, event proxying, and…
Retrieves up-to-date documentation, API references, and code examples for any developer technology. Use this skill whenever the…
Diátaxis Documentation Expert. An expert technical writer specializing in creating high-quality software documentation, guided by…
Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid…
Design and build AI agents for any domain. Use when users: (1) ask to "create an agent", "build an assistant", or "design an AI…