void-state-architecture

Decide where React state lives using a tiered decision tree from URL to global stores.

Updated May 29, 2026
One-click install
npx skills add https://github.com/voidcorp-core/void-harness --skill void-state-architecture-voidcorp-core
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: void-state-architecture
Source: https://github.com/voidcorp-core/void-harness/tree/main/packages/cli/core-assets/packs/pack-react/skills/void-state-architecture
Command: npx skills add https://github.com/voidcorp-core/void-harness --skill void-state-architecture-voidcorp-core

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? React state frequently ends up in the wrong place: lifted too high so every input re-renders the page, kept too low so siblings cannot communicate, or pushed into a global store when a URL parameter would have sufficed. This Skill provides a strict decision tree that prevents useState-in-the-wrong-place sprawl. ## Core Features & Use Cases - Tiered decision tree: Evaluates state placement in priority order — URL search params, server ownership, local useState, lifted state, Zustand/Jotai stores, then React Query — defaulting to the highest tier that works. - Concrete code patterns: Shows correct and incorrect implementations for URL state with Next.js searchParams, Server Component data fetching, lifted state, and Zustand stores. - Anti-pattern detection: Flags common mistakes like storing form values in Zustand, mirroring server data in useState, and putting frequently-changing values in Context. - Use Case: When adding a filter to a product list page, the Skill directs you to URL search params instead of useState, so refresh, share links, and the back button all work. ## Quick Start Ask the agent where a new piece of React state should live, for example: where should I put the selected tab and filter values in my Next.js dashboard page?

Frequently Asked Questions about void-state-architecture

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

FAQPage Schema
How do I decide where to put state in a React app?

Use a top-down decision tree: URL first, then server, then local useState, then lifted state, then Zustand, then React Query. Pick the highest tier that satisfies the requirement rather than defaulting to a global store.

When should I use Zustand instead of useState?

Use Zustand only when state is genuinely cross-tree, client-only with no server source of truth, and lifting would cross more than five component levels. If any condition fails, local state or lifting is the correct choice.

React Query vs Server Components for server data?

With Next.js App Router and Server Actions, fetch server data directly in Server Components and skip React Query. React Query remains useful for optimistic updates outside Server Actions, polling dashboards, and non-RSC apps like Vite or Expo.

Why does putting state in React Context cause performance problems?

Every Context consumer re-renders on every value change, so frequently-changing state like form values or list selection kills performance. Context suits rarely-changing values like theme, locale, or auth user snapshots.

Should filter and pagination state go in the URL?

Yes, filters, sorts, pagination, tabs, and selected items belong in URL search params. This makes state survive refresh, produces shareable links, supports the back button, and lets the server render with correct data.