Skip to main content
skill Claude Code CX Codex Cursor

react-state-management — Claude Code skill

Helps choose and structure React state management for local, global, server, URL, and form data.

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add wshobson/agents
/plugin install frontend-mobile-development@claude-code-workflows
Open on GitHub

What react-state-management does

This skill maps React state to the right category and tool. It covers local state with useState and useReducer, shared state with Redux Toolkit, Zustand, and Jotai, plus remote data with React Query, SWR, and RTK Query. URL state and form state are included as well.

It gives selection guidance for small and large apps, shows a Zustand store using devtools and persist, and covers selectors, normalized data, and the split between client and server state. There are also sections on optimistic updates, state debugging, and moving from legacy Redux to Redux Toolkit.

Install it when you are choosing a React state architecture or planning a Redux migration. It is a poor fit for projects that do not use React.

What it helps with

  • choose a global state library for a React app
  • separate server data from client state
  • set up a persisted Zustand store
  • trace unnecessary React re-renders
  • migrate legacy Redux to Redux Toolkit

Example prompts for the agent

  • Compare Redux Toolkit, Zustand, and Jotai for this React app and recommend one.
  • Separate this project’s local, global, and server state, then propose a React Query setup.
  • Rewrite this legacy Redux reducer with Redux Toolkit.

How to install react-state-management

1Plugin marketplace

/plugin marketplace add wshobson/agents
/plugin install frontend-mobile-development@claude-code-workflows

This installs the whole frontend-mobile-development plugin with all its skills

2Skills CLI (Vercel)

npx skills add wshobson/agents --skill react-state-management -a claude-code

3Manually: put the files in place

~/.claude/skills/react-state-management/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/react-state-management/

From the same set213

The whole set →
typescript-advanced-types Seth Hobson Guides an agent through advanced TypeScript types, from generics to conditional and mapped types. Use it for typed libraries, API clients, or strict configuration objects. Claude Code CX Codex Cursor 92,169installs tailwind-design-system Seth Hobson Helps build design systems with Tailwind CSS v4, from theme tokens to component variants. Use it when a project needs shared UI patterns. Claude Code CX Codex Cursor 70,180installs brand-landingpage Travis D. Elliott This skill interviews you about the product and its visual direction, then builds a landing page through Stitch. Use it when there’s no established design yet. Claude Code CX Codex Cursor 39,476installs python-testing-patterns Seth Hobson This skill guides Python testing with pytest, fixtures and mocks. Use it when building a test suite or tracking down failing checks. Claude Code CX Codex Cursor 36,943installs python-performance-optimization Seth Hobson This skill profiles Python code to locate CPU and memory bottlenecks. Use it when an application responds slowly or consumes too many resources. Claude Code CX Codex Cursor 35,675installs nextjs-app-router-patterns Seth Hobson This skill covers Next.js App Router patterns for rendering, routing, and data fetching. Use it when starting an App Router project or moving from Pages Router. Claude Code CX Codex Cursor 32,529installs api-design-principles Seth Hobson Use this skill to plan or review REST and GraphQL APIs. It helps when writing a specification or setting API conventions for a team. Claude Code CX Codex Cursor 30,348installs code-review-excellence Seth Hobson This skill guides pull request reviews, catches logic and security issues, and helps teams give specific feedback. Use it for review standards or developer mentoring. Claude Code CX Codex Cursor 30,193installs

Similar

angular-developer Copyright 2026 Google LLC Generates Angular code and gives architecture guidance for components, services, forms, routing, and HTTP. Useful when starting or changing an Angular project. Claude Code CX Codex Cursor +1 45,900installs devtools vercel-labs Debug panel for json-render apps: component tree, state editor, actions log, streaming patches, and element picker. Claude Code CX Codex Cursor +1 8,300installs chakra-ui-migrate chakra-ui A migration skill that guides projects from Chakra UI v2 to v3. It handles package cleanups, codemods, provider setup, and updated component props. Claude Code CX Codex Cursor +1 1,800installs winui3-migration-guide official github This skill helps move UWP code to WinUI 3 and Windows App SDK. Use it to check API replacements, namespaces, and common Copilot mistakes. GitHub Copilot 5,700installs frontend-design official anthropics This skill guides intentional visual design for new interfaces and redesigns. Use it when a generic generated UI is not enough. Claude Code Claude.ai 1,025,790installs design-taste-frontend Leonxlnx This skill directs the design of public pages and work screens, then checks the result in a browser through screenshots. Use it when an interface feels generic or unfinished. Claude Code CX Codex Cursor +1 673,100installs prototype Matt Pocock Creates throwaway prototypes for checking state logic or exploring UI before committing the decision to the main codebase. Claude Code 986,201installs hyperframes heygen-com Instructs coding agents on creating, validating, and rendering HTML-based videos using the HyperFrames framework and CLI. Claude Code CX Codex Cursor +1 1,200,000installs

Questions about react-state-management

How do I install react-state-management in Claude Code?

Run npx skills add wshobson/agents --skill react-state-management -a claude-code. The skill file will be available at ~/.claude/skills/react-state-management/SKILL.md.

What does react-state-management do?

It helps design state in React apps and choose between Redux Toolkit, Zustand, Jotai, React Query, and related solutions.

Which platforms support react-state-management?

The skill targets Claude Code, Codex, and Cursor. Its instructions also include commands for GitHub Copilot and Gemini CLI.

Source text

SKILL.md · MIT
---
name: react-state-management
description: Master modern React state management with Redux Toolkit, Zustand, Jotai, and React Query. Use when setting up global state, managing server state, or choosing between state management solutions.
---

# React State Management

Comprehensive guide to modern React state management patterns, from local component state to global stores and server state synchronization.

## When to Use This Skill

- Setting up global state management in a React app
- Choosing between Redux Toolkit, Zustand, or Jotai
- Managing server state with React Query or SWR
- Implementing optimistic updates
- Debugging state-related issues
- Migrating from legacy Redux to modern patterns

## Core Concepts

### 1. State Categories

| Type             | Description                  | Solutions                     |
| ---------------- | ---------------------------- | ----------------------------- |
| **Local State**  | Component-specific, UI state | useState, useReducer          |
| **Global State** | Shared across components     | Redux Toolkit, Zustand, Jotai |
| **Server State** | Remote data, caching         | React Query, SWR, RTK Query   |
| **URL State**    | Route parameters, search     | React Router, nuqs            |
| **Form State**   | Input values, validation     | React Hook Form, Formik       |

### 2. Selection Criteria

```
Small app, simple state → Zustand or Jotai
Large app, complex state → Redux Toolkit
Heavy server interaction → React Query + light client state
Atomic/granular updates → Jotai
```

## Quick Start

### Zustand (Simplest)

```typescript
// store/useStore.ts
import { create } from 'zustand'
import { devtools, persist } from 'zustand/middleware'

interface AppState {
  user: User | null
  theme: 'light' | 'dark'
  setUser: (user: User | null) => void
  toggleTheme: () => void
}

export const useStore = create<AppState>()(
  devtools(
    persist(
      (set) => ({
        user: null,
        theme: 'light',
        setUser: (user) => set({ user }),
        toggleTheme: () => set((state) => ({
          theme: state.theme === 'light' ? 'dark' : 'light'
        })),
      }),
      { name: 'app-storage' }
    )
  )
)

// Usage in component
function Header() {
  const { user, theme, toggleTheme } = useStore()
  return (
    <header className={theme}>
      {user?.name}
      <button onClick={toggleTheme}>Toggle Theme</button>
    </header>
  )
}
```

## Detailed patterns and worked examples

Detailed pattern documentation lives in `references/details.md`. Read that file when the navigation tier above is insufficient.

## Best Practices

### Do's

- **Colocate state** - Keep state as close to where it's used as possible
- **Use selectors** - Prevent unnecessary re-renders with selective subscriptions
- **Normalize data** - Flatten nested structures for easier updates
- **Type everything** - Full TypeScript coverage prevents runtime errors
- **Separate concerns** - Server state (React Query) vs client state (Zustand)

### Don'ts

- **Don't over-globalize** - Not everything needs to be in global state
- **Don't duplicate server state** - Let React Query manage it
- **Don't mutate directly** - Always use immutable updates
- **Don't store derived data** - Compute it instead
- **Don't mix paradigms** - Pick one primary solution per category

## Migration Guides

### From Legacy Redux to RTK

```typescript
// Before (legacy Redux)
const ADD_TODO = "ADD_TODO";
const addTodo = (text) => ({ type: ADD_TODO, payload: text });
function todosReducer(state = [], action) {
  switch (action.type) {
    case ADD_TODO:
      return [...state, { text: action.payload, completed: false }];
    default:
      return state;
  }
}

// After (Redux Toolkit)
const todosSlice = createSlice({
  name: "todos",
  initialState: [],
  reducers: {
    addTodo: (state, action: PayloadAction<string>) => {
      // Immer allows "mutations"
      state.push({ text: action.payload, completed: false });
    },
  },
});
```

© Seth Hobson · MIT · wshobson/agents

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor