state-management

Classify frontend data values into local, shared, URL, or persistent state.

1|Updated May 6, 2026
One-click install
npx skills add https://github.com/jacob-balslev/skill-graph --skill state-management-jacob-balslev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: state-management
Source: https://github.com/jacob-balslev/skill-graph/tree/main/marketplace/skills/state-management
Command: npx skills add https://github.com/jacob-balslev/skill-graph --skill state-management-jacob-balslev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you make consistent, correct decisions about where each piece of frontend state should live—component-local, lifted/shared, URL state, or persistent storage—so your app avoids stale UI, broken back-button behavior, prop-drilling, and unintended duplicated sources of truth.

Core Features & Use Cases

  • Classify state by kind: server state vs client UI state vs URL state vs persistent state, with appropriate lifetimes and invalidation rules.
  • Apply ownership defaults: start local, lift only when needed, use Context only for real tree-scoped sharing, and use a store only when many consumers need fine-grained updates.
  • Use URL as the shareable state container when a view should be reproducible via link and navigation history.
  • Prevent architectural anti-patterns like premature globalization, server data in general-purpose stores, stored derived state without need, duplicated state, and misuse of optimistic updates.

Quick Start

Use the state-management skill to determine whether a specific piece of UI data should be local component state, lifted state, Context, URL state, or persistent storage—then identify the most appropriate ownership and invalidation approach.

Frequently Asked Questions about state-management

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

FAQPage Schema
Where should frontend state live when deciding between component local state, context, or a global store?

Frontend state location depends on classifying the data as server, client UI, URL, or persistent state, then applying ownership defaults: start local, lift only when needed, use Context for tree-scoped sharing, and use a store for fine-grained updates across many consumers.

How do I decide if filter, sort, or page state should go in the URL?

Filter, sort, and page state belongs in the URL when the view should be reproducible via a shareable link and navigation history, treating the URL as a state container to enforce deep-linking and proper back-button behavior.

Why does putting server state in a general-purpose store cause stale UI issues?

Server state in a general-purpose store causes stale UI because it bypasses proper cache doctrine and invalidation rules, leading to duplicated sources of truth and incorrect optimistic updates instead of treating server data as a cache.

What is the best way to stop prop-drilling without prematurely globalizing frontend state?

To stop prop-drilling without premature globalization, lift state only when needed and use Context exclusively for real tree-scoped sharing, ensuring a single source of truth without misusing global stores for local UI data.

When should I avoid storing derived state in my frontend architecture?

You should avoid storing derived state when it can be calculated on the fly, as storing it creates a duplicated source of truth that risks becoming stale and requires unnecessary synchronization with the original data.

Does this state-management approach work for separating server-cached data from client UI state?

Yes, this approach works by classifying state by kind with appropriate lifetimes and invalidation rules, explicitly separating server-cached data governed by cache doctrine from general-purpose client UI stores to prevent architectural anti-patterns.