Convert app to Progressive Web App
✓Works with OpenClaudeYou are a frontend developer specializing in Progressive Web Apps. The user wants to convert their web application into a PWA with offline support, installability, and service worker functionality.
What to check first
- Verify your app is served over HTTPS (required for service workers;
localhostis an exception for development) - Run
npm listto confirm you have a build tool (webpack, Vite, Create React App, etc.) - Check that your
public/folder exists and is configured as your static assets directory
Steps
- Create a
public/manifest.jsonfile with app metadata (name, icons, theme colors, start URL) - Add the manifest link to your
index.html<head>:<link rel="manifest" href="/manifest.json"> - Create a
public/service-worker.jsfile that handles fetch events and caches assets - Register the service worker in your main JavaScript entry point with
navigator.serviceWorker.register() - Define a cache versioning strategy (cache-first, network-first, or stale-while-revalidate)
- Implement asset precaching for critical files (HTML, CSS, JS bundles)
- Add offline fallback UI or page (typically served when network is unavailable)
- Test with Chrome DevTools Application tab: verify manifest loads, service worker installs, and cache populates
Code
// public/manifest.json
{
"name": "My Progressive Web App",
"short_name": "MyPWA",
"description": "A fast, installable web app",
"start_url": "/",
"scope": "/",
"display": "standalone",
"orientation": "portrait-primary",
"background_color": "#ffffff",
"theme_color": "#2196F3",
"icons": [
{
"src": "/icon-192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any"
},
{
"src": "/icon-512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
]
}
// public/service-worker.js
const CACHE_NAME = 'my-pwa-v1';
const urlsToCache = [
'/',
'/index.html',
'/styles/main.css',
'/scripts/main.js',
'/offline.html'
];
self.addEventListener('install', (event) => {
event.waitUntil(
caches.open(CACHE_NAME)
.then((cache) => cache.addAll(urlsToCache))
.then(() => self.skipWaiting())
);
});
self.addEventListener('activate', (event) => {
event.waitUntil(
caches.keys().then((
Note: this example was truncated in the source. See the GitHub repo for the latest full version.
Common Pitfalls
- Treating this skill as a one-shot solution — most workflows need iteration and verification
- Skipping the verification steps — you don't know it worked until you measure
- Applying this skill without understanding the underlying problem — read the related docs first
When NOT to Use This Skill
- When a simpler manual approach would take less than 10 minutes
- On critical production systems without testing in staging first
- When you don't have permission or authorization to make these changes
How to Verify It Worked
- Run the verification steps documented above
- Compare the output against your expected baseline
- Check logs for any warnings or errors — silent failures are the worst kind
Production Considerations
- Test in staging before deploying to production
- Have a rollback plan — every change should be reversible
- Monitor the affected systems for at least 24 hours after the change
Related Frontend Skills
Other Claude Code skills in the same category — free to download.
Component Generator
Generate React/Vue/Svelte components with props
Responsive Layout
Create responsive layouts with Tailwind/CSS Grid
Form Builder
Build forms with validation (React Hook Form, Formik)
State Management Setup
Set up state management (Zustand, Redux, Jotai)
Animation Creator
Create animations with Framer Motion or CSS
Dark Mode Setup
Implement dark/light mode toggle
Lazy Loading
Add lazy loading for images and components
SEO Optimizer
Add SEO meta tags, structured data, sitemap
Want a Frontend skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.