Command Palette

Search for a command to run...

Назад к скиллам
скилл № 32028

frontend-pwa

Use when the user asks to make the site installable and work offline, PWA, web app manifest, service worker with Workbox or vite-plugin-pwa, update prompts…

БесплатноБез исполняемых скриптов
j4flmaoот j4flmao★ 47 звёзд на GitHub

Установить frontend-pwa в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Progressive Web Apps

Purpose

A PWA is a web app with a manifest (installability, app identity) and a service worker (network proxy enabling offline, caching and push). This skill produces a manifest that installs on all major platforms, a Workbox service worker with per-resource caching strategies, an update flow that never strands users on stale code, and offline/push features with honest support caveats.

Agent Protocol

Trigger

"pwa", "service worker", "offline", "manifest.json", "install prompt", "workbox", "vite-plugin-pwa", "web push", "background sync", "new version available".

Input Context

  • Framework/bundler (Vite, Next.js, Angular — @angular/pwa, SvelteKit).
  • Which routes/data must work offline; is data user-specific?
  • Target platforms (iOS Safari constraints matter) and need for push.

Output Artifact

manifest.webmanifest, service worker (Workbox or plugin config), registration/update UI code.

Response Format

Install: manifest fields + icons {sizes, purpose}
Precache: {app shell files}
Runtime routes: {pattern -> strategy, cache name, expiration}
Offline: {fallback page | IndexedDB queue}
Update flow: {prompt | auto} 
Push: {VAPID, permission trigger, platforms}

Do You Need It?

Need PWA fit
Works on flaky networks, field/retail apps Strong
Installable icon, standalone window without app stores Strong
Re-engagement via notifications Good (iOS/iPadOS 16.4+ only for home-screen-installed apps)
Bluetooth/NFC/background location, heavy background work Weak — Web Bluetooth/NFC are Chromium-only; SW background execution is limited
Static content site Optional; a simple offline page may be enough

Manifest

{
  "id": "/",
  "name": "Acme Field Service",
  "short_name": "Acme",
  "start_url": "/?source=pwa",
  "scope": "/",
  "display": "standalone",
  "background_color": "#ffffff",
  "theme_color": "#1d4ed8",
  "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/maskable-512.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable" }
  ],
  "screenshots": [
    { "src": "/screenshots/wide.png", "sizes": "1280x800", "type": "image/png", "form_factor": "wide" },
    { "src": "/screenshots/narrow.png", "sizes": "720x1280", "type": "image/png", "form_factor": "narrow" }
  ]
}
  • Provide separate any and maskable icons (a combined "any maskable" icon gets cropped or padded badly in one of the contexts).
  • screenshots enable the richer install UI in Chromium.
  • iOS: add <link rel="apple-touch-icon" href="/icons/apple-180.png">; iOS has no beforeinstallprompt — users install via Share → Add to Home Screen.
  • HTTPS (or localhost) is required for service workers.

Strategy per Resource

Resource Strategy Notes
Hashed JS/CSS from the build Precache (installed with SW) Revisioned automatically by Workbox
HTML navigations NetworkFirst with short timeout, offline fallback Avoid serving stale HTML that references deleted chunks
Images StaleWhileRevalidate or CacheFirst + expiration Cap entries; opaque cross-origin responses cost quota
Public API reads (non-personal) NetworkFirst (timeout) or StaleWhileRevalidate
Authenticated/personal API data NetworkOnly, or cache per user and clear on logout Shared devices leak data otherwise
Analytics, payments, auth endpoints NetworkOnly

Workbox Service Worker (injectManifest)

// src/sw.ts
/// <reference lib="webworker" />
import { precacheAndRoute, cleanupOutdatedCaches, createHandlerBoundToURL } from 'workbox-precaching';
import { registerRoute, NavigationRoute, setCatchHandler } from 'workbox-routing';
import { NetworkFirst, StaleWhileRevalidate, NetworkOnly } from 'workbox-strategies';
import { ExpirationPlugin } from 'workbox-expiration';
import { CacheableResponsePlugin } from 'workbox-cacheable-response';
import { BackgroundSyncPlugin } from 'workbox-background-sync';

declare const self: ServiceWorkerGlobalScope & { __WB_MANIFEST: Array<{ url: string; revision: string | null }> };

precacheAndRoute(self.__WB_MANIFEST);   // includes /offline.html via globPatterns
cleanupOutdatedCaches();

registerRoute(
  new NavigationRoute(
    new NetworkFirst({ cacheName: 'pages', networkTimeoutSeconds: 3, plugins: [new CacheableResponsePlugin({ statuses: [200] })] }),
    { denylist: [/^\/api\//, /^\/auth\//] },
  ),
);

registerRoute(
  ({ request }) => request.destination === 'image',
  new StaleWhileRevalidate({
    cacheName: 'images',
    plugins: [new ExpirationPlugin({ maxEntries: 100, maxAgeSeconds: 30 * 24 * 3600, purgeOnQuotaError: true })],
  }),
);

registerRoute(
  ({ url }) => url.pathname.startsWith('/api/public/'),
  new NetworkFirst({ cacheName: 'api-public', net
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • references/caching-strategies.md
  • references/manifest-config.md
  • references/offline-strategies.md
  • references/pwa-fundamentals.md
  • references/pwa-offline-sync.md
  • references/pwa-service-worker-lifecycle.md
  • references/pwa-testing.md
  • references/service-worker.md

FAQ

Что делает скилл frontend-pwa?

Use when the user asks to make the site installable and work offline, PWA, web app manifest, service worker with Workbox or vite-plugin-pwa, update prompts, background sync or web push. Produces manifest, caching strategies and a safe update flow with real browser limits. Not for HTTP cache headers (use frontend-browser-caching).

Как установить скилл frontend-pwa?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл frontend-pwa запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить frontend-pwa с