AGENT SKILL

pwa-patterns

暂无简介

License 许可
MIT
最近更新
2026-03-27
Stars
★ 3
Forks
1

02 资源文件 1

03 SKILL.md 正文

PWA Patterns

Core Requirements

  • Web App Manifest (manifest.json): name, icons (192+512px), start_url, display: standalone
  • Service Worker: Caching strategy, offline fallback, background sync
  • HTTPS: Required for service worker registration

Next.js Setup (next-pwa)

// next.config.js
const withPWA = require('next-pwa')({
  dest: 'public',
  disable: process.env.NODE_ENV === 'development',
  register: true,
  skipWaiting: true,
});
module.exports = withPWA({ /* next config */ });

Caching Strategies

  • Cache First: Static assets (images, fonts, CSS) — fast, stale until update
  • Network First: API responses, dynamic pages — fresh, fallback to cache offline
  • Stale While Revalidate: Semi-dynamic content — fast from cache, update in background
  • Cache Only: App shell, critical assets bundled at build time
  • Network Only: Real-time data (chat, stock prices) — no caching

Offline Support

  • Offline fallback page: /offline.html served when network unavailable
  • IndexedDB for complex offline data (use idb wrapper)
  • Background sync: Queue failed requests, retry when online (workbox-background-sync)
  • Cache API responses for read-heavy features

Best Practices

  • Precache app shell + critical routes at install time
  • Runtime cache API responses with TTL
  • Show offline indicator UI when navigator.onLine === false
  • Handle service worker updates: prompt user to refresh
  • Audit with Lighthouse PWA checklist

04 同仓库更多 Skills

ByeongminLee
ByeongminLee/nextjs-claude-code

zustand

Zustand state management guide. Use when working with store code (src/store/**), implementing actions, managing state, or creating slices. Triggers on Zustand store development, state management questions, or action implementation.

★ 3
ByeongminLee
ByeongminLee/nextjs-claude-code

web-vitals

暂无简介

★ 3
ByeongminLee
ByeongminLee/nextjs-claude-code

vercel-storage

Vercel storage expert guidance — Blob, Edge Config, and Marketplace storage (Neon Postgres, Upstash Redis). Use when choosing, configuring, or using data storage with Vercel applications.

后端与接口
★ 3
ByeongminLee
ByeongminLee/nextjs-claude-code

vercel-functions

Vercel Functions expert guidance — Serverless Functions, Edge Functions, Fluid Compute, streaming, Cron Jobs, and runtime configuration. Use when configuring, debugging, or optimizing server-side code running on Vercel.

开发工程师后端与接口
★ 3
ByeongminLee
ByeongminLee/nextjs-claude-code

ui-ux-pro-max

UI/UX design intelligence for web and mobile. Includes 50+ styles, 161 color palettes, 57 font pairings, 161 product types, 99 UX guidelines, and 25 chart types across 10 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui, and HTML/CSS). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, and check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, and mobile app. Elements: button, modal, navbar, sidebar, card, table, form, and chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, and flat design. Topics: color systems, accessibility, animation, layout, typography, font pairing, spacing, interaction states, shadow, and gradient. Integrations: shadcn/ui MCP for component search and examples.

设计师数据分析师前端开发视觉设计
★ 3
ByeongminLee
ByeongminLee/nextjs-claude-code

turborepo

Turborepo monorepo build system guidance. Triggers on: turbo.json, task pipelines, dependsOn, caching, remote cache, the "turbo" CLI, --filter, --affected, CI optimization, environment variables, internal packages, monorepo structure/best practices, and boundaries. Use when user: configures tasks/workflows/pipelines, creates packages, sets up monorepo, shares code between apps, runs changed/affected packages, debugs cache, or has apps/packages directories.

★ 3