role-frontend:state-management

Guide React state management across local, global, server cache, and URL state.

14|3|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/rnavarych/alpha-engineer --skill role-frontend-state-management
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: role-frontend:state-management
Source: https://github.com/rnavarych/alpha-engineer/tree/main/plugins/roles/role-frontend/skills/state-management
Command: npx skills add https://github.com/rnavarych/alpha-engineer --skill role-frontend-state-management

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers make informed decisions about where and how to manage application state in React, optimizing performance and maintainability.

Core Features & Use Cases

  • State Colocation: Guides decisions on local vs. global state, server cache, or URL state.
  • Store Implementation: Provides patterns for Zustand, Jotai, and Redux Toolkit.
  • Advanced Patterns: Covers optimistic updates, state machines with XState, and server state management with React Query/SWR.
  • Use Case: You're building a complex form with many interconnected fields and need to decide the best way to manage its state to avoid performance issues and ensure smooth validation.

Quick Start

Use the state-management skill to set up Zustand for managing global user authentication state.

Frequently Asked Questions about role-frontend:state-management

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

FAQPage Schema
How do I decide between local and global state management in React?

React state management decisions depend on colocating state locally for isolated components or lifting it globally using Zustand or Redux Toolkit when shared access is needed across the application.

What's the best way to manage server cache state in React applications?

Server cache state in React is best managed using TanStack Query or SWR to handle data fetching and background updates, separating server state from client global state managed by Zustand or Jotai.

How do I implement optimistic updates with React Query and Zustand?

Optimistic updates with TanStack Query and Zustand involve immediately updating local UI state before server mutations complete, then rolling back or confirming based on the server response to ensure smooth user experiences.

When should I use XState state machines instead of Redux Toolkit?

Use XState state machines instead of Redux Toolkit when managing complex component logic requiring strict transitions and predictable behavior, whereas Redux Toolkit is suited for standard global application state.

How do I optimize React state management performance with granular selectors?

Optimize React state management performance using granular selectors and efficient subscriptions in Zustand or Jotai, ensuring components only re-render when their specific state slices actually change.

Can I use Jotai for managing complex interconnected form fields in React?

Yes, Jotai is suitable for managing complex interconnected form fields in React because its atomic state model allows fine-grained updates to individual fields, preventing unnecessary re-renders and ensuring smooth validation.