Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问clear审计通过

pwa-expert渐进式应用专家

Agent Skill

pwa-expert 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

5,337

周安装

218

GitHub Stars

98

下载量

1,727
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:pwa-expert(渐进式应用专家)
来源仓库:https://github.com/erichowens/some_claude_skills
仓库路径:skills/pwa-expert
安装命令:
npx skills add https://github.com/erichowens/some_claude_skills --skill pwa-expert
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/erichowens/some_claude_skills --skill pwa-expert

简介

用于查找、检索和筛选相关信息,支持关键词和任务场景快速定位候选结果。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中处理信息搜索类任务时使用。
  • 可结合来源仓库和原始 README 核验具体用法和功能边界。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网或文件操作。
  • 涉及敏感操作时应注意运行环境隔离和数据保护。

SKILL.md

Progressive Web App Expert

Build installable, offline-capable web apps with Service Workers, smart caching, and native-like experiences.

When to Use This Skill

  • Making a web app installable on mobile/desktop
  • Implementing offline functionality
  • Setting up Service Worker caching strategies
  • Handling install prompts (beforeinstallprompt)
  • Background sync for offline-first apps
  • Managing PWA update flows
  • Creating web app manifests

When NOT to Use This Skill

  • Native app development → Use React Native, Flutter, or native SDKs
  • General web performance → Use Lighthouse/performance auditing tools
  • Server-side rendering issues → Use Next.js/framework-specific docs
  • Push notifications only → Consider dedicated push notification services
  • Simple static sites → PWA overhead may not be worth it

Core Concepts

What Makes a PWA Installable

  1. HTTPS (or localhost for dev)
  2. Web App Manifest with required fields
  3. Service Worker with fetch handler
  4. Icons (192×192 and 512×512 minimum)

The PWA Stack

┌─────────────────────────────────────────┐
│           Your App (React/Next.js)      │
├─────────────────────────────────────────┤
│         Service Worker (sw.js)          │
│  ┌─────────────┐  ┌─────────────────┐   │
│  │   Cache     │  │  Network Fetch  │   │
│  │   Storage   │  │    Handling     │   │
│  └─────────────┘  └─────────────────┘   │
├─────────────────────────────────────────┤
│          manifest.json                  │
│  (App identity, icons, display mode)    │
└─────────────────────────────────────────┘

Web App Manifest

Complete manifest.json

{
  "name": "Junkie Buds 4 Life",
  "short_name": "JB4L",
  "description": "Recovery support app",
  "start_url": "/",
  "scope": "/",
  "display": "standalone",
  "orientation": "portrait-primary",
  "background_color": "#1a1410",
  "theme_color": "#1a1410",
  "icons": [
    {
      "src": "/icons/icon-192.png",
      "sizes": "192x192",
      "type": "image/png",
      "purpose": "any"
    },
    {
      "src": "/icons/icon-512.png",
      "sizes": "512x512",
      "type": "image/png",
      "purpose": "any"
    },
    {
      "src": "/icons/icon-maskable-512.png",
      "sizes": "512x512",
      "type": "image/png",
      "purpose": "maskable"
    }
  ],
  "shortcuts": [
    {
      "name": "Find Meetings",
      "short_name": "Meetings",
      "url": "/meetings?source=shortcut",
      "icons": [{ "src": "/icons/meetings-96.png", "sizes": "96x96" }]
    }
  ]
}

Display Modes

ModeDescription
fullscreenNo browser UI, full screen
standaloneApp-like, no URL bar (recommended)
minimal-uiSome browser controls
browserNormal browser tab

Link in HTML

<head>
  <link rel="manifest" href="/manifest.json" />
  <meta name="theme-color" content="#1a1410" />
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
  <link rel="apple-touch-icon" href="/icons/apple-touch-icon.png" />
</head>

Service Worker Basics

Registration

// lib/pwa.ts
export async function registerServiceWorker() {
  if ('serviceWorker' in navigator) {
    try {
      const registration = await navigator.serviceWorker.register('/sw.js', {
        scope: '/',
      });
      return registration;
    } catch (error) {
      console.error('SW registration failed:', error);
    }
  }
}

// Call on app mount
useEffect(() => {
  registerServiceWorker();
}, []);

Basic Service Worker Structure

// public/sw.js
const CACHE_NAME = 'myapp-v1';
const STATIC_ASSETS = ['/', '/offline', '/manifest.json'];

// Install: Cache static assets
self.addEventListener('install', (event) => {
  event.waitUntil(
    caches.open(CACHE_NAME).then((cache) => cache.addAll(STATIC_ASSETS))
  );
  self.skipWaiting();
});

// Activate: Clean old caches
self.addEventListener('activate', (event) => {
  event.waitUntil(
    caches.keys().then((keys) =>
      Promise.all(keys.filter((k) => k !== CACHE_NAME).map((k) => caches.delete(k)))
    )
  );
  self.clients.claim();
});

// Fetch: Handle requests (see references for strategies)
self.addEventListener('fetch', (event) => {
  event.respondWith(handleFetch(event.request));
});
See: references/service-worker-patterns.md for caching strategy implementations

Caching Strategies

StrategyBest ForTradeoff
Cache-FirstStatic assets, fonts, imagesStale until cache updated
Network-FirstAPI data, user contentSlower, needs connectivity
Stale-While-RevalidateBalance freshness/speedBackground updates
Network-OnlyAuth, real-time dataNo offline support
Cache-OnlyVersioned assetsNever updates
See: references/service-worker-patterns.md for full implementations

Install Prompts

Handle the beforeinstallprompt event to show a custom install UI:

// Basic pattern
const [deferredPrompt, setDeferredPrompt] = useState(null);

useEffect(() => {
  window.addEventListener('beforeinstallprompt', (e) => {
    e.preventDefault();
    setDeferredPrompt(e);
  });
}, []);

const handleInstall = async () => {
  if (deferredPrompt) {
    deferredPrompt.prompt();
    const { outcome } = await deferredPrompt.userChoice;
    // outcome: 'accepted' or 'dismissed'
  }
};
See: references/install-prompt.md for full usePWAInstall hook and component

Offline Experience

Key patterns:

  • Offline page fallback for navigation failures
  • useOnlineStatus hook to detect connectivity
  • Offline banner to inform users
See: references/offline-handling.md for implementations

Background Sync

Queue actions while offline, execute when connectivity returns:

// In Service Worker
self.addEventListener('sync', (event) => {
  if (event.tag === 'sync-data') {
    event.waitUntil(syncPendingData());
  }
});

// In App - trigger sync
const registration = await navigator.serviceWorker.ready;
await registration.sync.register('sync-data');
See: references/background-sync.md for full IndexedDB integration

Update Flow

Notify users when a new version is available:

// Basic pattern
registration.addEventListener('updatefound', () => {
  const newWorker = registration.installing;
  newWorker?.addEventListener('statechange', () => {
    if (newWorker.state === 'installed' && navigator.serviceWorker.controller) {
      // New version available - show update prompt
    }
  });
});
See: references/update-flow.md for usePWAUpdate hook and update strategies

Next.js Integration

Options for Next.js PWA:

  1. next-pwa - Works with standard Next.js server
  2. Custom SW - Required for output: 'export' (static sites)
  3. Workbox CLI - Generate SW after build
See: references/nextjs-integration.md for detailed configurations

Quick Reference

TaskSolution
Check if installedwindow.matchMedia('(display-mode: standalone)').matches
Force SW updateregistration.update()
Clear all cachescaches.keys().then(keys => keys.forEach(k => caches.delete(k)))
Check onlinenavigator.onLine
Get SW registrationnavigator.serviceWorker.ready
Skip waitingself.skipWaiting() in SW
Take controlself.clients.claim() in SW

Testing PWA

Chrome DevTools

  1. Application tab → Manifest, Service Workers, Cache Storage
  2. Lighthouse → PWA audit
  3. Network → Offline checkbox to simulate

Debug Checklist

  • Manifest loads (Application → Manifest)
  • SW registered (Application → Service Workers)
  • Cache populated (Application → Cache Storage)
  • Install prompt fires (Console for beforeinstallprompt)
  • Offline page works (Network → Offline)
  • Update flow works (trigger update, verify prompt)

References

Detailed implementations in /references/:

  • service-worker-patterns.md - Caching strategy implementations
  • install-prompt.md - usePWAInstall hook and install component
  • offline-handling.md - Offline page, status hooks, banners
  • background-sync.md - Background sync with IndexedDB
  • update-flow.md - Update detection and user prompts
  • nextjs-integration.md - Next.js PWA configuration options

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

29.32%
按下载量换算506

Cursor

21.58%
按下载量换算373

Gemini CLI

16.09%
按下载量换算278

Antigravity

11.97%
按下载量换算207

windsurf

6.79%
按下载量换算117

Codex

3.38%
按下载量换算58

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills