pwa-offline-sync
Skill2 starsChanged 12 days agoMITView on GitHub
Design Cache Storage + IndexedDB strategy and sync queue. Use this skill when building service workers, implementing caching strategies, or investigating offline bugs — even if they just say "make it work offline" or "add caching". Generic pattern for any offline-first application. Not for lifecycle-management.
In this repository63 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/avoid-ai-writing/AGENTS.mdAGENTS.md
- .agents/skills/do-web-doc-resolver/AGENTS.mdAGENTS.md
- .agents/skills/skill-evaluator/AGENTS.mdAGENTS.md
- scripts/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms-full.txtllms.txt
- llms.txtllms.txt
- accessibility-auditorSkill
- agent-browserSkill
- agentic-abstentionSkill
- agents-mdSkill
- api-design-firstSkill
- architecture-diagramSkill
- avoid-ai-writingSkill
- cicd-pipelineSkill
- cloudflare-worker-apiSkill
- codacySkill
- codeberg-apiSkill
- code-review-assistantSkill
- css-render-performanceSkill
- database-devopsSkill
- debuggerSkill
- delegateSkill
- dependency-upgradesSkill
- dist-channel-selectionSkill
- docs-hookSkill
- document-rendering-and-locatorsSkill
- dogfoodSkill
- dora-reportSkill
- do-web-doc-resolverSkill
- durable-objectsSkill
- eu-ai-act-complianceSkill
- git-github-workflowSkill
- goap-agentSkill
- implementerSkill
- intent-classifierSkill
- iterative-refinementSkill
- jules-delegatorSkill
- learnSkill
- lifecycle-managementSkill
- local-context-sanitizationSkill
- memory-contextSkill
- migration-refactoringSkill
- nested-build-isolationSkill
- privacy-firstSkill
- progressive-deliverySkill
- reader-ui-uxSkill
- readme-best-practicesSkill
- secrets-managementSkill
- secure-invite-and-accessSkill
- security-code-auditorSkill
- shell-script-qualitySkill
- skill-creatorSkill
- skill-evaluatorSkill
- static-analysisSkill
- testing-strategySkill
- test-runnerSkill
- triz-solverSkill
- turso-dbSkill
- The first 60 shown.
The file
Files
PWA Offline Sync
Purpose: design, implement, and validate offline/PWA behavior (service worker, caches, IndexedDB, sync queue).
When to Use
- Editing service worker, cache strategies, or sync orchestration.
- Touching IndexedDB schema, permission caching, or zombie detection.
- Investigating offline bugs or data conflicts.
Workflow
- Assess entity rules -- confirm table of offline-first entities + conflict strategy.
- Plan caches -- map static/assets/data to Cache Storage policies (cache-first vs stale-while-revalidate vs network-first).
- IndexedDB schema -- define stores for progress, annotations, sync queue, permission cache; version migrations carefully.
- Service worker -- implement install/activate/fetch with trace logging, offline fallback page, and error handling.
- Sync manager -- queue writes locally, dedupe via mutation IDs, replay when online, implement exponential backoff + zombie detection.
- Testing -- simulate offline/online in E2E tests; unit-test queue reducers; verify revoked access is blocked after reconnect.
Checklist
- Cache + DB version numbers bumped intentionally (no silent clears).
- Headers sent even when offline data queued.
- Zombie detection notifies user + stops further reads upon revocation.
- Service worker cleans up old caches.
- Memory-safe listeners (remove event handlers when replaced).
See Also
lifecycle-management— Resource cleanup and error handlingcss-render-performance— CSS render performance optimization
Rationalizations
| Rationalization | Reality |
| "Cache-first is always the best strategy" | Different data requires different strategies; stale-while-revalidate or network-first may be more appropriate. |
| "Sync queue is overkill for our simple app" | Even simple apps need conflict resolution when offline writes collide with server state. |
| "Zombie detection is too complex to implement" | Without it, revoked users can continue reading cached data indefinitely. |
Red Flags
- Using a single cache strategy for all data types
- Not implementing zombie detection for revoked access
- Forgetting to bump cache/DB version numbers on schema changes
References
references/offline-strategies.md- Offline-first architecture patternsreferences/sync-queue.md- Sync queue design and conflict resolution
Voice & Context
- Default:
professional+blog - Reference:
voice-profilesskill for definitions and auto-detection.
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.

