Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

pwa

/pwa

Wspiera tworzenie Progressive Web App: service workery, Web App Manifest, strategie offline-first, cache z Workbox, powiadomienia push i instalowalność.

Licencja
MIT
Ostatnia zmiana repozytorium
21.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 21.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Wspiera tworzenie Progressive Web App: service workery, Web App Manifest, strategie offline-first, cache z Workbox, powiadomienia push i instalowalność.

Wyzwalacze z opisu

PWAProgressive Web Appservice workeroffline-firstWeb App ManifestWorkboxinstallable web appcache-first
Oryginalny opis (EN)

Progressive Web App development. Service workers, Web App Manifest, offline-first strategies, caching with Workbox, push notifications, and installability. USE WHEN: user mentions "PWA", "Progressive Web App", "service worker", "offline-first", "Web App Manifest", "Workbox", "installable web app", "cache-first", "add to home screen" DO NOT USE FOR: native mobile apps - use `react-native`, `flutter`, `expo`; push notification server-side - use `push-notifications`

Jak działa

  1. Web App Manifest
  2. Service Worker (Workbox — recommended)
  3. Registration
  4. Offline Fallback
  5. Caching Strategies
  6. Install Prompt
  7. Anti-Patterns
  8. Production Checklist
Sekcje z nagłówków SKILL.md, w oryginale · 136 linii, 466 słów
Podgląd SKILL.md
---
name: pwa
description: |
  Progressive Web App development. Service workers, Web App Manifest,
  offline-first strategies, caching with Workbox, push notifications,
  and installability.

  USE WHEN: user mentions "PWA", "Progressive Web App", "service worker",
  "offline-first", "Web App Manifest", "Workbox", "installable web app",
  "cache-first", "add to home screen"

  DO NOT USE FOR: native mobile apps - use `react-native`, `flutter`, `expo`;
  push notification server-side - use `push-notifications`
allowed-tools: Read, Grep, Glob, Write, Edit
---
# Progressive Web Apps

## Web App Manifest

```json
{
  "name": "My App",
  "short_name": "MyApp",
  "start_url": "/",
  "display": "standalone",
  "background_color": "#ffffff",
  "theme_color": "#000000",
  "icons": [
    { "src": "/icons/192.png", "sizes": "192x192", "type": "image/png" },
    { "src": "/icons/512.png", "sizes": "512x512", "type": "image/png", "purpose": "any maskable" }
  ]
}
```

```html
<link rel="manifest" href="/manifest.json" />
<meta name="theme-color" content="#000000" />
<link rel="apple-touch-icon" href="/icons/192.png" />
```

## Service Worker (Workbox — recommended)

```typescript
// sw.ts (using Workbox)
import { precacheAndRoute } from 'workbox-precaching';
import { registerRoute } from 'workbox-routing';
import { CacheFirst, NetworkFirst, StaleWhileRevalidate } from 'workbox-strategies';
import { ExpirationPlugin } from 'workbox-expiration';

// Precache app shell
precacheAndRoute(self.__WB_MANIFEST);

// Cache-first for static assets
registerRoute(
  ({ request }) => request.destination === 'image' || request.destination === 'font',
  new CacheFirst({
    cacheName: 'static-assets',
    plugins: [new ExpirationPlugin({ maxEntries: 100, maxAgeSeconds: 30 * 24 * 60 * 60 })],
  })
);

// Network-first for API calls
registerRoute(
  ({ url }) => url.pathname.startsWith('/api/'),
  new NetworkFirst({
    cacheName: 'api-cache',
    plugins: [new ExpirationPlugin({ maxEntries: 50, maxAgeSeconds: 5 * 60 })],
  })
);

// Stale-while-revalidate for pages
registerRoute(
  ({ request }) => request.mode === 'navigate',
  new StaleWhileRevalidate({ cacheName: 'pages' })
);
```

## Registration

```typescript
if ('serviceWorker' in navigator) {
  window.addEventListener('load', async () => {
    const registration = await navigator.serviceWorker.register('/sw.js');
    console.log('SW registered:', registration.scope);
  });
}
```

## Offline Fallback

```typescript
// In service worker
import { setCatchHandler } from 'workbox-routing';

setCatchHandler(async ({ event }) => {
  if (event.request.destination === 'document') {
    return caches.match('/offline.html');
  }
  return Response.error();
});
```

## Caching Strategies

| Strategy | Use For | Freshness |
|----------|---------|-----------|
| Cache First | Static assets, fonts, images | Stale OK |
| Network First | API data, dynamic pages | Fresh preferred |
| Stale While Revalidate | Semi-dynamic content | Stale, updating |
| Network Only | Auth, POST requests | Always fresh |
| Cache Only | Precached app shell | Immutable |

## Install Prompt

```typescript
let deferredPrompt: BeforeInstallPromptEvent | null = null;

window.addEventListener('beforeinstallprompt', (e) => {
  e.preventDefault();
  deferredPrompt = e;
  showInstallButton();
});

async function installApp() {
  if (!deferredPrompt) return;
  deferredPrompt.prompt();
  const { outcome } = await deferredPrompt.userChoice;
  console.log(`Install ${outcome}`);
  deferredPrompt = null;
}
```

## Anti-Patterns

| Anti-Pattern | Fix |
|--------------|-----|
| Caching everything with Cache First | Use Network First for dynamic data |
| No offline fallback page | Precache an offline.html |
| No cache expiration | Use ExpirationPlugin with maxEntries/maxAge |
| SW caches auth tokens | Never cache sensitive data |
| No SW update strategy | Use `skipWaiting()` + prompt user to refresh |

## Production Checklist

- [ ] Web App Manifest with icons and theme
- [ ] Service worker with Workbox strategies
- [ ] Offline fallback page
- [ ] Cache expiration policies
- [ ] Install prompt UX
- [ ] Lighthouse PWA audit passing

Wersje

RepozytoriumWynikLicencja
Ta strona · claude-dev-suite/claude-dev-suite100MIT
autocss-com/ai100MIT
PIXARTSeu/Synapse95AGPL-3.0
Tyler-R-Kendrick/agent-skills95MIT

Migawka bazy z 13.11.2026 · wersja paczki df7981b757ab (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100progressive-web-app
    Buduje Progressive Web Apps z obsługą offline, instalowalnością i strategiami cache, w tym service workers, web app manifest i Workbox.
  • 100progressive-web-app
    Buduje Progressive Web Apps z obsługą offline, instalowalnością i strategiami cache, w tym service workers, web app manifest i Workbox.
  • 100progressive-web-app
    Buduje Progressive Web Apps z obsługą offline, instalowalnością i strategiami cache, w tym service workers, web app manifest i Workbox.
  • 95frontend-pwa
    Zmienia aplikację webową w instalowalną i działającą offline: manifest, service worker z Workbox, bezpieczną aktualizację i powiadomienia push.
  • 100pwa-expert
    Pomaga tworzyć Progressive Web App z service workerami i obsługą offline: strategie cache, komunikaty instalacji, powiadomienia push i synchronizacja w tle.
  • 100pwa-expert
    Pomaga tworzyć Progressive Web App z service workerami i obsługą offline: strategie cache, komunikaty instalacji, powiadomienia push i synchronizacja w tle.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.