pwa-setup
Skill1 starsChanged 5 months agoApache-2.0View on GitHub
Converts a web app to a Progressive Web App with offline support, install prompts, and push notifications. Use when making a web app installable and offline-capable.
In this repository58 other files it gives its agents.
- agent-chain-designerSkill
- api-wrapper-builderSkill
- embeddings-builderSkill
- evaluation-harnessSkill
- fine-tuning-preparerSkill
- llm-router-builderSkill
- ml-model-trainerSkill
- model-benchmarkerSkill
- prompt-engineerSkill
- rag-pipeline-builderSkill
- synthetic-data-generatorSkill
- vector-db-integratorSkill
- csv-processorSkill
- database-schema-designerSkill
- data-pipeline-builderSkill
- etl-workflow-designerSkill
- json-transformerSkill
- pandas-data-cleanerSkill
- report-generatorSkill
- sql-query-optimizerSkill
- time-series-analyzerSkill
- visualization-generatorSkill
- backup-strategySkill
- ci-cd-optimizerSkill
- docker-compose-generatorSkill
- github-actions-pipelineSkill
- kubernetes-deploymentSkill
- load-balancer-configSkill
- log-aggregator-setupSkill
- monitoring-dashboardSkill
- nginx-config-generatorSkill
- security-hardeningSkill
- ssl-certificate-managerSkill
- terraform-module-builderSkill
- api-security-auditorSkill
- compliance-checkerSkill
- dependency-checkerSkill
- incident-responderSkill
- jwt-security-auditorSkill
- owasp-checkerSkill
- penetration-test-plannerSkill
- secret-detectorSkill
- threat-model-designerSkill
- vulnerability-scannerSkill
- accessibility-auditorSkill
- api-route-builderSkill
- auth-flow-builderSkill
- css-animation-crafterSkill
- form-validatorSkill
- graphql-schema-designerSkill
- html-component-builderSkill
- nextjs-app-scaffoldSkill
- performance-auditorSkill
- react-component-generatorSkill
- responsive-layout-systemSkill
- seo-optimizerSkill
- tailwind-design-systemSkill
- websocket-integrationSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 42
Use Workbox (recommended) or write a small custom SW.
- Very specific: line 51
Call prompt() on user gesture.
- Very specific: line 62
Use next-pwa plugin or manual setup with public/sw.js.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Overview
Guides the complete conversion of a web app into a Progressive Web App: creating a Web App Manifest, implementing a service worker with caching strategies (Cache First, Network First, Stale-While-Revalidate), offline fallback page, install prompt handling, and push notification setup using the Push API + VAPID keys.
When to Use This Skill
- The app should feel like a native app (installable from browser).
- Users need to use core features offline (read content, draft forms, view dashboards).
- Adding push notifications for re-engagement.
- The user says "make this a PWA", "add offline support", "installable web app".
Prerequisites
- HTTPS (required for service workers and push in production; localhost works for dev).
- Modern browser support (all current evergreen browsers).
- For push: a push service (Firebase Cloud Messaging, VAPID + web-push library on server).
Steps
- Create Web App Manifest (
app/manifest.tsorpublic/manifest.json):- name, short_name, start_url, display ("standalone"), background_color, theme_color, icons (192x192, 512x512, maskable).
- Screenshots for install prompt (optional but powerful).
- Implement Service Worker:
- Lifecycle: install → activate → fetch.
- Caching strategies per asset type:
- App shell (HTML, CSS, JS critical): Cache First or Stale-While-Revalidate.
- API/data: Network First with cache fallback.
- Images: Cache First with long TTL.
- Use Workbox (recommended) or write a small custom SW.
- Offline fallback:
- A dedicated offline.html page.
- In fetch handler, return it when network fails for navigation requests.
- Install prompt:
- Listen for
beforeinstallprompt. - Show a custom "Install" button.
- Call
prompt()on user gesture. - Handle
appinstalledevent.
- Listen for
- Push notifications:
- Request permission.
- Subscribe to push using VAPID public key.
- Send subscription to your server.
- Server sends push using
web-pushlibrary. - Handle
pushevent in SW and show Notification.
- Next.js specific:
- Use
next-pwaplugin or manual setup withpublic/sw.js. - Register SW in a client component or layout.
- Use
- Output:
- Full manifest.
- Service worker code (or Workbox config).
- React hook or component for install prompt.
- Push subscription example.
- VAPID key generation instructions.
- Testing checklist.
Examples
Complete manifest.ts, a production-ready service worker with multiple strategies, install prompt component, and a minimal push notification flow (client + server) are included.
Edge Cases & Error Handling
- Permission denied for notifications: Graceful UI, never nag.
- SW update: Proper skipWaiting + clients.claim, with update UI prompt.
- Large offline assets: Be selective about what goes in the cache.
- Background sync: For form submissions when offline (using Background Sync API).
Verification
npm run build && npm run start— serve over HTTPS (useserveor Vercel).- Open in Chrome — "Install" button or + icon in address bar appears.
- Click install — app installs to home screen / apps list.
- Go offline (DevTools → Network → Offline) — core pages still load.
- Trigger a push notification from server — it arrives even when app is closed.
- Lighthouse PWA category = 100.
- Success: App is installable, works offline for key flows, and can receive push.
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

