Skip to content

feat: add pwa-ready-app, and deliver user-notifications through the app's own service worker - #482

Draft
sea-snake wants to merge 74 commits into
mainfrom
feat/pwa-ready-app
Draft

sea-snake wants to merge 74 commits into
mainfrom
feat/pwa-ready-app

Conversation

@sea-snake

@sea-snake sea-snake commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Apps can now deliver Internet Identity notifications through their own service worker. An installed web app needs this to get notifications at all, and a browser tab can use it to control how its notifications look. This PR adds a skill for making an app installable and teaches user-notifications the new path.

New pwa-ready-app

  • Covers the manifest, icons, a root-scoped service worker bundled with esbuild, and the _headers that keep sw.js updatable on the static-site canister.
  • Explains which origin the installed app belongs to, and that a Safari installed app keeps its own sign-in.
  • Two cases:
    • an app without notifications (recommended: ship the service worker now);
    • an app that already notifies, which needs patching because Safari installed apps get nothing from II's own delivery.

user-notifications

  • A "Who shows the notifications" choice: Internet Identity, or the app's own service worker, which chooses how they look. The service worker works in a normal tab everywhere except iOS, where it needs the app on the Home Screen. Apps with their own web push migrate first.
  • Service worker handlers: fetchNotificationPayload, markNotificationOpened, pushsubscriptionchange.
  • Page side:
    • start-up subscribeToNotifications({ interactive: false });
    • the two-tap turn-on;
    • the same-device link for Safari installed apps;
    • errors.
  • A frontend on another origin, and moving off the app's own web push.
  • Three new mistakes, two output evals, two trigger queries.

Search cases are added for both skills.

Draft until these land

Eval results (with skill vs baseline)

pwa-ready-app, full suite:

Case With Without
Service worker registration fails with a text/html MIME type 4/4 2/4
An app with notifications becomes installable 4/4 1/4
An install button that works on Chrome and iPhone 5/5 4/5
Putting the app header into the desktop title bar 4/4 3/4
A dark installed app with white bars and a white launch 4/4 1/4
Triggers should 6/6, should not 4/4

user-notifications, added cases:

Case With Without
An installed app receives no notifications 5/5 0/5
Moving off the app's own web push 5/5 3/5
Triggers (7 should, 4 should not) 7/7, 4/4

On its first run, "An app with notifications becomes installable" scored 3/4. The skill named no calls, and one expectation said "browser tabs" for an iPhone-only prompt. The skill now names the calls, and the expectation reads "users who do not install the app".

🤖 Generated with Claude Code

…pp's own service worker

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sea-snake
sea-snake requested a balanced review from Copilot November 26, 2026 10:19
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Skill Validation Report

Validating skill: /home/runner/work/icskills/icskills/skills/pwa-ready-app

Structure

  • Pass: SKILL.md found

Frontmatter

  • Pass: name: "pwa-ready-app" (valid)
  • Pass: description: (996 chars)
  • Pass: license: "Apache-2.0"
  • Pass: compatibility: (71 chars)
  • Pass: metadata: (4 entries)

Markdown

  • Pass: no unclosed code fences found

Tokens

File Tokens
SKILL.md body 2,421
Total 2,421

Content Analysis

Metric Value
Word count 1,604
Code block ratio 0.17
Imperative ratio 0.16
Information density 0.17
Instruction specificity 0.83
Sections 12
List items 19
Code blocks 13

Contamination Analysis

Metric Value
Contamination level high
Contamination score 0.52
Primary language category javascript
Scope breadth 4
  • Warning: Language mismatch: config, markup (2 categories differ from primary)
  • Multi-interface tool detected: aws

Result: passed

Validating skill: /home/runner/work/icskills/icskills/skills/user-notifications

Structure

  • Pass: SKILL.md found

Frontmatter

  • Pass: name: "user-notifications" (valid)
  • Pass: description: (1004 chars)
  • Pass: license: "Apache-2.0"
  • Pass: compatibility: (74 chars)
  • Pass: metadata: (4 entries)

Tokens

  • Warning: SKILL.md body is 5871 tokens (spec recommends < 5000)

Markdown

  • Pass: no unclosed code fences found

Tokens

File Tokens
SKILL.md body 5,871
Total 5,871

Content Analysis

Metric Value
Word count 3,944
Code block ratio 0.17
Imperative ratio 0.10
Information density 0.13
Instruction specificity 0.69
Sections 19
List items 41
Code blocks 13

Contamination Analysis

Metric Value
Contamination level high
Contamination score 0.62
Primary language category javascript
Scope breadth 4
  • Warning: Language mismatch: config, systems (2 categories differ from primary)
  • Multi-interface tool detected: aws

Result: 1 warning

Project Checks


✓ Project checks passed for 2 skills (0 warnings)

sea-snake and others added 2 commits November 26, 2026 11:23
…fies needs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…affected

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The startup snippets use top-level await that breaks default Vite 6-and-earlier builds, and the notification example fails to preserve required Safari user gestures.

5 open issues
What changed in this PR

Adds guidance for making ICP frontends installable and delivering Internet Identity notifications through the app’s own service worker, including Safari installed apps.

Changes:

  • Introduces pwa-ready-app with manifest, icon, service worker, hosting-header, and installation-origin guidance.
  • Extends user-notifications with subscription flows, push handlers, alternative-origin configuration, and migration from custom web push.
  • Adds output evaluations, trigger queries, and search cases for both skills.
File Description
skills/​user-notifications/​SKILL.md Documents app-owned service worker delivery and push migration.
skills/​pwa-ready-app/​SKILL.md Adds installable frontend setup and platform guidance.
scripts/​data/​search-cases.json Adds PWA and service worker notification search cases.
evaluations/​user-notifications.json Adds installed-app delivery and migration evaluations.
evaluations/​pwa-ready-app.json Adds registration, update, installation, and trigger evaluations.

Review effort: Balanced

Comment thread skills/pwa-ready-app/SKILL.md Resolved
Comment thread evaluations/pwa-ready-app.json Resolved
Comment thread skills/user-notifications/SKILL.md Resolved
Comment thread skills/pwa-ready-app/SKILL.md Resolved
Comment thread skills/user-notifications/SKILL.md Resolved
sea-snake and others added 23 commits November 26, 2026 11:33
…path needs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rom pushsubscriptionchange

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ve the same-device link its own step

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e prompt each opens

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…as the user's story: consent at sign-in, then the device, then the app only

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and off around a toggle

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ink story, and add the toggle beside it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…step 2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… call the click handler a click handler

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e step 3's code like step 2's

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ari on macOS

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ssion prompt, and the in-app one a banner

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r path needs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… handler

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ble app

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ng is only needed on Apple devices

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n service worker can receive notifications

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… service worker

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…is offered for the Home Screen

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rker adds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…from when it is required

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sea-snake and others added 30 commits November 26, 2026 13:13
…ate the hour default and the day cap

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…om the service worker

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nal example it is

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…to the notification options guide

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ll as opening

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e and behavior

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ing up notification APIs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ng a chat app

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…her page

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dow controls overlay

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ription

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hat reveals them

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…implementing a chat app

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ugh authClient.subscribe

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ng more

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… service worker

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n, edge to edge, install, title bar

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…m implementing a chat app

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… not edge to edge

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ad state, the toggle's reach, and the app badge

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants