Skip to content
Skills Library
Programming · Analysis

offline-sync-integrity

/offline-sync-integrity

Build or debug offline mutation queues, retry-safe batch synchronization and date grouping in local-first web apps. Use when reconnects lose entries, duplicate effects or shift calendar totals.

Licence
MIT
Last repository change
09.11.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
3
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 09.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Build or debug offline mutation queues, retry-safe batch synchronization and date grouping in local-first web apps. Use when reconnects lose entries, duplicate effects or shift calendar totals.

Original author description

Build or debug offline mutation queues, retry-safe batch synchronization and date grouping in local-first web apps. Use when reconnects lose entries, duplicate effects or shift calendar totals.

How it works

  1. Mutation contract
  2. Server contract
  3. Cache and calendar boundaries
  4. Verify the failure path
Original SKILL.md headings · 50 lines, 346 words
SKILL.md preview
---
name: offline-sync-integrity
description: Build or debug offline mutation queues, retry-safe batch synchronization and date grouping in local-first web apps. Use when reconnects lose entries, duplicate effects or shift calendar totals.
---

# Offline sync integrity

Trace one mutation from input through durable storage, server commit,
acknowledgment and UI reconciliation. Preserve the existing data model and
business meaning; a cash balance, monthly net flow and savings target are
different quantities.

## Mutation contract

- Assign one stable operation ID before first transmission. Persist the pending
  operation before presenting it as durably saved. Reuse that ID on retries.
- Represent pending, syncing, acknowledged and rejected states explicitly.
  Retain an entry after a timeout: the server may already have committed it.
- Derive optimistic totals from confirmed state plus outstanding operations so
  a refresh or acknowledgment cannot apply the same delta twice.
- Serialize overlapping flushes, acknowledge exact IDs and preserve mutations
  added while a batch is in flight. Use bounded retry/backoff and a manual retry
  control. Connectivity events are hints, not proof the endpoint is reachable.

## Server contract

Apply deduplication and all business effects in one database transaction. Scope
operation identity to the authenticated owner where the application has users.
Reject conflicting payloads that reuse an ID with different meaning.

`ON CONFLICT DO NOTHING` alone is insufficient: update a materialized balance
only for rows actually inserted. Read
[references/replay-and-calendar.md](references/replay-and-calendar.md) for the
concrete replay invariant and timezone cases before changing this path.

## Cache and calendar boundaries

Cache eligible static GET resources with a deliberate update strategy. Keep
mutation responses and private user data outside shared static caches. Clone a
response before either consumer reads its body; keep cache writes alive with
the service worker event lifecycle and handle cache-write failures.

Store instants separately from business calendar dates. Generate grouping keys
in the configured IANA timezone on both sides. Choose that timezone from the
application's requirements rather than the development machine's location.

## Verify the failure path

Exercise offline entry plus reload, commit followed by lost response and replay,
mixed new/duplicate batches, concurrent retries, and reconnect with new entries
arriving during a flush. Verify persisted rows, authoritative balance and UI
totals agree. Test actual day/month boundaries. A passing build does not prove
these invariants; disclose unavailable database or browser verification.
Files in this package (3)
  • SKILL.md 3 KB
  • agents/openai.yaml 1 KB
  • references/replay-and-calendar.md 2 KB

Versions

The database has no other skills named offline-sync-integrity.

Database snapshot: 13.11.2026 · package version 8cc65cb25df6 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90mobile-offline-first
    Use this skill when the user says 'offline-first', 'offline mode', 'offline sync', 'local storage', 'offline cache', 'sync strategy', 'conflict resolution', 'offline queue', 'mobile offline', 'local database'. Design offline-capable mobile apps with local storage, sync…
  • 100assign-offline-profile
    Use when the user needs to bind users or teams to a Mobile Offline Profile so they actually receive offline sync on their devices. Without this, the profile exists in Dataverse but no one's app uses it.
  • 90offline-first-data
    Design or review local data storage, synchronization, and conflict handling for an application that must work with intermittent or absent connectivity. Use for offline forms, caching, queued mutations, or map/data downloads.
  • 100offline-sync
    Implement offline-capable applications with local persistence, queued changes and explicit synchronization conflicts. Use when users must work without a stable connection or resume drafts across interruptions; define data ownership and conflict semantics before retrying writes.
  • 100react-native-architecture
    Build production React Native apps with Expo, navigation, native modules, offline sync, and cross-platform patterns. Use when developing mobile apps, implementing native integrations, or architecting React Native projects.
  • 100electric-sql
    Build local-first applications with ElectricSQL — sync Postgres data to client devices in real-time. Use when someone asks to "sync database to client", "local-first app", "ElectricSQL", "offline-first sync", "real-time Postgres sync", "sync Postgres to SQLite", or "build an app…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.