What problem does it solve?
State synchronization bugs in session-driven UIs are subtle and destructive: fetch failures masquerade as empty data, stale snapshots wipe newer mutations, and cache eviction loops cause endless request churn. This Skill provides a rigorous set of invariants and verification rules so changes to sync, bootstrap, reconnect, and optimistic-update logic do not corrupt or lose state.
Core Features & Use Cases
- Source-of-truth classification: Distinguishes live directory stores, global session caches, persisted history, and optimistic shadow state, assigning each state a single owner with explicit lifecycle.
- Failure-vs-empty discipline: Requires loaders to distinguish fetch failure from successful empty results, preventing destructive replacement of prior state after errors.
- Reducer, polling, and optimistic-update rules: Covers event reducer transitions, bootstrap/reconnect retry semantics, mutation revision capture, and shadow-state reconciliation.
- Cache lifecycle safety: Prevents evict/recreate render loops by requiring protection guarantees before eviction and deferred, coalesced eviction scans.
- Use Case: When modifying a session store that merges polling snapshots with in-flight user mutations, apply the mutation-revision protocol so responses started before a delete cannot resurrect the deleted session.
Quick Start
Ask the AI to review your changes to session synchronization or optimistic update logic against the sync-state-invariants rules before committing.