What problem does it solve?
It prevents inefficient or incorrect client-side state management in SpotiArr’s frontend by enforcing clear rules for when to use Zustand versus server-state caching.
Core Features & Use Cases
- Enforces a two-store architecture: guarantees exactly two Zustand stores—one ephemeral and one persisted—for predictable behavior.
- Separates UI state from server state: routes server events and cache invalidation through TanStack Query while keeping transient download progress in memory.
- Improves rendering performance: mandates granular selectors and bulk selector hooks to avoid N-per-item subscriptions in list UIs.
- Supports durable preferences: uses persisted middleware for sidebar and UI preferences so refreshes don’t reset the experience.
Quick Start
Use this skill as your checklist when adding client-side state in apps/frontend/src/store/, ensuring server-derived state goes to TanStack Query and UI-only state is added to exactly one of the two defined Zustand stores.