agentleFS
ai-enhanced-engineerai-enhanced-engineer/aiee-skills/skills/mobile-offline-sync/SKILL.md

mobile-offline-sync

Skill4 starsChanged 5 months agoMITView on GitHub

Offline-first patterns for React Native including local databases (WatermelonDB, expo-sqlite, MMKV), background sync, conflict resolution, and large file offline queues. Use for field-capture apps with unreliable connectivity.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    RealmJS sync features deprecated September 2025: Avoid for new projects; existing apps should plan migration.

    line 23
  2. Very specific:

    Optimistic UI: Write locally first, update UI immediately, queue sync operation with pendingSync flag

    line 27

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Mobile Offline Sync

Offline-first architecture patterns for React Native field-capture applications (construction, inspection, agriculture) where connectivity is unreliable and large files must be captured locally then synced later.

Database Decision Matrix

LibraryUse CasePerformanceSync
WatermelonDB 0.27Complex relational data, 10k+ records, reactive queriesExcellent (lazy load, native thread)Built-in protocol
expo-sqlite SDK 53Expo managed workflow, simpler relational needsGood (sync API available)Manual or PowerSync
op-sqlite 15.xPerformance-critical, advanced SQLite features (FTS5, sqlite-vec)Best raw speed (5x less memory)PowerSync
MMKV v4Preferences, session tokens, feature flags, small cached data30x faster than AsyncStorageN/A (key-value only)

RealmJS sync features deprecated September 2025. Avoid for new projects; existing apps should plan migration.

Sync Strategy Quick Reference

  • Optimistic UI: Write locally first, update UI immediately, queue sync operation with pendingSync flag
  • Queue-based: Operation log with retry counts and exponential backoff; replay on reconnect via NetInfo listener
  • CRDTs (Yjs, Automerge): Reserve for collaborative editing scenarios; most field apps use last-write-wins safely since records have single-user ownership

Large File Offline Queue

For video capture: compress to 20-50 MB with react-native-compressor, persist upload queue and chunk progress to MMKV, use tus protocol or 500 KB chunked uploads for resumable transfers across app restarts.

Cross-References

  • reference.md: Database install commands, conflict resolution strategies, background sync setup, security patterns, anti-patterns table
  • examples.md: Production TypeScript for WatermelonDB models, MMKV+Zustand stores, sync managers, video capture flows, migration patterns

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.