renatoroessler/painel-clima/zustand
Claude Code and agent skill by renatoroessler/painel-clima
- community
Checking that the SKILL.md file is still in the repository.
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.
Install
npx vskill@latest install renatoroessler/painel-clima/zustandSKILL.md
The same SKILL.md was published earlier as pedronauck/skills/zustand.
Zustand State Management Guide
This skill provides guidelines, patterns, and best practices for working with Zustand in this project.
Quick Start
For detailed store patterns, middleware usage, and comprehensive examples, please refer to references/patterns.md.
Core Philosophy
- Shared Client State Only: Use Zustand for shared client state, not server state (use TanStack Query for that).
- Domain-Specific Stores: Keep stores focused on specific domains.
- Type Safety: Leverage TypeScript for fully typed stores.
- Simplicity: Prefer simplicity over complex abstractions.
Store Organization
Essential Patterns
- Create separate stores for different domains
- Use slices pattern for large stores
- Keep stores close to features that use them
- Export typed selector hooks for better DX and performance
Recommended Middleware Stack
Use the following middleware combination for production stores:
Store Structure Template
Selector Hooks Pattern
Always create selector hooks for performance optimization:
Best Practices
- Keep stores focused on specific domains
- Use TypeScript for full type safety
- Leverage middleware for common patterns (devtools, persist, immer)
- Create selector hooks for performance
- Use immer for complex nested state updates
- Persist only necessary state - use
partializeoption - Test stores thoroughly
- Handle async operations properly with loading/error states
- Implement optimistic updates when appropriate
- Document store structure and actions
Common Tasks
Creating a New Store
- Define the state interface with typed actions
- Create the store with appropriate middleware
- Export selector hooks for each state slice
- Add to the feature's barrel export
Persisting State
Use the persist middleware with partialize to persist only necessary data:
Using Immer for Updates
Immer allows mutable-style updates that produce immutable state:
Validation Checklist
Before finishing a task involving Zustand:
- [ ] Store is domain-specific and focused
- [ ] TypeScript interfaces are properly defined
- [ ] Middleware is applied in correct order (devtools > persist > immer)
- [ ] Selector hooks are created for performance
- [ ] Actions are grouped in an
actionsobject - [ ] Only necessary state is persisted
- [ ] Run type checks (
pnpm run typecheck) and tests (pnpm run test)
For detailed rules, examples, and anti-patterns, please consult references/patterns.md.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingfrontend/.agents/skills/zustand/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/renatoroessler/painel-clima/zustand)