Skip to content
cap-go avatar

Capacitor Offline First

Offline-first Capacitor data design using local SQLite, an outbox sync queue, and conflict resolution rules.

CCM score
66 of 100
skills.sh installs
1.2K
GitHub stars
79
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers local SQLite as the source of truth via @capgo/capacitor-fast-sql, with outbox sync, delta pulls, and tombstone deletes
  • Includes setup for iOS ATS local networking and Android localhost cleartext, plus networkStatusChange and App resume sync triggers
  • Enforces idempotency keys on every mutation and treats fetch failures as offline, since connected alone does not prove reachability
  • Designed for apps that must read and write without internet and need service workers avoided in native builds

Install

$ npx -y skills add cap-go/capgo-skills --skill capacitor-offline-first -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Offline-First Capacitor Apps

When to Use

TRIGGER when:

  • The app must read and write while offline and sync later
  • Choosing local storage (Preferences vs SQLite vs IndexedDB) for user data
  • Writes are duplicated, lost, or overwritten during sync
  • Cached data vanishes on iOS after low-storage events
  • A service worker was added and native plugins stopped working (Plugin not implemented)

Do not use:

  • Replacing @capacitor-community/sqlite / Ionic secure storage: sqlite-to-fast-sql
  • Getting new web code to devices (OTA): capgo-live-updates
  • Encryption key storage, SSL pinning: capacitor-security
  • Query speed / bridge overhead tuning: capacitor-performance

Decisions (make these before writing code)

Details

Repository
github.com/cap-go/capgo-skills
Categories
Mobile Apps, Databases
First seen
Jun 3, 2026

Questions

What does the capacitor-offline-first skill do?

The capacitor-offline-first skill designs and implements offline-first data in Capacitor apps. It uses a local SQLite source of truth through @capgo/capacitor-fast-sql, an outbox sync queue, delta pulls, and conflict resolution. It also handles network detection with @capacitor/network and background sync.

How do I install the capacitor-offline-first skill?

Run npx -y skills add cap-go/capgo-skills --skill capacitor-offline-first -y in a project. Once installed, the agent can build offline data storage that keeps working without internet and syncs later.

Why does my Capacitor app lose data offline on iOS?

The capacitor-offline-first skill explains that localStorage and IndexedDB can be evicted by iOS under storage pressure. It moves record storage to SQLite via @capgo/capacitor-fast-sql, with small settings kept in @capacitor/preferences.

Why does Plugin not implemented appear after I add a service worker?

The capacitor-offline-first skill notes that a service worker can block Capacitor plugin injection in native WebViews. It recommends removing the service worker from native builds and keeping it only for the PWA build.

What do I need to set up before using capacitor-offline-first?

The skill needs @capgo/capacitor-fast-sql and @capacitor/network installed, followed by npx cap sync. It also requires iOS ATS local networking and Android localhost cleartext setup.

More from cap-go/capgo-skills

All 41

Similar to Capacitor Offline First

More Mobile Apps