Agent Guardrails

Use these rules when an AI agent builds or reviews a PWA.

Never Skip

  • Read the current browser/platform docs for the target browsers.
  • State the offline promise before writing cache code.
  • Keep app data in IndexedDB or another real data store, not service worker memory.
  • Feature-detect optional capabilities.
  • Provide foreground fallbacks for background work.
  • Test installed behavior on the actual target browser/device.
  • Record the exact wrapper, signing, and store policy assumptions before packaging.

Stop And Ask

Ask before implementing if the app needs:

  • iOS push, background sync, or Add to Home Screen behavior as a critical requirement.
  • Play Store, App Store, Microsoft Store, Samsung, or Huawei submission.
  • Native APIs beyond ordinary Web Platform support.
  • Long-running background tasks, alarms, SMS/calls, location tracking, Bluetooth-heavy flows, or regulated workflows.

Default Implementation Bias

Start with:

  • one normal web app
  • one manifest
  • one simple service worker
  • one IndexedDB schema
  • one explicit mutation queue
  • one Playwright offline smoke test
  • one real-device install smoke test

Add Workbox, TWA, PWABuilder, push, background sync, and store packages only when the product needs them.