state-management-design

Community

Design reliable frontend state ownership.

Authormachenjie
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Prevents stale, mismatched, and unsafe client state by forcing every UI, form, authentication, and cached server value to have a single authoritative source, explicit lifecycle, and clear invalidation and reset rules.

Core Features & Use Cases

  • State classification and ownership rules: Classifies server state, UI state, form state, authentication state, and persisted preferences, then assigns the correct storage and lifecycle without defaulting to a global store.
  • Server-state freshness and cache policy: Defines staleTime, gcTime/cacheTime, invalidation triggers, and stale-data behavior for TanStack Query, SWR, or Apollo-like caching.
  • Secure auth and permission synchronization: Ensures auth state is sourced from trusted server validation, revalidated on defined events, and completely cleared on logout (including user-specific caches and client storage).
  • Optimistic updates with deterministic rollback: Requires optimistic state application plus rollback-on-failure semantics so rejected server writes never leave the UI permanently inconsistent.
  • Privacy-aware persistence decisions: Documents when and how persisted client preferences may be stored, including expiry and clear-on-logout handling for user-identifying or sensitive items.

Quick Start

Ask for a state-management ownership plan that classifies your current frontend state into server, UI, form, auth, and persisted preference categories and outputs exact invalidation, rollback, and logout-clearing rules.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: state-management-design
Download link: https://github.com/machenjie/rd-skills/archive/main.zip#state-management-design

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.