state

Match React state types to storage and update mechanisms.

4|1|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/reliant-labs/forge --skill state-reliant-labs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: state
Source: https://github.com/reliant-labs/forge/tree/main/internal/templates/project/skills/forge/frontend/state
Command: npx skills add https://github.com/reliant-labs/forge --skill state-reliant-labs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents frontend state from becoming inconsistent or unmaintainable by clarifying when to use local state, stores, URL state, server hooks, or event-based side effects.

Core Features & Use Cases

  • State vs events separation: Model “what is true right right now” as state and “what just happened” as events, updating state first before emitting side effects.
  • Clear ownership rules: Define who owns each piece of state, who can update it, and whether it must survive refresh via URL or localStorage.
  • Async correctness: Require loading, error, success, and empty handling for async operations using generated React Query hooks.
  • Scalable system expansion: Integrate auth, network events, and additional state systems via pack-driven scaffolding while keeping a consistent architecture.

Quick Start

Choose the smallest state scope that fits your scenario, implement server data with generated React Query hooks, and keep durable navigation state in the URL instead of global stores.

Frequently Asked Questions about state

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

FAQPage Schema
How do I choose the right frontend state management tool for React?

To choose the right frontend state management tool, match the state type to its correct storage mechanism: use local component state for UI, URL state for durable navigation, and generated React Query hooks for server-backed data.

When should I use URL state instead of a global store in React?

Use URL state instead of a global store when you need durable navigation state that must survive page refreshes. Global stores like Zustand are better suited for app-wide dependencies that do not need to persist in the URL.

What is the difference between state and events in frontend state management?

In frontend state management, state models what is true right now, while events model what just happened. You must update the state first before emitting side effects to ensure consistent rendering and event-driven actions.

How do I handle async loading and error states with React Query?

Handle async loading and error states with React Query by requiring explicit handling for loading, error, empty, and success conditions. Generated React Query hooks help maintain this async correctness across server-backed data operations.

Do I need a global store for component UI state in React?

You do not need a global store for component UI state in React. You should choose the smallest state scope that fits your scenario, keeping component-level UI state local rather than pushing it into Zustand or React Context.