- Home
- Skills
- Frontend & Web Apps
- PWA Service Worker Strategist
Works with the AI Agents you already use
PWA Service Worker Strategist
Design and implement PWA service workers with offline caching, Workbox strategies, and background sync.
$15
PWA Service Worker Strategist
Example session with this skill installed
I need a service worker for my React app. I want to cache images for a long time but keep API responses fresh. Also, generate the manifest.json.
- Read your context and instructions
- Compiled the pwa service worker
- Generated the app files
I have generated a Workbox-based service worker configuration and a compliant web app manifest. The setup uses a Stale-While-Revalidate strategy for your API calls to ensure speed without sacrificing freshness, and a Cache-First strategy for images.
PWA Configuration Files
service-worker.js
import { precacheAndRoute } from 'workbox-precaching';
import { registerRoute } from 'workbox-routing';
import { CacheFirst, StaleWhileRevalidate } from 'workbox-strategies';
// Precache core app shell
precacheAndRoute(self.__WB_MANIFEST);
// Cache images with CacheFirst strategy
registerRoute(
({ request }) => request.destination === 'image',
new CacheFirst({
cacheName: 'images',
})
);
// API calls with StaleWhileRevalidate
registerRoute(
({ url }) => url.pathname.startsWith('/api/'),
new StaleWhileRevalidate({
cacheName: 'api-cache',
})
);
// Handle updates
self.addEventListener('message', (event) => {
if (event.data && event.data.type === 'SKIP_WAITING') {
self.skipWaiting();
}
});
manifest.json
{
"short_name": "App",
"name": "Progressive Web Application",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
Next steps
- Register the service worker in your
index.jsormain.jsfile. - Ensure the
logo192.pngandfavicon.icofiles exist in your public directory. - Test the offline capability using Chrome DevTools Application tab.
logo192.png
ZIP · project files
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
Building reliable offline-first experiences is difficult due to complex caching lifecycles and cache invalidation bugs. This skill provides a structured approach to PWA implementation, handling the boilerplate and architectural decisions for service worker scripts. It ensures your application remains functional without a network connection while maintaining data integrity.
What it does
- Formulate Precaching: Generates strategies for core assets like HTML, CSS, JS, and the app shell.
- Runtime Caching: Configures
CacheFirstfor assets,StaleWhileRevalidatefor APIs, andNetworkFirstfor transactions. - Update Management: Implements
skipWaitinglogic and update flows to notify users when new versions are available. - Manifest Generation: Creates valid
manifest.jsonfiles with required icons and display configurations. - Debug Lifecycle: Analyzes service worker registration and activation states to resolve installation failures.
How it works
- Analyze Assets: Review the project structure to identify static assets and API endpoints requiring caching.
- Strategy Selection: Choose between Workbox-powered or vanilla JavaScript implementations based on project needs.
- Script Generation: Generate the service worker logic including event listeners for install, activate, and fetch.
- Manifest Creation: Produce the web app manifest and integration code for the main entry point.
Frameworks & tools
Specific support for Workbox libraries, vanilla JavaScript Service Worker API, and standard Web App Manifest specifications. It integrates with React, Next.js, and other frontend build systems.
Why this beats prompting it yourself
Service worker bugs often lead to "zombie" versions of apps that never update. This skill uses deterministic workflows for skipWaiting and specific runtime strategies, preventing common caching pitfalls that generic prompts miss.
Use cases
- Convert an existing React or Next.js app into a compliant PWA.
- Implement background sync for forms that must submit when connection returns.
- Optimize load times for image-heavy sites using
CacheFirstlogic. - Set up a robust update notification UI for production deployments.
Known limitations
Does not perform global system package installations or root-level configurations. Scope is limited to project-level JS and JSON files.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Frontend & Web Apps.
Strictly restricted to workspace root. No global package installs. Requires existing web icons for manifest completeness.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 3 days ago
- Software
- Zero global installationorelevated privileges required.
File System Read/Write (strictly scoped to current project workspace `./`).
Permissions
Target Use Cases: - Create a service worker with Workbox for offline PWA. - Configure runtime caching strategies for web application. - Generate a complete PWA manifest.json and service worker setup.