AGENT SKILL

zustand-store-design

Structure Zustand stores for predictable frontend state, derived selectors, and minimal rerenders.

适用职业设计师
License 许可
MIT
最近更新
2026-05-28
Stars
★ 0
Forks
0

01 前言 Front Matter

name
zustand-store-design
author
Siming
license
MIT
version
1.0.0
metadata
{ "siming": { "tags": [ "frontend", "zustand", "state" ] } }
description
Structure Zustand stores for predictable frontend state, derived selectors, and minimal rerenders.

03 SKILL.md 正文

Zustand Store Design

Use this skill when designing frontend state stores.

Workflow

  1. Keep server state in request/query layers when possible.
  2. Use Zustand for UI state, auth session snapshots, theme state, and cross-page local state.
  3. Split large stores by responsibility.
  4. Expose selectors to avoid rerendering unrelated components.
  5. Keep actions small and named by user intent.

Checks

  • No derived state stored unless it avoids expensive recomputation.
  • No hidden mutation outside store actions.

04 同仓库更多 Skills