Offline first

From rnavarych/alpha-engineer · View interactive version

Offline first is an AI agent skill from the GitHub repository rnavarych/alpha-engineer. Expert guidance on offline-first mobile architecture — local database sync (WatermelonDB, Realm, Hive, SQLite), conflict resolution strategies (last-write-wins, CRDT), optimistic UI patterns, background sync (WorkManager, BGTaskScheduler), and connectivity detection. Use when designing apps that mus

How to use this skill

Skill file

Offline-First Architecture

When to use

Core principles

  1. Network is optional — the app is fully usable offline; sync is background enrichment
  2. Local-first reads — always read from local DB; never block UI on a network call
  3. Optimistic writes — apply locally first, queue for server, reconcile on response
  4. Conflict rules before code — LWW is simple; CRDT is correct; decide before building, not after
  5. Partial sync is the norm — background tasks get killed; design every sync step to resume cleanly

Reference Files

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.