state-consistency-audit

Detects divergences between database, cache, server, client, and URL state layers.

Updated Aug 29, 2026
One-click install
npx skills add https://github.com/1arley/volibear --skill state-consistency-audit-1arley
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: state-consistency-audit
Source: https://github.com/1arley/volibear/tree/main/.opencode/skills/state-consistency-audit
Command: npx skills add https://github.com/1arley/volibear --skill state-consistency-audit-1arley

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Systems keep multiple copies of the same fact across database, cache, server memory, client state, and URL, and bugs arise when these layers disagree. This Skill guides an agent to systematically find where layers diverge and where the system acts on stale or wrong state. ## Core Features & Use Cases - Layer Inventory and Truth Mapping: Enumerate which state layers exist in a flow, label the source of truth for each fact, and trace write and read paths across copies. - Concrete Desync Testing: Test stale cache reads, read-replica lag, un-reverted optimistic UI, URL state that the server no longer recognizes, and multi-client divergence. - Evidence-Graded Findings: Report each divergence with confidence levels (CONFIRMED, HIGH CONFIDENCE, POSSIBLE, SPECULATIVE) and remediation strategies such as write-through caching, synchronous invalidation, read-your-writes, and optimistic rollback. - Use Case: After users report that a balance shows 100 in the UI but 50 in the database, use this Skill to trace the missing cache invalidation and produce a reproducible finding. ## Quick Start Audit this checkout flow for state consistency issues across the database, Redis cache, and client state, and report any divergences with reproduction steps.

Frequently Asked Questions about state-consistency-audit

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

FAQPage Schema
How do I find stale cache bugs in my application?▼

Trace the write path for each fact and check whether every cache copy is invalidated when the database changes, and whether invalidation happens before reads are served. Then test concretely: mutate the database and immediately read from cache to observe the stale value.

How to test for read replica lag issues?▼

Write to the primary database and immediately read from the replica; if the replica returns the old value, replication has not converged. Check whether post-write reads are routed to the primary or whether the system provides a read-your-writes guarantee.

What is optimistic UI and when does it cause bugs?▼

Optimistic UI updates the interface before the server confirms success. It causes bugs when the server fails and the UI is not reverted, leaving client state inconsistent with server state; verify a rollback exists in the error handler before reporting.

When is stale cached data not a bug?▼

Stale data is acceptable when the system is designed for eventual consistency, such as approximate like counts or documented asynchronous invalidation windows. Report it only when the staleness window is undefined or the system acts on the wrong state.

Can URL state cause consistency problems?▼

Yes, when the URL encodes state the server no longer recognizes, such as a deep link to a deleted or revoked resource. Check whether URL-driven state is validated against the server on load; pure view-state URLs like open tabs are not affected.