data-integrity

Coordinate optimistic UI, IndexedDB v3 persistence, and server reconciliation for chat data.

2|1|Updated Oct 27, 2025
One-click install
npx skills add https://github.com/eco2-team/frontend --skill data-integrity
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: data-integrity
Source: https://github.com/eco2-team/frontend/tree/main/.claude/skills/data-integrity
Command: npx skills add https://github.com/eco2-team/frontend --skill data-integrity

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Data integrity and consistency are hard to maintain when messages are created locally with optimistic updates and then reconciled with a backend store. This skill provides architectural patterns to coordinate frontend persistence, server synchronization, and conflict resolution.

Core Features & Use Cases

  • Optimistic updates with local persistence and eventual consistency guarantees.
  • IndexedDB v3 schema design to map user, session, and messages for offline support.
  • Reconciliation logic to merge local and server data without data loss.

Use cases include chat apps with offline usage, multi-device sync, and paginated history restoration.

Quick Start

Implement optimistic updates, setup IndexedDB v3 schema, and apply reconcile logic to merge local and server data.

Frequently Asked Questions about data-integrity

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

FAQPage Schema
How do I reconcile optimistic UI updates with backend data in a chat app?

To reconcile optimistic UI updates with backend data, you coordinate local persistence and server synchronization using a merge logic that prevents data loss. This ensures that messages created locally are correctly matched and updated with the backend store.

What is the best way to handle offline data persistence for frontend-heavy applications?

Handling offline data persistence requires an IndexedDB schema design that maps users, sessions, and messages locally. This architecture supports offline usage by storing optimistic updates until network connectivity is restored for eventual consistency.

How does eventual consistency work with local IndexedDB storage and server synchronization?

Eventual consistency works by applying a 30-second retention window and a reconciliation logic to merge local and server messages. This coordination between the local IndexedDB store and the backend guarantees alignment without overwriting unsynced data.

Can I use this reconciliation logic for multi-device synchronization in chat apps?

Yes, this reconciliation logic is specifically designed for multi-device synchronization in frontend-heavy chat apps. It merges local and server data across devices, ensuring data integrity and consistency during paginated history restoration and offline usage.

Why do my local optimistic messages disappear when syncing with the backend store?

Local optimistic messages disappear during backend sync when there is no reconciliation logic to merge the two data sets. Implementing a proper data integrity strategy with a local retention window prevents this data loss by safely reconciling the differences.