pwa-offline-first-expert

pwa-offline-first-expert is a skill for Cursor from roedyrustam/vibes-plug. It costs 40 tokens per session (4,661 once invoked), scanned A, original, MIT.

A guide to building web apps that read and write local data first and synchronize later. It covers progressive web apps, which are websites that can behave more like installed apps, plus offline storage and conflict handling between devices.

In plain words
What is it for?
Use it for offline field tools, mobile dashboards, transit apps, multi-device synchronization, and installable web applications.
Why use it?
It helps apps remain usable without a network and reconcile changes made on multiple devices. It also addresses packaging a web app for app-store distribution.

Skill for Cursor

Written for Cursor: shipped in a Cursor plugin. Also seen: mentions subagents.

Part of the vibes-plug plugin — 179 skills, 9 agents, 2 MCP servers shipped together

Good fit Use it for offline field tools, mobile dashboards, transit apps, multi-device synchronization, and installable web applications.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/roedyrustam/vibes-plug/pwa-offline-first-expert
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 roedyrustam/vibes-plug --skill pwa-offline-first-expert
Clone the repo
git clone --depth 1 https://github.com/roedyrustam/vibes-plug

Made for: Cursor.

Or install vibes-plug, the plugin that ships this one along with the rest of its 179 skills, 9 agents, 2 MCP servers.

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 pwa-offline-first-expert

README.md
[![agentmods](https://agentmods.dev/badge/skills/roedyrustam/vibes-plug/pwa-offline-first-expert/github.svg)](https://agentmods.dev/skills/roedyrustam/vibes-plug/pwa-offline-first-expert)
Your own site
<a href="https://agentmods.dev/skills/roedyrustam/vibes-plug/pwa-offline-first-expert"><img src="https://agentmods.dev/badge/skills/roedyrustam/vibes-plug/pwa-offline-first-expert/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 pwa-offline-first-expert

Your own site · 80×15
<a href="https://agentmods.dev/skills/roedyrustam/vibes-plug/pwa-offline-first-expert"><img src="https://agentmods.dev/badge/skills/roedyrustam/vibes-plug/pwa-offline-first-expert.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,661 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.00040 $0.04661
Opus 5.5 $0.00016 $0.01864
Sonnet 5.5 $0.00008 $0.00932
Haiku 4.5 $0.00004 $0.00466

Measured 10d ago against content hash 6576e60e35ca, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pwa-offline-first-expert scanned grade A with 1 finding 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 10d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

const fetchPromise = fetch(request)
.cursor/skills/pwa-offline-first-expert/SKILL.md · 431 lines

How it starts

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

PWA & Offline-First Expert (2026 Edition)

English | Bahasa Indonesia


English

Description

Expert guide for building enterprise-grade Local-First and Progressive Web Applications (PWA). Eliminates loading spinners by reading and writing to local databases (OPFS SQLite, RxDB, IndexedDB) first, replicating seamlessly in the background with zero conflict (CRDTs, ElectricSQL, PowerSync), and packaging to native stores via PWABuilder.

Trigger Conditions

  • Applications requiring full offline functionality (field operations, mobile dashboards, transit apps).
  • User experience demands 0ms local read/write latency without loading spinners.
  • Multi-device sync architecture with automatic conflict resolution.
  • Packaging web apps for distribution on Google Play Store, iOS Safari PWA, or Microsoft Store.

1. The Local-First Principles (2026 Standard)

  1. No Spinners for Local Data: UI reads and writes to local storage (OPFS / IndexedDB) synchronously. Latency is always 0ms.
  2. Multi-Device Conflict-Free Replication: Changes replicate in the background using CRDTs or central event logs (ElectricSQL / PowerSync).
  3. Network is an Enhancement: App is 100% functional on an airplane or subway without internet.
  4. User Owns Their Data: Data persists on client hardware first; cloud server is a backup/sync relay.

2. Production Recipe: Service Worker Caching (Workbox v7 / Native SW)

// sw.ts - Production Service Worker with Stale-While-Revalidate
/// <reference lib="webworker" />
declare const self: ServiceWorkerGlobalScope;

const CACHE_NAME = 'app-v2.11.0-cache';
const STATIC_ASSETS = [
  '/',
  '/index.html',
  '/manifest.json',
  '/styles/global.css',
  '/icons/icon-512x512.png',
];

// 1. Install & Pre-cache critical application shell
self.addEventListener('install', (event) => {
  event.waitUntil(
    caches.open(CACHE_NAME).then((cache) => cache.addAll(STATIC_ASSETS))
  );
  self.skipWaiting();
});

// 2. Activate & Clean stale caches
self.addEventListener('activate', (event) => {
  event.waitUntil(
    caches.keys().then((keys) =>
      Promise.all(
        keys.filter((k) => k !== CACHE_NAME).map((k) => caches.delete(k))
      )
    )
  );
  self.clients.claim();
});

// 3. Stale-While-Revalidate Strategy for Navigation & API GETs
self.addEventListener('fetch', (event) => {
  const { request } = event;

  // Ignore POST/PUT/DELETE mutations (handled by offline sync queues)
  if (request.method !== 'GET') return;

  event.respondWith(
    caches.open(CACHE_NAME).then(async (cache) => {
      const cachedResponse = await cache.match(request);
      
      const fetchPromise = fetch(request)
        .then((networkResponse) => {
          if (networkResponse.status === 200) {
            cache.put(request, networkResponse.clone());
          }
          return networkResponse;
        })
        .catch(() => cachedResponse || Response.error());

      return cachedResponse || fetchPromise;
    })
  );
});

// 4. Background Sync for offline mutations
self.addEventListener('sync', (event: any) => {
  if (event.tag === 'sync-mutations') {
    event.waitUntil(flushOfflineMutationQueue());
  }
});

interface QueuedOfflineMutation {
  readonly idempotencyKey: string;
  readonly endpoint: string;
  readonly method: 'POST' | 'PUT' | 'PATCH' | 'DELETE';
  readonly bodyJson: string;
}

async function flushOfflineMutationQueue(): Promise<void> {
  const cache = await caches.open('offline-mutation-outbox-v1');
  const requests = await cache.keys();

  for (const req of requests) {
    const stored = await cache.match(req);
    if (!stored) continue;
    const item = (await stored.json()) as QueuedOfflineMutation;

    const response = await fetch(item.endpoint, {
      method: item.method,
      headers: {
        'Content-Type': 'application/json',
        'Idempotency-Key': item.idempotencyKey,
      },
      body: item.bodyJson,
    });

    if (response.ok || (response.status >= 400 && response.status < 500 && response.status !== 429)) {
      await cache.delete(req);
    }
  }
}

Read the full file on GitHub · 431 lines

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. 10d ago Changed · +10 lines 6576e60e35ca
  2. 15d ago Changed · +81 lines cf820e73eac5
  3. 24d ago Changed · +24 lines · -26 tokens per session 3c45acadd01e
  4. 1mo ago Changed · +10 lines 98235a4f933f
  5. 1mo ago Changed · +1 lines aa94e8199245
  6. 1mo ago Changed · +78 lines 1f79e4d4610b
  7. 1mo ago Changed 2dc10a43a3b9
  8. 1mo ago Changed ce21e7921167
  9. 1mo ago Changed cae264a46ea2
  10. 2mo ago First seen · 227 lines · 66 tokens per session scan A 73ecf91a73b2

Subscribe to this mod's changes

pwa-offline-first-expert is a skill published in the GitHub repository roedyrustam/vibes-plug (129 stars, last pushed 3d ago), licensed MIT. It adds 40 tokens to every session and 4,661 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-12.

Related

pwa-offline-first-expert compared with skills from other repositories

pwa-offline-first-expert next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
pwa-offline-first-expertroedyrustam/vibes-plugSkill1293d agoMITA40Cursor
ai-engineering-toolkitsickn33/agentic-awesome-skillsSkill51ktodayMITA47Claude Code
ai-prompt-regression-testingsickn33/agentic-awesome-skillsSkill51ktodayMITA37Claude Code
ios-developmentAnastasiyaW/codex-claude-code-configSkill2183d agoMITA188Claude Code
nativesimota/agent-skillsSkill10612d agoMITA53Claude Code, Codex
voyagersimota/agent-skillsSkill10612d agoMITA42Claude Code, Codex
react-native-experttech-leads-club/agent-skillsSkill7.2k3d agononeA127Claude Code, Codex