intense-visions/harness-engineering/react-state-management-pattern
Claude Code and agent skill by intense-visions/harness-engineering
Trust tier 2
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Install
npx vskill@latest install intense-visions/harness-engineering/react-state-management-patternSKILL.md
The same SKILL.md was published earlier as intense-visions/harness-engineering/react-state-management-pattern.
React State Management Pattern
Choose the right state management approach for your React application scale
When to Use
- You are deciding how to manage state in a new React application
- Local component state is no longer sufficient (multiple components need the same data)
- Context re-render performance is becoming a problem
- You need derived state, selectors, or middleware (Redux DevTools, undo/redo)
Instructions
Decision tree:
- Local state first: Start with
useState/useReducer. Do not reach for global state until you have a specific problem. - Shared low-frequency state: Use React Context +
useContextfor data that rarely changes (theme, auth, locale). - Shared high-frequency state (small apps): Use Zustand for minimal boilerplate, selector-based subscriptions, and devtools support.
- Complex domain state (large apps): Use Redux Toolkit for predictable state machines, time-travel debugging, and team consistency.
- Server state: Use React Query or SWR — not client state management — for data that comes from an API.
Details
State categories:
- UI state: Open/closed, selected tab, scroll position — local state or URL params
- Server state: API data — React Query, SWR, RTK Query
- Global app state: User session, theme, cart — Context or Zustand
- Complex domain state: Multi-entity updates, undo/redo, optimistic updates — Redux Toolkit
Library comparison (2024):
| Library | Bundle | Boilerplate | DevTools | Selectors | |
|---|---|---|---|---|---|
| Context | 0KB | Low | No | No | |
| Zustand | ~1KB | Very low | Yes | Yes | |
| Jotai | ~3KB | Low | Yes | Atoms | |
| Redux Toolkit | ~12KB | Medium | Excellent | Yes |
React 19 note: With the React compiler, many manual performance optimizations in Zustand/Redux become less necessary as React auto-memoizes.
Source
https://patterns.dev/react/state-management
Process
- Read the instructions and examples in this document.
- Apply the patterns to your implementation, adapting to your specific context.
- Verify your implementation against the details and edge cases listed above.
Harness Integration
- Type: knowledge — this skill is a reference document, not a procedural workflow.
- No tools or state — consumed as context by other skills and agents.
Success Criteria
- The patterns described in this document are applied correctly in the implementation.
- Edge cases and anti-patterns listed in this document are avoided.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingagents/skills/codex/react-state-management-pattern/SKILL.md
Popularity
- Repository stars
- 9
- Repository forks
- 5
- 7-day trend score
- 12
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 28 Apr 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/intense-visions/harness-engineering/react-state-management-pattern)