state-management

Select frontend state architecture using a decision tree for useState, Context API, Zustand, and Redux Toolkit.

1|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/Prathmesh2000/cursor_agent-orchestrator --skill state-management-prathmesh2000
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: state-management
Source: https://github.com/Prathmesh2000/cursor_agent-orchestrator/tree/main/agent-system/skills/state-management
Command: npx skills add https://github.com/Prathmesh2000/cursor_agent-orchestrator --skill state-management-prathmesh2000

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Guides teams to design scalable client-side state architectures for frontend applications, clarifying when to use local UI state, global stores, or server-derived state, and avoiding common anti-patterns.

Core Features & Use Cases

  • Decision-tree guidance for selecting between useState, Context API, Zustand, and Redux Toolkit
  • Ready-to-use store patterns and code samples for Zustand slices and Redux slices
  • Real-world use cases including form state, shared UI state, multi-page flows, and real-time data synchronization

Quick Start

Scaffold a Zustand-based state store for a dashboard and wire it to your React components.

Frequently Asked Questions about state-management

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
When should I use local useState versus a global store for React state management?

React state management should use local useState for simple, isolated component data and global stores for cross-page or deeply shared UI state. A decision tree helps map scenarios like form inputs to useState and multi-page flows to Zustand or Redux Toolkit.

How do I choose between Context API and Zustand for frontend state architecture?

Choosing between Context API and Zustand for frontend state architecture depends on update frequency and scope. Context API suits low-frequency shared UI state, while Zustand handles high-frequency updates and complex slices better without triggering unnecessary component re-renders.

Does Redux Toolkit work well for simple form state in a React application?

Redux Toolkit works for simple form state in React but introduces unnecessary boilerplate. For simple forms, local useState is recommended to avoid anti-patterns, reserving Redux Toolkit for complex cross-page state and real-time data synchronization scenarios.

What is the best way to scaffold a Zustand store for a React dashboard?

The best way to scaffold a Zustand store for a React dashboard is to define production-ready slices with clear selectors. This state management pattern isolates dashboard data logic and wires it directly to components, preventing unnecessary re-renders.

How do I manage server-derived state separately from client-side state in Redux?

Managing server-derived state separately from client-side state in Redux involves isolating fetched data into dedicated slices. This state management pattern uses selectors to consume server data, keeping client UI state decoupled and avoiding common anti-patterns.

What are common frontend state management anti-patterns when scaling a TypeScript application?

Common frontend state management anti-patterns include overusing global stores for local UI state and mixing server-derived data with client state. Applying a decision tree prevents these by enforcing production-ready patterns and clear boundaries between useState, Context, and Zustand.