capacitor-offline-first

capacitor-offline-first is a skill for Claude Code from Cap-go/capgo-skills. It costs 184 tokens per session (1,988 once invoked), scanned A, original, MIT.

A guide to making Capacitor apps work without an internet connection and synchronize data when the connection returns. It covers local storage, network detection, and handling conflicting changes.

In plain words
What is it for?
Use it to plan offline data storage, caching, background synchronization, and conflict handling in a Capacitor app.
Why use it?
It helps avoid apps failing when users lose connectivity and reduces uncertainty about which data to keep when changes happen in multiple places.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the capacitor-features plugin — 6 skills shipped together

Good fit Use it to plan offline data storage, caching, background synchronization, and conflict handling in a Capacitor app.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cap-go/capgo-skills/capacitor-offline-first
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Cap-go/capgo-skills --skill capacitor-offline-first
Clone the repo
git clone --depth 1 https://github.com/Cap-go/capgo-skills

Made for: Claude Code.

Or install capacitor-features, the plugin that ships this one along with the rest of its 6 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for capacitor-offline-first

README.md
[![agentmods](https://agentmods.dev/badge/skills/cap-go/capgo-skills/capacitor-offline-first/github.svg)](https://agentmods.dev/skills/cap-go/capgo-skills/capacitor-offline-first)
Your own site
<a href="https://agentmods.dev/skills/cap-go/capgo-skills/capacitor-offline-first"><img src="https://agentmods.dev/badge/skills/cap-go/capgo-skills/capacitor-offline-first/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for capacitor-offline-first

Your own site · 80×15
<a href="https://agentmods.dev/skills/cap-go/capgo-skills/capacitor-offline-first"><img src="https://agentmods.dev/badge/skills/cap-go/capgo-skills/capacitor-offline-first.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 184 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,988 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 11 Oct 2026
  • Snyk pass 11 Oct 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00184 $0.01988
Opus 5.5 $0.00074 $0.00795
Sonnet 5.5 $0.00037 $0.00398
Haiku 4.5 $0.00018 $0.00199

Measured 1mo ago against content hash 08e62c593e61, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

capacitor-offline-first scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/capacitor-features/skills/capacitor-offline-first/SKILL.md · 124 lines

How it starts

The opening of the file, as written. The whole thing — 124 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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)

Question Default answer
Where does UI read from? Local DB only. Network writes into the DB; UI observes the DB.
Storage for records SQLite via @capgo/capacitor-fast-sql
Storage for small settings / tokens @capacitor/preferences (not for secrets; see capacitor-security)
localStorage / IndexedDB Transient only: iOS can evict WebView storage under pressure
App shell offline Already offline: Capacitor bundles web assets in the binary (or Capgo live-update bundle). No service worker needed.
Service worker in native builds Avoid. Android SW blocks Capacitor plugin injection; iOS SW needs WKAppBoundDomains, which also blocks injection unless ios.limitsNavigationsToAppBoundDomains is set. Keep SW for the PWA build only.
IDs Client-generated UUIDs (crypto.randomUUID()), so offline creates need no server round trip
Conflict policy Ask the user/product owner: last-write-wins per record, per-field merge, or server-authoritative with user review
Deletes Soft delete (tombstone) until the server acknowledges

Workflow

  1. Inspect: current storage (localStorage, @capacitor/preferences, other SQLite plugins), API shape (does it support updated_since / version fields / idempotency keys?), auth refresh flow, existing service worker registration.
  2. Report the plan (schema, outbox, conflict policy) to the user before invasive changes. For large apps, list each entity as a TODO.
  3. Install: npm install @capgo/capacitor-fast-sql @capacitor/network && npx cap sync, then the platform setup in references/fast-sql-setup.md (required: iOS ATS local networking, Android localhost cleartext).
  4. Schema + outbox: references/sync-engine.md.
  5. Triggers for sync: app start, networkStatusChange -> connected, App resume, after each local write (debounced), optional background task.
  6. UI: show pending count / last synced time; never block a write on the network.
  7. Verify (below).

Read the full file on GitHub · 124 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · -440 lines · +135 tokens per session 08e62c593e61
  2. 3mo ago First seen · 564 lines · 49 tokens per session scan A 75d769d193a8

Subscribe to this mod's changes

capacitor-offline-first is a skill published in the GitHub repository Cap-go/capgo-skills (79 stars, last pushed 19d ago), licensed MIT. It adds 184 tokens to every session and 1,988 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

capacitor-offline-first compared with skills from other repositories

capacitor-offline-first next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
capacitor-offline-firstCap-go/capgo-skillsSkill7919d agoMITA184Claude Code
loom-dartcosmix/loomSkill66yesterdayMITA16Claude Code, Codex
deploy-edge-ai-modelpjt222/agent-almanacSkill46yesterdayMITA108Claude Code
capacitor-pluginscapawesome-team/skillsSkill5612d agoMITA101Claude Code, Codex
ionic-appflow-migrationcapawesome-team/skillsSkill5612d agoMITA196Claude Code, Codex
capacitor-expertcapawesome-team/skillsSkill5612d agoMITA76Claude Code, Codex
capgo-cloud-migrationcapawesome-team/skillsSkill5612d agoMITA160Claude Code, Codex