1075551341/claude_code_config/state-management
Claude Code and agent skill by 1075551341/claude_code_config
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
管理前端状态、使用Redux/Pinia/Zustand、设计全局状态存储
Install
npx vskill@latest install 1075551341/claude_code_config/state-managementSKILL.md
The same SKILL.md was published earlier as 1075551341/claude_code_config/state-management.
状态管理最佳实践
描述
前端状态管理技能,涵盖 React(Zustand/Redux/Jotai)和 Vue(Pinia)的状态设计、 Store 拆分、异步状态处理、持久化和性能优化
触发条件
设计或实现前端状态管理方案时使用,包括全局状态、跨组件通信、缓存策略等场景
技术方案选型
| 场景 | 推荐方案 | 理由 | |
|---|---|---|---|
| React 轻量状态 | Zustand | API 简洁,无 Provider,按需渲染 | |
| React 复杂状态 | Redux Toolkit | 中间件生态完整,DevTools 强大 | |
| React 原子状态 | Jotai | 细粒度更新,适合表单/编辑器 | |
| React 服务端状态 | TanStack Query | 缓存/重试/乐观更新一站式 | |
| Vue 状态管理 | Pinia | Vue 官方推荐,TypeScript 友好 |
Zustand 模板
Pinia 模板
最佳实践
- Store 拆分:按业务领域拆分(user/product/cart),禁止单一巨大 Store
- 选择器优化:使用 selector 精确订阅,避免不必要重渲染
- 异步状态:分离 loading/error/data 三态
- 持久化:仅持久化必要数据(Token/偏好),避免缓存过期数据
- 不可变更新:使用 Immer 或展开运算符,禁止直接修改 state
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 repositoryCheckingcatalog/skills/state-management/SKILL.md
Popularity
- 7-day trend score
- 5
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/1075551341/claude_code_config/state-management)