Register a service worker for caching and offline support

SkillDev tools

Service-worker is a skill for AI agents that audits repeat-visit performance, adds offline support, and evaluates PWA readiness for a web application. It checks whether a service worker is registered and caching assets, then guides adding registration and caching strategies. It can also review service worker code for lifecycle and cache-versioning problems.

Available today. Use it from your connected AI after setup.

Have a web application with a main JavaScript entry point where a service worker can be registered.

Then ask your AI: use the Register a service worker for caching and offline support skill

What your AI can do with it

  • Check whether a service worker is registered and what it caches
  • Add service worker registration and caching strategies for assets and navigation
  • Pre-cache critical static assets via an install event
  • Clean up old caches on update with an activate event
  • Explain how service workers intercept requests and caching trade-offs
  • Review service worker code for missing lifecycle handlers and stale-content risks

Getting started

  1. Have a web application with a main JavaScript entry point where a service worker can be registered.
  2. Add the service-worker skill to your agent setup.
  3. Ask the agent to check whether a service worker is registered and caching assets.
  4. Have the agent add registration, install and activate handlers, and per-resource caching strategies.
  5. Request a code review of the service worker file and its registration.

What this skill tells your AI

The instructions your AI receives, as published by thedaviddias/front-end-checklist in skills/service-worker/SKILL.md and read by ahel’s review.

Service workers act as a programmable network proxy between the browser and the network. They eliminate repeated server round-trips for static assets, cut load times on repeat visits by 50–90 %, and allow the app to function at all on flaky or offline networks — which is critical for users on mobile or low-bandwidth connections.

Quick Reference

  • Register a service worker in your main JavaScript entry point
  • Use an install event to pre-cache critical static assets
  • Choose a caching strategy (cache-first, network-first, stale-while-revalidate) per resource type
  • Implement an activate event to clean up old caches on update

Check

Check whether a service worker is registered and whether it caches static assets, API responses, or provides an offline fallback.

Fix

Add a service worker registration call and implement appropriate caching strategies for static assets and navigation requests.

Explain

Explain how service workers intercept network requests and how different caching strategies trade off freshness vs. speed.

Code Review

Review the service worker file and its registration. Flag missing install/ activate lifecycle handlers, absent cache-versioning, missing fetch handlers, and any patterns that could cause stale content to be served indefinitely.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/en/rules/performance/service-worker

Signals

GitHub stars
74k
Forks
7k
Last commit
Aug 2026

Questions

What does the skill check for?
It checks whether a service worker is registered and whether it caches static assets, API responses, or provides an offline fallback.
What fixes can it apply?
It adds a service worker registration call and implements caching strategies for static assets and navigation requests.
What does the code review look for?
Missing install/activate lifecycle handlers, absent cache-versioning, missing fetch handlers, and patterns that could serve stale content indefinitely.
Advanced
Item type
skill
Key
service-worker
Source
github.com/thedaviddias/front-end-checklist