Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计通过

pwa-storefront普华永道店面

Agent Skill

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

总安装

445

周安装

18

GitHub Stars

19

下载量

140
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:pwa-storefront(普华永道店面)
来源仓库:https://github.com/finsilabs/awesome-ecommerce-skills
仓库路径:skills/pwa-storefront
安装命令:
npx skills add https://github.com/finsilabs/awesome-ecommerce-skills --skill pwa-storefront
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/finsilabs/awesome-ecommerce-skills --skill pwa-storefront

简介

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

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

SKILL.md

PWA Storefront

Overview

A Progressive Web App (PWA) storefront combines the reach of the web with native-app-like capabilities: offline catalog browsing, push notifications, home screen installation, and fast repeat loads from cache. Service workers intercept network requests and implement caching strategies that keep the store functional on flaky connections. This skill covers implementing a service worker with Workbox, creating a Web App Manifest, caching product catalogs, and sending push notifications for order updates.

When to Use This Skill

  • When your customers are in regions with unreliable mobile internet connectivity
  • When you want to enable "Add to Home Screen" for higher re-engagement rates without a native app
  • When repeat page loads should be instant by serving assets from cache
  • When you want to send push notifications for order status updates, back-in-stock alerts, or promotions
  • When building a mobile-first storefront that needs to compete with native apps in UX quality

Prerequisites & Platform Notes

This skill is written for custom/headless storefronts (Node.js, Python, or similar backend). The code examples use TypeScript/Node.js and can be adapted to any stack.

Shopify: Shopify Hydrogen is Shopify's headless framework. MACH/composable patterns apply when using Shopify as the commerce backend with a custom frontend, or when mixing Shopify with other best-of-breed services. WooCommerce: WooCommerce can serve as a headless backend via its REST API and WPGraphQL. These patterns apply when decoupling the frontend from WordPress. Magento: Magento's GraphQL API and PWA Studio support headless architectures. These composable patterns apply to Magento as a backend service in a MACH stack.

You'll need:

  • Node.js 18+ (or adapt to your backend language)
  • PostgreSQL (or your preferred relational database)
  • Redis for caching/queues
  • An email sending service (SendGrid, AWS SES, or Postmark)
  • CDN (Cloudflare, CloudFront, or Fastly)

Core Instructions

  1. Create the Web App Manifest The manifest makes the app installable on Android and iOS (iOS has partial support): // public/manifest.json {"name": "My Commerce Store", "short_name": "MyStore", "description": "Fast, reliable shopping from anywhere", "start_url": "/?source=pwa", "display": "standalone", "background_color": "#ffffff", "theme_color": "#1a1a2e", "orientation": "portrait-primary", "icons": [{"src": "/icons/icon-72x72.png", "sizes": "72x72", "type": "image/png"}, {"src": "/icons/icon-192x192.png", "sizes": "192x192", "type": "image/png", "purpose": "any maskable"}, {"src": "/icons/icon-512x512.png", "sizes": "512x512", "type": "image/png", "purpose": "any maskable"}], "screenshots": [{"src": "/screenshots/home.png", "sizes": "390x844", "type": "image/png", "form_factor": "narrow"}], "categories": ["shopping"], "share_target": {"action": "/search", "method": "GET", "params": {"title": "q"}}} Link in your HTML: <link rel="manifest" href="/manifest.json"> <meta name="theme-color" content="#1a1a2e"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="default"> <link rel="apple-touch-icon" href="/icons/icon-192x192.png">
  2. Register a service worker with Workbox npm install workbox-webpack-plugin # or for Vite: npm install vite-plugin-pwa Using vite-plugin-pwa (recommended for Vite/Next.js projects): // vite.config.ts import {VitePWA} from 'vite-plugin-pwa'; export default {plugins: [VitePWA({registerType: 'autoUpdate', workbox: {globPatterns: ['**/*.{js,css,html,svg,png,webp,woff2}'], runtimeCaching: [{urlPattern: /^https:\/\/fonts\.googleapis\.com/, handler: 'CacheFirst', options: {cacheName: 'google-fonts-cache', expiration: {maxAgeSeconds: 60 * 60 * 24 * 365}},}, {urlPattern: /\/api\/products/, handler: 'StaleWhileRevalidate', options: {cacheName: 'products-cache', expiration: {maxEntries: 500, maxAgeSeconds: 60 * 60 * 24}, // 24h cacheableResponse: {statuses: [0, 200]},},}, {urlPattern: /\/api\/collections/, handler: 'NetworkFirst', options: {cacheName: 'collections-cache', networkTimeoutSeconds: 3, expiration: {maxEntries: 50, maxAgeSeconds: 60 * 60},},},],}, manifest: {/* inline manifest or path */},}),],};
  3. Implement a custom service worker for offline catalog For fine-grained control, write the service worker directly: // public/sw.js import {precacheAndRoute, cleanupOutdatedCaches} from 'workbox-precaching'; import {registerRoute} from 'workbox-routing'; import {StaleWhileRevalidate, CacheFirst, NetworkFirst} from 'workbox-strategies'; import {ExpirationPlugin} from 'workbox-expiration'; import {BackgroundSyncPlugin} from 'workbox-background-sync'; // Precache app shell (injected by build tool) precacheAndRoute(self.__WB_MANIFEST); cleanupOutdatedCaches(); // Product images: Cache-first with 7-day expiry registerRoute(({url}) => url.hostname.includes('cdn.shopify.com') || url.pathname.includes('/product-images/'), new CacheFirst({cacheName: 'product-images', plugins: [new ExpirationPlugin({maxEntries: 200, maxAgeSeconds: 60 * 60 * 24 * 7}),],})); // Product API: Stale-while-revalidate (show cached, refresh in background) registerRoute(({url}) => url.pathname.startsWith('/api/products') || url.pathname.startsWith('/api/collections'), new StaleWhileRevalidate({cacheName: 'api-products', plugins: [new ExpirationPlugin({maxEntries: 500, maxAgeSeconds: 60 * 60 * 24}),],})); // Background sync for cart operations when offline const cartSyncPlugin = new BackgroundSyncPlugin('cart-sync-queue', {maxRetentionTime: 24 * 60, // Retry for 24 hours}); registerRoute(({url, request}) => url.pathname.startsWith('/api/cart') && request.method!== 'GET', new NetworkFirst({plugins: [cartSyncPlugin]}), 'POST');
  4. Show an offline fallback page // In the service worker import {setCatchHandler, setDefaultHandler} from 'workbox-routing'; // Precache the offline page during installation precacheAndRoute([{url: '/offline', revision: '1'}]); // Serve offline page for navigation requests when network fails setCatchHandler(async ({event}) => {if (event.request.destination === 'document') {return caches.match('/offline');} return Response.error();}); // app/offline/page.tsx export default function OfflinePage() {return (<div className="flex flex-col items-center justify-center min-h-screen"> <h1>You're offline</h1> <p>Check your connection. Recently viewed products are still available below.</p> <RecentlyViewedProducts /> {/* Reads from IndexedDB */} </div>);}
  5. Implement Web Push notifications ` // client: subscribe to push notifications async function subscribeToPush() {const registration = await navigator.serviceWorker.ready; const subscription = await registration.pushManager.subscribe({userVisibleOnly: true, applicationServerKey: urlBase64ToUint8Array(process.env.NEXT_PUBLIC_VAPID_PUBLIC_KEY!),}); await fetch('/api/push/subscribe', {method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({subscription, customerId: user.id}),});} // server: send push notification for order status update import webpush from 'web-push'; webpush.setVapidDetails('mailto:support@mystore.com', process.env.VAPID_PUBLIC_KEY!, process.env.VAPID_PRIVATE_KEY!); export async function sendOrderUpdatePush(customerId: string, order: Order) {const subscriptions = await db.pushSubscriptions.findByCustomer(customerId); await Promise.allSettled(subscriptions.map(sub => webpush.sendNotification(sub.data, JSON.stringify({title: Order #${order.number} Update, body: Your order is now ${order.status}, icon: '/icons/icon-192x192.png', url: /orders/${order.id}, tag: order-${order.id},}))));} Handle push events in the service worker: self.addEventListener('push', (event) => {const data = event.data?.json(); event.waitUntil(self.registration.showNotification(data.title, {body: data.body, icon: data.icon, badge: '/icons/badge-72x72.png', data: {url: data.url}, tag: data.tag, renotify: true,}));}); self.addEventListener('notificationclick', (event) => {event.notification.close(); event.waitUntil(clients.openWindow(event.notification.data.url));});`
  6. Detect and respond to offline status in the UI // hooks/use-online-status.ts import {useState, useEffect} from 'react'; export function useOnlineStatus() {const [isOnline, setIsOnline] = useState(typeof navigator!== 'undefined'? navigator.onLine: true); useEffect(() => {const setOnline = () => setIsOnline(true); const setOffline = () => setIsOnline(false); window.addEventListener('online', setOnline); window.addEventListener('offline', setOffline); return () => {window.removeEventListener('online', setOnline); window.removeEventListener('offline', setOffline);};}, []); return isOnline;} // Usage in a component function CartButton() {const isOnline = useOnlineStatus(); return (<button disabled={!isOnline} title={isOnline? undefined: 'You are offline'}> Add to Cart </button>);}

Examples

Lighthouse PWA audit checklist (automated)

# Install Lighthouse CLI
npm install -g lighthouse

# Audit PWA criteria
lighthouse https://mystore.com --preset=desktop --only-categories=pwa --output=json --output-path=./lighthouse-pwa.json

# Key scores to target:
# - "Installable" checks: manifest, service worker, HTTPS
# - "PWA Optimized" checks: themed address bar, offline page, mobile viewport

IndexedDB catalog cache for offline browsing

import {openDB} from 'idb';

const db = await openDB('catalog-db', 1, {
  upgrade(db) {
    db.createObjectStore('products', {keyPath: 'id'});
    db.createObjectStore('collections', {keyPath: 'id'});
  },
});

// Store products when user browses online
export async function cacheProductsLocally(products: Product[]) {
  const tx = db.transaction('products', 'readwrite');
  await Promise.all([...products.map(p => tx.store.put(p)), tx.done]);
}

// Retrieve from IDB when offline
export async function getProductFromCache(id: string): Promise<Product | null> {
  return db.get('products', id) ?? null;
}

Best Practices

  • Use StaleWhileRevalidate for product data — the user sees cached content immediately while the service worker fetches the latest data in the background
  • Never cache cart or checkout pages — these must always be fresh; use NetworkOnly strategy for /cart, /checkout, and account pages
  • Version your service worker cache names — when you update your app, increment cache names so stale assets are purged automatically
  • Test offline mode in Chrome DevTools — use the Network tab → "Offline" throttle to verify your offline experience before deploying
  • Generate VAPID keys once and store them securely — VAPID private key loss means losing all existing push subscriptions; store in a secrets manager
  • Request push permission with context — prompt users to allow notifications only after a relevant action (order placed, back-in-stock interested) to maximize opt-in rates
  • Set reasonable cache size limits — use ExpirationPlugin with maxEntries to prevent the service worker cache from consuming too much device storage

Common Pitfalls

ProblemSolution
Service worker not updating after deploymentUse registerType: 'autoUpdate' and call skipWaiting() in the service worker to take control immediately; show a "New version available" toast
Push notifications not shown on iOSiOS requires the user to add the PWA to the Home Screen first; Web Push on iOS Safari requires iOS 16.4+ and standalone display mode
Cached API responses served after price changesSet maxAgeSeconds appropriately; use on-demand cache invalidation by busting cache names on deployment
Background sync fails silentlyWrap background sync in try/catch and log errors; test with the DevTools Application → Background Sync panel
App installability failing Lighthouse auditCheck for: HTTPS, valid manifest with 512×512 maskable icon, registered service worker, and start_url responding with 200

Related Skills

  • @jamstack-storefront
  • @image-optimization-cdn
  • @edge-commerce
  • @monitoring-alerting-commerce

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

38.29%
按下载量换算54

Claude

28.31%
按下载量换算40

Cursor

21.12%
按下载量换算30

Gemini CLI

10.24%
按下载量换算14

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/finsilabs/awesome-ecommerce-skills --skill pwa-storefront 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills