local-first-architecture

Installation
SKILL.md

Local-First Architecture — Instant UI & Sync Engines


Mandatory Pre-Flight Context Inspection

Before implementing local-first architecture or offline sync engines, you MUST inspect:

  1. Zero Network Latency Rule → Execute reads and writes against local storage (OPFS / IndexedDB / WASM SQLite) first before queueing outbound sync
  2. Outbound Mutation Queue & Idempotency → Persist mutation logs locally with client-generated UUID idempotencyKey fields to prevent duplicate server writes
  3. Conflict Resolution Strategy → Define explicit conflict handling (Last-Write-Wins with Lamport timestamps or CRDTs via Yjs/Automerge)
  4. OPFS (Origin Private File System) → In modern web browsers, use OPFS for high-speed disk I/O instead of raw legacy IndexedDB for database files

Activation Boundaries

  • Activate when: Building instant-feeling offline-capable web or desktop applications, collaborative editors, sync engines, and optimistic data stores.
  • DO NOT activate when: Building traditional request-response server-rendered apps where clients hold zero persistent state.

2026 Local-First Architecture & Sync Invariants

Installs
1
GitHub Stars
7
First Seen
Sep 13, 2026