[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M714HD0JGGAS9VWH91FG5494":3,"skill-same:01M714HD0JGGAS9VWH91FG5494":99},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":51,"commitSha":52,"skillDirectory":53,"forksCount":14,"repositoryHtmlUrl":54,"repositoryHomepageUrl":6,"ownerHtmlUrl":55,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":56,"install":57,"resources":70},"01M714HD0JGGAS9VWH91FG5494","senior-frontend",null,"Frontend development skill for React, Next.js, TypeScript, and Tailwind CSS applications. Use when building React components, optimizing Next.js performance, analyzing bundle sizes, scaffolding frontend projects, implementing accessibility, or reviewing frontend code quality.","sapsapshen\u002Fai-memory-router","sapsapshen","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F20347959?v=4","01M6XDQEF1DP50DKF37H81J3J5","shenmian","01M6XDQEJPE41Y3DT2763X8ZJN",0,"MIT","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcopilot\u002Fsenior-frontend\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000009","前端开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"frontend","senior","senior frontend","2026","when","implementing","claude-skills","scaffolding","next","projects","Tailwind","analyzing","code","react components","react","components","performance","typescript","safe","css","2026-11-10 10:12:30",false,"---\nname: senior-frontend\ndescription: Frontend development skill for React, Next.js, TypeScript, and Tailwind CSS applications. Use when building React components, optimizing Next.js performance, analyzing bundle sizes, scaffolding frontend projects, implementing accessibility, or reviewing frontend code quality.\nrisk: safe\nsource: https:\u002F\u002Fgithub.com\u002Falirezarezvani\u002Fclaude-skills\ndate_added: \"2026-03-07\"\n---\n\n# Senior Frontend\n\nFrontend development patterns, performance optimization, and automation tools for React\u002FNext.js applications.\n\n## When to Use\n- Use when scaffolding a new React or Next.js project with TypeScript and Tailwind CSS.\n- Use when generating new components or custom hooks.\n- Use when analyzing and optimizing bundle sizes for frontend applications.\n- Use to implement or review advanced React patterns like Compound Components or Render Props.\n- Use to ensure accessibility compliance and implement robust testing strategies.\n\n## Table of Contents\n\n- [Project Scaffolding](#project-scaffolding)\n- [Component Generation](#component-generation)\n- [Bundle Analysis](#bundle-analysis)\n- [React Patterns](#react-patterns)\n- [Next.js Optimization](#nextjs-optimization)\n- [Accessibility and Testing](#accessibility-and-testing)\n\n---\n\n## Project Scaffolding\n\nGenerate a new Next.js or React project with TypeScript, Tailwind CSS, and best practice configurations.\n\n### Workflow: Create New Frontend Project\n\n1. Run the scaffolder with your project name and template:\n\n   ```bash\n   python scripts\u002Ffrontend_scaffolder.py my-app --template nextjs\n   ```\n\n2. Add optional features (auth, api, forms, testing, storybook):\n\n   ```bash\n   python scripts\u002Ffrontend_scaffolder.py dashboard --template nextjs --features auth,api\n   ```\n\n3. Navigate to the project and install dependencies:\n\n   ```bash\n   cd my-app && npm install\n   ```\n\n4. Start the development server:\n   ```bash\n   npm run dev\n   ```\n\n### Scaffolder Options\n\n| Option               | Description                                       |\n| -------------------- | ------------------------------------------------- |\n| `--template nextjs`  | Next.js 14+ with App Router and Server Components |\n| `--template react`   | React + Vite with TypeScript                      |\n| `--features auth`    | Add NextAuth.js authentication                    |\n| `--features api`     | Add React Query + API client                      |\n| `--features forms`   | Add React Hook Form + Zod validation              |\n| `--features testing` | Add Vitest + Testing Library                      |\n| `--dry-run`          | Preview files without creating them               |\n\n### Generated Structure (Next.js)\n\n```\nmy-app\u002F\n├── app\u002F\n│   ├── layout.tsx        # Root layout with fonts\n│   ├── page.tsx          # Home page\n│   ├── globals.css       # Tailwind + CSS variables\n│   └── api\u002Fhealth\u002Froute.ts\n├── components\u002F\n│   ├── ui\u002F               # Button, Input, Card\n│   └── layout\u002F           # Header, Footer, Sidebar\n├── hooks\u002F                # useDebounce, useLocalStorage\n├── lib\u002F                  # utils (cn), constants\n├── types\u002F                # TypeScript interfaces\n├── tailwind.config.ts\n├── next.config.js\n└── package.json\n```\n\n---\n\n## Component Generation\n\nGenerate React components with TypeScript, tests, and Storybook stories.\n\n### Workflow: Create a New Component\n\n1. Generate a client component:\n\n   ```bash\n   python scripts\u002Fcomponent_generator.py Button --dir src\u002Fcomponents\u002Fui\n   ```\n\n2. Generate a server component:\n\n   ```bash\n   python scripts\u002Fcomponent_generator.py ProductCard --type server\n   ```\n\n3. Generate with test and story files:\n\n   ```bash\n   python scripts\u002Fcomponent_generator.py UserProfile --with-test --with-story\n   ```\n\n4. Generate a custom hook:\n   ```bash\n   python scripts\u002Fcomponent_generator.py FormValidation --type hook\n   ```\n\n### Generator Options\n\n| Option          | Description                                  |\n| --------------- | -------------------------------------------- |\n| `--type client` | Client component with 'use client' (default) |\n| `--type server` | Async server component                       |\n| `--type hook`   | Custom React hook                            |\n| `--with-test`   | Include test file                            |\n| `--with-story`  | Include Storybook story                      |\n| `--flat`        | Create in output dir without subdirectory    |\n| `--dry-run`     | Preview without creating files               |\n\n### Generated Component Example\n\n```tsx\n\"use client\";\n\nimport { useState } from \"react\";\nimport { cn } from \"@\u002Flib\u002Futils\";\n\ninterface ButtonProps {\n  className?: string;\n  children?: React.ReactNode;\n}\n\nexport function Button({ className, children }: ButtonProps) {\n  return \u003Cdiv className={cn(\"\", className)}>{children}\u003C\u002Fdiv>;\n}\n```\n\n---\n\n## Bundle Analysis\n\nAnalyze package.json and project structure for bundle optimization opportunities.\n\n### Workflow: Optimize Bundle Size\n\n1. Run the analyzer on your project:\n\n   ```bash\n   python scripts\u002Fbundle_analyzer.py \u002Fpath\u002Fto\u002Fproject\n   ```\n\n2. Review the health score and issues:\n\n   ```\n   Bundle Health Score: 75\u002F100 (C)\n\n   HEAVY DEPENDENCIES:\n     moment (290KB)\n       Alternative: date-fns (12KB) or dayjs (2KB)\n\n     lodash (71KB)\n       Alternative: lodash-es with tree-shaking\n   ```\n\n3. Apply the recommended fixes by replacing heavy dependencies.\n\n4. Re-run with verbose mode to check import patterns:\n   ```bash\n   python scripts\u002Fbundle_analyzer.py . --verbose\n   ```\n\n### Bundle Score Interpretation\n\n| Score  | Grade | Action                         |\n| ------ | ----- | ------------------------------ |\n| 90-100 | A     | Bundle is well-optimized       |\n| 80-89  | B     | Minor optimizations available  |\n| 70-79  | C     | Replace heavy dependencies     |\n| 60-69  | D     | Multiple issues need attention |\n| 0-59   | F     | Critical bundle size problems  |\n\n### Heavy Dependencies Detected\n\nThe analyzer identifies these common heavy packages:\n\n| Package       | Size  | Alternative                    |\n| ------------- | ----- | ------------------------------ |\n| moment        | 290KB | date-fns (12KB) or dayjs (2KB) |\n| lodash        | 71KB  | lodash-es with tree-shaking    |\n| axios         | 14KB  | Native fetch or ky (3KB)       |\n| jquery        | 87KB  | Native DOM APIs                |\n| @mui\u002Fmaterial | Large | shadcn\u002Fui or Radix UI          |\n\n---\n\n## React Patterns\n\nReference: `references\u002Freact_patterns.md`\n\n### Compound Components\n\nShare state between related components:\n\n```tsx\nconst Tabs = ({ children }) => {\n  const [active, setActive] = useState(0);\n  return (\n    \u003CTabsContext.Provider value={{ active, setActive }}>\n      {children}\n    \u003C\u002FTabsContext.Provider>\n  );\n};\n\nTabs.List = TabList;\nTabs.Panel = TabPanel;\n\n\u002F\u002F Usage\n\u003CTabs>\n  \u003CTabs.List>\n    \u003CTabs.Tab>One\u003C\u002FTabs.Tab>\n    \u003CTabs.Tab>Two\u003C\u002FTabs.Tab>\n  \u003C\u002FTabs.List>\n  \u003CTabs.Panel>Content 1\u003C\u002FTabs.Panel>\n  \u003CTabs.Panel>Content 2\u003C\u002FTabs.Panel>\n\u003C\u002FTabs>;\n```\n\n### Custom Hooks\n\nExtract reusable logic:\n\n```tsx\nfunction useDebounce\u003CT>(value: T, delay = 500): T {\n  const [debouncedValue, setDebouncedValue] = useState(value);\n\n  useEffect(() => {\n    const timer = setTimeout(() => setDebouncedValue(value), delay);\n    return () => clearTimeout(timer);\n  }, [value, delay]);\n\n  return debouncedValue;\n}\n\n\u002F\u002F Usage\nconst debouncedSearch = useDebounce(searchTerm, 300);\n```\n\n### Render Props\n\nShare rendering logic:\n\n```tsx\nfunction DataFetcher({ url, render }) {\n  const [data, setData] = useState(null);\n  const [loading, setLoading] = useState(true);\n\n  useEffect(() => {\n    fetch(url)\n      .then((r) => r.json())\n      .then(setData)\n      .finally(() => setLoading(false));\n  }, [url]);\n\n  return render({ data, loading });\n}\n\n\u002F\u002F Usage\n\u003CDataFetcher\n  url=\"\u002Fapi\u002Fusers\"\n  render={({ data, loading }) =>\n    loading ? \u003CSpinner \u002F> : \u003CUserList users={data} \u002F>\n  }\n\u002F>;\n```\n\n---\n\n## Next.js Optimization\n\nReference: `references\u002Fnextjs_optimization_guide.md`\n\n### Server vs Client Components\n\nUse Server Components by default. Add 'use client' only when you need:\n\n- Event handlers (onClick, onChange)\n- State (useState, useReducer)\n- Effects (useEffect)\n- Browser APIs\n\n```tsx\n\u002F\u002F Server Component (default) - no 'use client'\nasync function ProductPage({ params }) {\n  const product = await getProduct(params.id); \u002F\u002F Server-side fetch\n\n  return (\n    \u003Cdiv>\n      \u003Ch1>{product.name}\u003C\u002Fh1>\n      \u003CAddToCartButton productId={product.id} \u002F> {\u002F* Client component *\u002F}\n    \u003C\u002Fdiv>\n  );\n}\n\n\u002F\u002F Client Component\n(\"use client\");\nfunction AddToCartButton({ productId }) {\n  const [adding, setAdding] = useState(false);\n  return \u003Cbutton onClick={() => addToCart(productId)}>Add\u003C\u002Fbutton>;\n}\n```\n\n### Image Optimization\n\n```tsx\nimport Image from 'next\u002Fimage';\n\n\u002F\u002F Above the fold - load immediately\n\u003CImage\n  src=\"\u002Fhero.jpg\"\n  alt=\"Hero\"\n  width={1200}\n  height={600}\n  priority\n\u002F>\n\n\u002F\u002F Responsive image with fill\n\u003Cdiv className=\"relative aspect-video\">\n  \u003CImage\n    src=\"\u002Fproduct.jpg\"\n    alt=\"Product\"\n    fill\n    sizes=\"(max-width: 768px) 100vw, 50vw\"\n    className=\"object-cover\"\n  \u002F>\n\u003C\u002Fdiv>\n```\n\n### Data Fetching Patterns\n\n```tsx\n\u002F\u002F Parallel fetching\nasync function Dashboard() {\n  const [user, stats] = await Promise.all([getUser(), getStats()]);\n  return \u003Cdiv>...\u003C\u002Fdiv>;\n}\n\n\u002F\u002F Streaming with Suspense\nasync function ProductPage({ params }) {\n  return (\n    \u003Cdiv>\n      \u003CProductDetails id={params.id} \u002F>\n      \u003CSuspense fallback={\u003CReviewsSkeleton \u002F>}>\n        \u003CReviews productId={params.id} \u002F>\n      \u003C\u002FSuspense>\n    \u003C\u002Fdiv>\n  );\n}\n```\n\n---\n\n## Accessibility and Testing\n\nReference: `references\u002Ffrontend_best_practices.md`\n\n### Accessibility Checklist\n\n1. **Semantic HTML**: Use proper elements (`\u003Cbutton>`, `\u003Cnav>`, `\u003Cmain>`)\n2. **Keyboard Navigation**: All interactive elements focusable\n3. **ARIA Labels**: Provide labels for icons and complex widgets\n4. **Color Contrast**: Minimum 4.5:1 for normal text\n5. **Focus Indicators**: Visible focus states\n\n```tsx\n\u002F\u002F Accessible button\n\u003Cbutton\n  type=\"button\"\n  aria-label=\"Close dialog\"\n  onClick={onClose}\n  className=\"focus-visible:ring-2 focus-visible:ring-blue-500\"\n>\n  \u003CXIcon aria-hidden=\"true\" \u002F>\n\u003C\u002Fbutton>\n\n\u002F\u002F Skip link for keyboard users\n\u003Ca href=\"#main-content\" className=\"sr-only focus:not-sr-only\">\n  Skip to main content\n\u003C\u002Fa>\n```\n\n### Testing Strategy\n\n```tsx\n\u002F\u002F Component test with React Testing Library\nimport { render, screen } from \"@testing-library\u002Freact\";\nimport userEvent from \"@testing-library\u002Fuser-event\";\n\ntest(\"button triggers action on click\", async () => {\n  const onClick = vi.fn();\n  render(\u003CButton onClick={onClick}>Click me\u003C\u002FButton>);\n\n  await userEvent.click(screen.getByRole(\"button\"));\n  expect(onClick).toHaveBeenCalledTimes(1);\n});\n\n\u002F\u002F Test accessibility\ntest(\"dialog is accessible\", async () => {\n  render(\u003CDialog open={true} title=\"Confirm\" \u002F>);\n\n  expect(screen.getByRole(\"dialog\")).toBeInTheDocument();\n  expect(screen.getByRole(\"dialog\")).toHaveAttribute(\"aria-labelledby\");\n});\n```\n\n---\n\n## Quick Reference\n\n### Common Next.js Config\n\n```js\n\u002F\u002F next.config.js\nconst nextConfig = {\n  images: {\n    remotePatterns: [{ hostname: \"cdn.example.com\" }],\n    formats: [\"image\u002Favif\", \"image\u002Fwebp\"],\n  },\n  experimental: {\n    optimizePackageImports: [\"lucide-react\", \"@heroicons\u002Freact\"],\n  },\n};\n```\n\n### Tailwind CSS Utilities\n\n```tsx\n\u002F\u002F Conditional classes with cn()\nimport { cn } from \"@\u002Flib\u002Futils\";\n\n\u003Cbutton\n  className={cn(\n    \"px-4 py-2 rounded\",\n    variant === \"primary\" && \"bg-blue-500 text-white\",\n    disabled && \"opacity-50 cursor-not-allowed\",\n  )}\n\u002F>;\n```\n\n### TypeScript Patterns\n\n```tsx\n\u002F\u002F Props with children\ninterface CardProps {\n  className?: string;\n  children: React.ReactNode;\n}\n\n\u002F\u002F Generic component\ninterface ListProps\u003CT> {\n  items: T[];\n  renderItem: (item: T) => React.ReactNode;\n}\n\nfunction List\u003CT>({ items, renderItem }: ListProps\u003CT>) {\n  return \u003Cul>{items.map(renderItem)}\u003C\u002Ful>;\n}\n```\n\n---\n\n## Resources\n\n- React Patterns: `references\u002Freact_patterns.md`\n- Next.js Optimization: `references\u002Fnextjs_optimization_guide.md`\n- Best Practices: `references\u002Ffrontend_best_practices.md`\n","# Senior Frontend\n\nFrontend development patterns, performance optimization, and automation tools for React\u002FNext.js applications.\n\n## When to Use\n- Use when scaffolding a new React or Next.js project with TypeScript and Tailwind CSS.\n- Use when generating new components or custom hooks.\n- Use when analyzing and optimizing bundle sizes for frontend applications.\n- Use to implement or review advanced React patterns like Compound Components or Render Props.\n- Use to ensure accessibility compliance and implement robust testing strategies.\n\n## Table of Contents\n\n- [Project Scaffolding](#project-scaffolding)\n- [Component Generation](#component-generation)\n- [Bundle Analysis](#bundle-analysis)\n- [React Patterns](#react-patterns)\n- [Next.js Optimization](#nextjs-optimization)\n- [Accessibility and Testing](#accessibility-and-testing)\n\n---\n\n## Project Scaffolding\n\nGenerate a new Next.js or React project with TypeScript, Tailwind CSS, and best practice configurations.\n\n### Workflow: Create New Frontend Project\n\n1. Run the scaffolder with your project name and template:\n\n   ```bash\n   python scripts\u002Ffrontend_scaffolder.py my-app --template nextjs\n   ```\n\n2. Add optional features (auth, api, forms, testing, storybook):\n\n   ```bash\n   python scripts\u002Ffrontend_scaffolder.py dashboard --template nextjs --features auth,api\n   ```\n\n3. Navigate to the project and install dependencies:\n\n   ```bash\n   cd my-app && npm install\n   ```\n\n4. Start the development server:\n   ```bash\n   npm run dev\n   ```\n\n### Scaffolder Options\n\n| Option               | Description                                       |\n| -------------------- | ------------------------------------------------- |\n| `--template nextjs`  | Next.js 14+ with App Router and Server Components |\n| `--template react`   | React + Vite with TypeScript                      |\n| `--features auth`    | Add NextAuth.js authentication                    |\n| `--features api`     | Add React Query + API client                      |\n| `--features forms`   | Add React Hook Form + Zod validation              |\n| `--features testing` | Add Vitest + Testing Library                      |\n| `--dry-run`          | Preview files without creating them               |\n\n### Generated Structure (Next.js)\n\n```\nmy-app\u002F\n├── app\u002F\n│   ├── layout.tsx        # Root layout with fonts\n│   ├── page.tsx          # Home page\n│   ├── globals.css       # Tailwind + CSS variables\n│   └── api\u002Fhealth\u002Froute.ts\n├── components\u002F\n│   ├── ui\u002F               # Button, Input, Card\n│   └── layout\u002F           # Header, Footer, Sidebar\n├── hooks\u002F                # useDebounce, useLocalStorage\n├── lib\u002F                  # utils (cn), constants\n├── types\u002F                # TypeScript interfaces\n├── tailwind.config.ts\n├── next.config.js\n└── package.json\n```\n\n---\n\n## Component Generation\n\nGenerate React components with TypeScript, tests, and Storybook stories.\n\n### Workflow: Create a New Component\n\n1. Generate a client component:\n\n   ```bash\n   python scripts\u002Fcomponent_generator.py Button --dir src\u002Fcomponents\u002Fui\n   ```\n\n2. Generate a server component:\n\n   ```bash\n   python scripts\u002Fcomponent_generator.py ProductCard --type server\n   ```\n\n3. Generate with test and story files:\n\n   ```bash\n   python scripts\u002Fcomponent_generator.py UserProfile --with-test --with-story\n   ```\n\n4. Generate a custom hook:\n   ```bash\n   python scripts\u002Fcomponent_generator.py FormValidation --type hook\n   ```\n\n### Generator Options\n\n| Option          | Description                                  |\n| --------------- | -------------------------------------------- |\n| `--type client` | Client component with 'use client' (default) |\n| `--type server` | Async server component                       |\n| `--type hook`   | Custom React hook                            |\n| `--with-test`   | Include test file                            |\n| `--with-story`  | Include Storybook story                      |\n| `--flat`        | Create in output dir without subdirectory    |\n| `--dry-run`     | Preview without creating files               |\n\n### Generated Component Example\n\n```tsx\n\"use client\";\n\nimport { useState } from \"react\";\nimport { cn } from \"@\u002Flib\u002Futils\";\n\ninterface ButtonProps {\n  className?: string;\n  children?: React.ReactNode;\n}\n\nexport function Button({ className, children }: ButtonProps) {\n  return \u003Cdiv className={cn(\"\", className)}>{children}\u003C\u002Fdiv>;\n}\n```\n\n---\n\n## Bundle Analysis\n\nAnalyze package.json and project structure for bundle optimization opportunities.\n\n### Workflow: Optimize Bundle Size\n\n1. Run the analyzer on your project:\n\n   ```bash\n   python scripts\u002Fbundle_analyzer.py \u002Fpath\u002Fto\u002Fproject\n   ```\n\n2. Review the health score and issues:\n\n   ```\n   Bundle Health Score: 75\u002F100 (C)\n\n   HEAVY DEPENDENCIES:\n     moment (290KB)\n       Alternative: date-fns (12KB) or dayjs (2KB)\n\n     lodash (71KB)\n       Alternative: lodash-es with tree-shaking\n   ```\n\n3. Apply the recommended fixes by replacing heavy dependencies.\n\n4. Re-run with verbose mode to check import patterns:\n   ```bash\n   python scripts\u002Fbundle_analyzer.py . --verbose\n   ```\n\n### Bundle Score Interpretation\n\n| Score  | Grade | Action                         |\n| ------ | ----- | ------------------------------ |\n| 90-100 | A     | Bundle is well-optimized       |\n| 80-89  | B     | Minor optimizations available  |\n| 70-79  | C     | Replace heavy dependencies     |\n| 60-69  | D     | Multiple issues need attention |\n| 0-59   | F     | Critical bundle size problems  |\n\n### Heavy Dependencies Detected\n\nThe analyzer identifies these common heavy packages:\n\n| Package       | Size  | Alternative                    |\n| ------------- | ----- | ------------------------------ |\n| moment        | 290KB | date-fns (12KB) or dayjs (2KB) |\n| lodash        | 71KB  | lodash-es with tree-shaking    |\n| axios         | 14KB  | Native fetch or ky (3KB)       |\n| jquery        | 87KB  | Native DOM APIs                |\n| @mui\u002Fmaterial | Large | shadcn\u002Fui or Radix UI          |\n\n---\n\n## React Patterns\n\nReference: `references\u002Freact_patterns.md`\n\n### Compound Components\n\nShare state between related components:\n\n```tsx\nconst Tabs = ({ children }) => {\n  const [active, setActive] = useState(0);\n  return (\n    \u003CTabsContext.Provider value={{ active, setActive }}>\n      {children}\n    \u003C\u002FTabsContext.Provider>\n  );\n};\n\nTabs.List = TabList;\nTabs.Panel = TabPanel;\n\n\u002F\u002F Usage\n\u003CTabs>\n  \u003CTabs.List>\n    \u003CTabs.Tab>One\u003C\u002FTabs.Tab>\n    \u003CTabs.Tab>Two\u003C\u002FTabs.Tab>\n  \u003C\u002FTabs.List>\n  \u003CTabs.Panel>Content 1\u003C\u002FTabs.Panel>\n  \u003CTabs.Panel>Content 2\u003C\u002FTabs.Panel>\n\u003C\u002FTabs>;\n```\n\n### Custom Hooks\n\nExtract reusable logic:\n\n```tsx\nfunction useDebounce\u003CT>(value: T, delay = 500): T {\n  const [debouncedValue, setDebouncedValue] = useState(value);\n\n  useEffect(() => {\n    const timer = setTimeout(() => setDebouncedValue(value), delay);\n    return () => clearTimeout(timer);\n  }, [value, delay]);\n\n  return debouncedValue;\n}\n\n\u002F\u002F Usage\nconst debouncedSearch = useDebounce(searchTerm, 300);\n```\n\n### Render Props\n\nShare rendering logic:\n\n```tsx\nfunction DataFetcher({ url, render }) {\n  const [data, setData] = useState(null);\n  const [loading, setLoading] = useState(true);\n\n  useEffect(() => {\n    fetch(url)\n      .then((r) => r.json())\n      .then(setData)\n      .finally(() => setLoading(false));\n  }, [url]);\n\n  return render({ data, loading });\n}\n\n\u002F\u002F Usage\n\u003CDataFetcher\n  url=\"\u002Fapi\u002Fusers\"\n  render={({ data, loading }) =>\n    loading ? \u003CSpinner \u002F> : \u003CUserList users={data} \u002F>\n  }\n\u002F>;\n```\n\n---\n\n## Next.js Optimization\n\nReference: `references\u002Fnextjs_optimization_guide.md`\n\n### Server vs Client Components\n\nUse Server Components by default. Add 'use client' only when you need:\n\n- Event handlers (onClick, onChange)\n- State (useState, useReducer)\n- Effects (useEffect)\n- Browser APIs\n\n```tsx\n\u002F\u002F Server Component (default) - no 'use client'\nasync function ProductPage({ params }) {\n  const product = await getProduct(params.id); \u002F\u002F Server-side fetch\n\n  return (\n    \u003Cdiv>\n      \u003Ch1>{product.name}\u003C\u002Fh1>\n      \u003CAddToCartButton productId={product.id} \u002F> {\u002F* Client component *\u002F}\n    \u003C\u002Fdiv>\n  );\n}\n\n\u002F\u002F Client Component\n(\"use client\");\nfunction AddToCartButton({ productId }) {\n  const [adding, setAdding] = useState(false);\n  return \u003Cbutton onClick={() => addToCart(productId)}>Add\u003C\u002Fbutton>;\n}\n```\n\n### Image Optimization\n\n```tsx\nimport Image from 'next\u002Fimage';\n\n\u002F\u002F Above the fold - load immediately\n\u003CImage\n  src=\"\u002Fhero.jpg\"\n  alt=\"Hero\"\n  width={1200}\n  height={600}\n  priority\n\u002F>\n\n\u002F\u002F Responsive image with fill\n\u003Cdiv className=\"relative aspect-video\">\n  \u003CImage\n    src=\"\u002Fproduct.jpg\"\n    alt=\"Product\"\n    fill\n    sizes=\"(max-width: 768px) 100vw, 50vw\"\n    className=\"object-cover\"\n  \u002F>\n\u003C\u002Fdiv>\n```\n\n### Data Fetching Patterns\n\n```tsx\n\u002F\u002F Parallel fetching\nasync function Dashboard() {\n  const [user, stats] = await Promise.all([getUser(), getStats()]);\n  return \u003Cdiv>...\u003C\u002Fdiv>;\n}\n\n\u002F\u002F Streaming with Suspense\nasync function ProductPage({ params }) {\n  return (\n    \u003Cdiv>\n      \u003CProductDetails id={params.id} \u002F>\n      \u003CSuspense fallback={\u003CReviewsSkeleton \u002F>}>\n        \u003CReviews productId={params.id} \u002F>\n      \u003C\u002FSuspense>\n    \u003C\u002Fdiv>\n  );\n}\n```\n\n---\n\n## Accessibility and Testing\n\nReference: `references\u002Ffrontend_best_practices.md`\n\n### Accessibility Checklist\n\n1. **Semantic HTML**: Use proper elements (`\u003Cbutton>`, `\u003Cnav>`, `\u003Cmain>`)\n2. **Keyboard Navigation**: All interactive elements focusable\n3. **ARIA Labels**: Provide labels for icons and complex widgets\n4. **Color Contrast**: Minimum 4.5:1 for normal text\n5. **Focus Indicators**: Visible focus states\n\n```tsx\n\u002F\u002F Accessible button\n\u003Cbutton\n  type=\"button\"\n  aria-label=\"Close dialog\"\n  onClick={onClose}\n  className=\"focus-visible:ring-2 focus-visible:ring-blue-500\"\n>\n  \u003CXIcon aria-hidden=\"true\" \u002F>\n\u003C\u002Fbutton>\n\n\u002F\u002F Skip link for keyboard users\n\u003Ca href=\"#main-content\" className=\"sr-only focus:not-sr-only\">\n  Skip to main content\n\u003C\u002Fa>\n```\n\n### Testing Strategy\n\n```tsx\n\u002F\u002F Component test with React Testing Library\nimport { render, screen } from \"@testing-library\u002Freact\";\nimport userEvent from \"@testing-library\u002Fuser-event\";\n\ntest(\"button triggers action on click\", async () => {\n  const onClick = vi.fn();\n  render(\u003CButton onClick={onClick}>Click me\u003C\u002FButton>);\n\n  await userEvent.click(screen.getByRole(\"button\"));\n  expect(onClick).toHaveBeenCalledTimes(1);\n});\n\n\u002F\u002F Test accessibility\ntest(\"dialog is accessible\", async () => {\n  render(\u003CDialog open={true} title=\"Confirm\" \u002F>);\n\n  expect(screen.getByRole(\"dialog\")).toBeInTheDocument();\n  expect(screen.getByRole(\"dialog\")).toHaveAttribute(\"aria-labelledby\");\n});\n```\n\n---\n\n## Quick Reference\n\n### Common Next.js Config\n\n```js\n\u002F\u002F next.config.js\nconst nextConfig = {\n  images: {\n    remotePatterns: [{ hostname: \"cdn.example.com\" }],\n    formats: [\"image\u002Favif\", \"image\u002Fwebp\"],\n  },\n  experimental: {\n    optimizePackageImports: [\"lucide-react\", \"@heroicons\u002Freact\"],\n  },\n};\n```\n\n### Tailwind CSS Utilities\n\n```tsx\n\u002F\u002F Conditional classes with cn()\nimport { cn } from \"@\u002Flib\u002Futils\";\n\n\u003Cbutton\n  className={cn(\n    \"px-4 py-2 rounded\",\n    variant === \"primary\" && \"bg-blue-500 text-white\",\n    disabled && \"opacity-50 cursor-not-allowed\",\n  )}\n\u002F>;\n```\n\n### TypeScript Patterns\n\n```tsx\n\u002F\u002F Props with children\ninterface CardProps {\n  className?: string;\n  children: React.ReactNode;\n}\n\n\u002F\u002F Generic component\ninterface ListProps\u003CT> {\n  items: T[];\n  renderItem: (item: T) => React.ReactNode;\n}\n\nfunction List\u003CT>({ items, renderItem }: ListProps\u003CT>) {\n  return \u003Cul>{items.map(renderItem)}\u003C\u002Ful>;\n}\n```\n\n---\n\n## Resources\n\n- React Patterns: `references\u002Freact_patterns.md`\n- Next.js Optimization: `references\u002Fnextjs_optimization_guide.md`\n- Best Practices: `references\u002Ffrontend_best_practices.md`\n",{"name":5,"risk":42,"source":49,"date_added":50,"description":7},"https:\u002F\u002Fgithub.com\u002Falirezarezvani\u002Fclaude-skills","2026-03-07","main","7a38d8e7073e61c16eda85681cb32fb68a8657a5","skills-store\u002Fcopilot\u002Fsenior-frontend","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router","https:\u002F\u002Fgithub.com\u002Fsapsapshen","2026-04-14 21:12:12",{"source":8,"skillName":5,"commands":58,"prompt":68,"zipAvailable":69},[59,62,65],{"tool":60,"command":61},"npx","npx skills add sapsapshen\u002Fai-memory-router --skill senior-frontend",{"tool":63,"command":64},"bunx","bunx skills add sapsapshen\u002Fai-memory-router --skill senior-frontend",{"tool":66,"command":67},"pnpm","pnpm dlx skills add sapsapshen\u002Fai-memory-router --skill senior-frontend","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcopilot\u002Fsenior-frontend\u002FSKILL.md",true,[71,77,81,85,91,95],{"path":72,"resourceType":73,"resourceTypeDesc":74,"sizeBytes":75,"sourceHtmlUrl":76},"references\u002Ffrontend_best_practices.md","REFERENCE","参考文档",19783,"https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcopilot\u002Fsenior-frontend\u002Freferences\u002Ffrontend_best_practices.md",{"path":78,"resourceType":73,"resourceTypeDesc":74,"sizeBytes":79,"sourceHtmlUrl":80},"references\u002Fnextjs_optimization_guide.md",15123,"https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcopilot\u002Fsenior-frontend\u002Freferences\u002Fnextjs_optimization_guide.md",{"path":82,"resourceType":73,"resourceTypeDesc":74,"sizeBytes":83,"sourceHtmlUrl":84},"references\u002Freact_patterns.md",17341,"https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcopilot\u002Fsenior-frontend\u002Freferences\u002Freact_patterns.md",{"path":86,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":89,"sourceHtmlUrl":90},"scripts\u002Fbundle_analyzer.py","SCRIPT","脚本",13339,"https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcopilot\u002Fsenior-frontend\u002Fscripts\u002Fbundle_analyzer.py",{"path":92,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":93,"sourceHtmlUrl":94},"scripts\u002Fcomponent_generator.py",8684,"https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcopilot\u002Fsenior-frontend\u002Fscripts\u002Fcomponent_generator.py",{"path":96,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":97,"sourceHtmlUrl":98},"scripts\u002Ffrontend_scaffolder.py",27981,"https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcopilot\u002Fsenior-frontend\u002Fscripts\u002Ffrontend_scaffolder.py",[100,124,149,159,172,189],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":111,"publishedAt":44},"01M71ATQRKG48SH06FQ697T5G9","wechat-search","Search WeChat Official Account articles using OpenClaw's web search and fetch capabilities with compliance-focused design.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fopenclaw\u002Fwechat-search-release\u002FSKILL.md",[106],{"categoryNo":107,"categoryName":108,"taxonomyType":109,"taxonomyTypeDesc":110},"01JBSEEDCAT000000000000037","律师与法务","PROFESSION","适用职业",[112,113,114,115,116,117,118,119,120,121,122,123],"wechat search","wechat","search","capabilities","openclaw","design","web search","compliance","web","official","fetch","with",{"skillNo":125,"name":126,"nameZh":6,"description":127,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":128,"categories":129,"keywords":130,"publishedAt":44},"01M71ATNAVGZB35PFYM2GC5N00","trend-tap","Real-time trending topics aggregator across 7 platforms (X\u002FTwitter, Reddit, Google Trends, Hacker News, Zhihu, Bilibili, Weibo). Trigger: when user says 'trend', 'trends', 'trend tap', '热点', '热搜', or asks what is trending\u002Fhot. Do NOT use web_search — this skill already fetches live data from all platforms with zero API keys.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fopenclaw\u002Ftrend-tap\u002FSKILL.md",[],[131,132,133,134,135,136,114,137,138,139,140,28,141,142,143,144,145,146,147,148],"trend","trend tap","tap","api keys","Bash","time","trending","hacker","aggregator","do","brew","live","data","google","install","read","across","api",{"skillNo":150,"name":151,"nameZh":6,"description":152,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":155,"publishedAt":44},"01M71ATJ9AM5KM15AA8PS302EB","trend-radar","Real-time trending topics aggregator across 7 platforms (X\u002FTwitter, Reddit, Google Trends, Hacker News, Zhihu, Bilibili, Weibo). Trigger: when user says 'trend', 'trends', 'trend pulse', '热点', '热搜', or asks what is trending\u002Fhot. Do NOT use web_search — this skill already fetches live data from all platforms with zero API keys.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fopenclaw\u002Ftrend-radar\u002FSKILL.md",[],[156,157,131,141,142,143,144,135,114,146,158,147,148,28,139,138,137,145,136,134],"trend radar","radar","pulse",{"skillNo":160,"name":161,"nameZh":6,"description":162,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":163,"categories":164,"keywords":165,"publishedAt":44},"01M71ATGF095N3EJM9G8SD0BB5","tech-news-daily","每日科技新闻汇——从全球多个 RSS 源抓取最新科技新闻，翻译（英→中）、去重、排版成每日简报。当用户询问科技新闻、科技新鲜事、每日科技、技术动态、Daily Tech News 或类似表达时触发此技能。","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fopenclaw\u002Ftech-news-daily\u002FSKILL.md",[],[166,167,168,169,170,171],"news","tech","tech news daily","daily","rss","翻译",{"skillNo":173,"name":174,"nameZh":6,"description":175,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":176,"categories":177,"keywords":181,"publishedAt":44},"01M71ATFAEAMQ17M70NQNY7SR8","summarize","Summarize URLs or files with the summarize CLI (web, PDFs, images, audio, YouTube).","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fopenclaw\u002Fsummarize\u002FSKILL.md",[178],{"categoryNo":179,"categoryName":180,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000021","资料检索与研究",[174,120,182,183,184,123,141,185,186,187,133,188,145],"Audio","cli","youtube","images","https","files","pdfs",{"skillNo":190,"name":191,"nameZh":6,"description":192,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":193,"categories":194,"keywords":195,"publishedAt":44},"01M71ATDNS3R0M4H936PACQAWZ","sonoscli","Control Sonos speakers (discover\u002Fstatus\u002Fplay\u002Fvolume\u002Fgroup).","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fopenclaw\u002Fsonoscli\u002FSKILL.md",[],[191,196,197,198,145,199,186,200,201,202,203,204],"status","play","go","latest","github","discover","control","cmd","volume"]