jyjeanne/ai-setup-forge/offline-first-mobile-architecture

Claude Code and agent skill by jyjeanne/ai-setup-forge

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

To design mobile apps that remain fully functional without an internet connection, syncing data when connectivity is restored. Use when: Field service apps (inspections, delivery); Apps used in areas with poor connectivity; To improve perceived performance (optimistic UI).

Install

npx vskill@latest install jyjeanne/ai-setup-forge/offline-first-mobile-architecture

SKILL.md

The same SKILL.md was published earlier as jyjeanne/ai-setup-forge/offline-first-mobile-architecture.

Purpose

To design mobile apps that remain fully functional without an internet connection, syncing data when connectivity is restored.

When to Use

  • Field service apps (inspections, delivery).
  • Apps used in areas with poor connectivity.
  • To improve perceived performance (optimistic UI).

Procedure

1. Local Database Selection
  • WatermelonDB: High performance, built on SQLite, reactive. Great for complex relational data.
  • Expo SQLite: Low-level access to SQLite.
  • Realm: Object-oriented, fast.
  • TanStack Query (React Query): Good for caching API responses, but not a full DB.
2. Architecture Pattern (Sync Engine)
  1. Read: Always read from Local DB for UI.
  2. Write:
  • Write to Local DB immediately.
  • Mark record as dirty or pending_sync.
  • Trigger background sync.
  1. Sync Process:
  • Push: Send pending local changes to Backend.
  • Pull: Fetch new changes from Backend (using last_synced_at timestamp).
  • Resolve Conflicts: Last-write-wins or user intervention.
3. Network State Management

Use expo-network or @react-native-community/netinfo.

tsx
const netInfo = useNetInfo();
useEffect(() => {
if (netInfo.isConnected) {
syncData();
}
}, [netInfo.isConnected]);
4. Implementation Example (WatermelonDB)

Define Schema -> Define Models -> Write Sync Logic using synchronize() helper provided by WatermelonDB, which handles the "Push/Pull" logic.

Constraints

  • Storage Limits: Mobile devices have limited storage; clean up old data periodically.
  • Conflict Resolution: Hardest part. Keep logic simple (server authority) if possible.
  • Security: Encrypt sensitive local data (e.g., using SQLCipher).

Expected Output

An app that loads content instantly offline and synchronizes data invisibly in the background.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
1
7-day trend score
8

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/jyjeanne/ai-setup-forge/offline-first-mobile-architecture/badge)](https://verified-skill.com/skills/jyjeanne/ai-setup-forge/offline-first-mobile-architecture)

Something wrong with this skill or its page? Tell us.