Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
erichowens avatar

Pwa Expert

  • 361 installs
  • 178 repo stars
  • Updated July 14, 2026
  • erichowens/some_claude_skills

pwa-expert is an agent skill that helps developers implement production-grade Progressive Web Apps with service workers, offline caching, install prompts, push notifications, and update flows for web apps that must feel

About

pwa-expert is an Erich Owens Claude skill for building installable, offline-capable web applications with Service Workers and web app manifests. It documents four installability requirements (HTTPS, manifest fields, service worker fetch handler, 192×192 and 512×512 icons), five caching strategies (cache-first, network-first, stale-while-revalidate, network-only, cache-only), and TypeScript patterns for registration, `beforeinstallprompt`, background sync, and update detection. The skill ships six reference guides covering service-worker patterns, install prompts, offline handling, background sync, update flow, and Next.js integration. Use it when adding manifest.json, sw.js, Workbox, or next-pwa to a React or Next.js app that must install on mobile and survive offline.

  • Service worker caching strategies
  • Web app manifest and install UX
  • Offline and background sync patterns
  • Push notification setup guidance
  • Lighthouse-oriented performance budgets

Pwa Expert by the numbers

  • 361 all-time installs (skills.sh)
  • Ranked #690 of 2,245 Frontend Development skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/erichowens/some_claude_skills --skill pwa-expert

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs361
repo stars178
Last updatedJuly 14, 2026
Repositoryerichowens/some_claude_skills

How do you add offline caching to a web app?

Implement production-grade PWAs with service workers, offline caching, install prompts, push notifications, and performance budgets for web apps that must feel native on mobile.

Who is it for?

Frontend developers shipping React or Next.js apps that need installable PWAs with service workers, Workbox patterns, and mobile-native behavior.

Skip if: React Native or Flutter native apps, server-only performance tuning without client service workers, or static sites where PWA overhead exceeds benefit.

When should I use this skill?

The user mentions PWA, service worker, manifest.json, Workbox, offline mode, beforeinstallprompt, or background sync for a web application.

What you get

Web app manifest, registered service worker, caching strategy, install prompt handler, offline page, and update notification flow.

  • manifest.json
  • service worker
  • install prompt UI

By the numbers

  • Documents 5 service worker caching strategies
  • Bundles 6 reference markdown guides for PWA subtopics

Files

SKILL.mdMarkdownGitHub ↗

Progressive Web App Expert

Build installable, offline-capable web apps with Service Workers, smart caching, and native-like experiences.

When to Use This Skill

  • Making a web app installable on mobile/desktop
  • Implementing offline functionality
  • Setting up Service Worker caching strategies
  • Handling install prompts (beforeinstallprompt)
  • Background sync for offline-first apps
  • Managing PWA update flows
  • Creating web app manifests

When NOT to Use This Skill

  • Native app development → Use React Native, Flutter, or native SDKs
  • General web performance → Use Lighthouse/performance auditing tools
  • Server-side rendering issues → Use Next.js/framework-specific docs
  • Push notifications only → Consider dedicated push notification services
  • Simple static sites → PWA overhead may not be worth it

Core Concepts

What Makes a PWA Installable

1. HTTPS (or localhost for dev) 2. Web App Manifest with required fields 3. Service Worker with fetch handler 4. Icons (192×192 and 512×512 minimum)

The PWA Stack

┌─────────────────────────────────────────┐
│           Your App (React/Next.js)      │
├─────────────────────────────────────────┤
│         Service Worker (sw.js)          │
│  ┌─────────────┐  ┌─────────────────┐   │
│  │   Cache     │  │  Network Fetch  │   │
│  │   Storage   │  │    Handling     │   │
│  └─────────────┘  └─────────────────┘   │
├─────────────────────────────────────────┤
│          manifest.json                  │
│  (App identity, icons, display mode)    │
└─────────────────────────────────────────┘

Web App Manifest

Complete manifest.json

{
  "name": "Junkie Buds 4 Life",
  "short_name": "JB4L",
  "description": "Recovery support app",
  "start_url": "/",
  "scope": "/",
  "display": "standalone",
  "orientation": "portrait-primary",
  "background_color": "#1a1410",
  "theme_color": "#1a1410",
  "icons": [
    {
      "src": "/icons/icon-192.png",
      "sizes": "192x192",
      "type": "image/png",
      "purpose": "any"
    },
    {
      "src": "/icons/icon-512.png",
      "sizes": "512x512",
      "type": "image/png",
      "purpose": "any"
    },
    {
      "src": "/icons/icon-maskable-512.png",
      "sizes": "512x512",
      "type": "image/png",
      "purpose": "maskable"
    }
  ],
  "shortcuts": [
    {
      "name": "Find Meetings",
      "short_name": "Meetings",
      "url": "/meetings?source=shortcut",
      "icons": [{ "src": "/icons/meetings-96.png", "sizes": "96x96" }]
    }
  ]
}

Display Modes

ModeDescription
fullscreenNo browser UI, full screen
standaloneApp-like, no URL bar (recommended)
minimal-uiSome browser controls
browserNormal browser tab

Link in HTML

<head>
  <link rel="manifest" href="/manifest.json" />
  <meta name="theme-color" content="#1a1410" />
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
  <link rel="apple-touch-icon" href="/icons/apple-touch-icon.png" />
</head>

Service Worker Basics

Registration

// lib/pwa.ts
export async function registerServiceWorker() {
  if ('serviceWorker' in navigator) {
    try {
      const registration = await navigator.serviceWorker.register('/sw.js', {
        scope: '/',
      });
      return registration;
    } catch (error) {
      console.error('SW registration failed:', error);
    }
  }
}

// Call on app mount
useEffect(() => {
  registerServiceWorker();
}, []);

Basic Service Worker Structure

// public/sw.js
const CACHE_NAME = 'myapp-v1';
const STATIC_ASSETS = ['/', '/offline', '/manifest.json'];

// Install: Cache static assets
self.addEventListener('install', (event) => {
  event.waitUntil(
    caches.open(CACHE_NAME).then((cache) => cache.addAll(STATIC_ASSETS))
  );
  self.skipWaiting();
});

// Activate: Clean old 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();
});

// Fetch: Handle requests (see references for strategies)
self.addEventListener('fetch', (event) => {
  event.respondWith(handleFetch(event.request));
});
See: references/service-worker-patterns.md for caching strategy implementations

Caching Strategies

StrategyBest ForTradeoff
Cache-FirstStatic assets, fonts, imagesStale until cache updated
Network-FirstAPI data, user contentSlower, needs connectivity
Stale-While-RevalidateBalance freshness/speedBackground updates
Network-OnlyAuth, real-time dataNo offline support
Cache-OnlyVersioned assetsNever updates
See: references/service-worker-patterns.md for full implementations

Install Prompts

Handle the beforeinstallprompt event to show a custom install UI:

// Basic pattern
const [deferredPrompt, setDeferredPrompt] = useState(null);

useEffect(() => {
  window.addEventListener('beforeinstallprompt', (e) => {
    e.preventDefault();
    setDeferredPrompt(e);
  });
}, []);

const handleInstall = async () => {
  if (deferredPrompt) {
    deferredPrompt.prompt();
    const { outcome } = await deferredPrompt.userChoice;
    // outcome: 'accepted' or 'dismissed'
  }
};
See: references/install-prompt.md for full usePWAInstall hook and component

Offline Experience

Key patterns:

  • Offline page fallback for navigation failures
  • useOnlineStatus hook to detect connectivity
  • Offline banner to inform users
See: references/offline-handling.md for implementations

Background Sync

Queue actions while offline, execute when connectivity returns:

// In Service Worker
self.addEventListener('sync', (event) => {
  if (event.tag === 'sync-data') {
    event.waitUntil(syncPendingData());
  }
});

// In App - trigger sync
const registration = await navigator.serviceWorker.ready;
await registration.sync.register('sync-data');
See: references/background-sync.md for full IndexedDB integration

Update Flow

Notify users when a new version is available:

// Basic pattern
registration.addEventListener('updatefound', () => {
  const newWorker = registration.installing;
  newWorker?.addEventListener('statechange', () => {
    if (newWorker.state === 'installed' && navigator.serviceWorker.controller) {
      // New version available - show update prompt
    }
  });
});
See: references/update-flow.md for usePWAUpdate hook and update strategies

Next.js Integration

Options for Next.js PWA:

1. next-pwa - Works with standard Next.js server 2. Custom SW - Required for output: 'export' (static sites) 3. Workbox CLI - Generate SW after build

See: references/nextjs-integration.md for detailed configurations

Quick Reference

TaskSolution
Check if installedwindow.matchMedia('(display-mode: standalone)').matches
Force SW updateregistration.update()
Clear all cachescaches.keys().then(keys => keys.forEach(k => caches.delete(k)))
Check onlinenavigator.onLine
Get SW registrationnavigator.serviceWorker.ready
Skip waitingself.skipWaiting() in SW
Take controlself.clients.claim() in SW

Testing PWA

Chrome DevTools

1. Application tab → Manifest, Service Workers, Cache Storage 2. Lighthouse → PWA audit 3. Network → Offline checkbox to simulate

Debug Checklist

  • [ ] Manifest loads (Application → Manifest)
  • [ ] SW registered (Application → Service Workers)
  • [ ] Cache populated (Application → Cache Storage)
  • [ ] Install prompt fires (Console for beforeinstallprompt)
  • [ ] Offline page works (Network → Offline)
  • [ ] Update flow works (trigger update, verify prompt)

References

Detailed implementations in /references/:

  • service-worker-patterns.md - Caching strategy implementations
  • install-prompt.md - usePWAInstall hook and install component
  • offline-handling.md - Offline page, status hooks, banners
  • background-sync.md - Background sync with IndexedDB
  • update-flow.md - Update detection and user prompts
  • nextjs-integration.md - Next.js PWA configuration options

Related skills

How it compares

Use pwa-expert for full PWA architecture; use Lighthouse or performance-only skills when you only need audits without implementing service workers.

FAQ

What makes a web app installable according to pwa-expert?

pwa-expert lists four requirements: HTTPS (or localhost in development), a web app manifest with required fields, a service worker with a fetch handler, and icons at minimum 192×192 and 512×512 pixels including maskable variants when needed.

Does pwa-expert cover Next.js PWA setup?

Yes. pwa-expert documents Next.js integration options including next-pwa for standard servers, custom service workers for static `output: export` builds, and Workbox CLI generation, with details in its nextjs-integration reference guide.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.