[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71H99YNSM3HMM32FFV2Q6C9":3,"skill-same:01M71H99YNSM3HMM32FFV2Q6C9":115},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":48,"commitSha":49,"skillDirectory":50,"forksCount":51,"repositoryHtmlUrl":52,"repositoryHomepageUrl":6,"ownerHtmlUrl":53,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":54,"install":55,"resources":68},"01M71H99YNSM3HMM32FFV2Q6C9","react-server-components-framework",null,"Design and implement React Server Components with Next.js 15 App Router. Master server-first architecture, streaming SSR, Server Actions, and modern data fetching patterns for 2025+ frontend development.","JSGforever\u002Fskillguard","JSGforever","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F85541948?v=4","01M71FQD3E132VMR5F4TAYX3YS","01M71FQD4DYW0XJ4XQ4YQH75Y9",2,"GPL-3.0","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__ariegoldkin--react-server-components-framework\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"Server Components","react","server","framework","react server components framework","react server components","components","ssr","next","router","streaming","data fetching","architecture","ai agent","design","2025","frontend","actions","nextjs","app","2026-11-10 10:12:30",false,"---\nname: react-server-components-framework\ndescription: Design and implement React Server Components with Next.js 15 App Router. Master server-first architecture, streaming SSR, Server Actions, and modern data fetching patterns for 2025+ frontend development.\nversion: 1.0.0\nauthor: AI Agent Hub\ntags: [frontend, react, nextjs, server-components, streaming, 2025]\n---\n\n# React Server Components Framework\n\n## Overview\n\nReact Server Components (RSC) represent a paradigm shift in React architecture, enabling server-first rendering with client-side interactivity. This skill provides comprehensive patterns, templates, and best practices for building modern Next.js 15 applications using the App Router with Server Components, Server Actions, and streaming.\n\n**When to use this skill:**\n- Building Next.js 15+ applications with the App Router\n- Designing component boundaries (Server vs Client Components)\n- Implementing data fetching with caching and revalidation\n- Creating mutations with Server Actions\n- Optimizing performance with streaming and Suspense\n- Implementing Partial Prerendering (PPR)\n- Designing advanced routing patterns (parallel, intercepting routes)\n\n---\n\n## Why React Server Components Matter\n\nRSC fundamentally changes how we think about React applications:\n\n- **Server-First Architecture**: Components render on the server by default, reducing client bundle size\n- **Zero Client Bundle**: Server Components don't ship JavaScript to the client\n- **Direct Backend Access**: Access databases, file systems, and APIs directly from components\n- **Automatic Code Splitting**: Only Client Components and their dependencies are bundled\n- **Streaming & Suspense**: Progressive rendering for instant perceived performance\n- **Type-Safe Data Fetching**: End-to-end TypeScript from database to UI\n- **SEO & Performance**: Server rendering improves Core Web Vitals and SEO\n\n---\n\n## Core Concepts\n\n### 1. Server Components vs Client Components\n\n**Server Components** (default):\n- Can be `async` and use `await`\n- Direct database access\n- Cannot use hooks or browser APIs\n- Zero client JavaScript\n\n**Client Components** (with `'use client'`):\n- Can use hooks (`useState`, `useEffect`, etc.)\n- Browser APIs available\n- Cannot be `async`\n- Ships JavaScript to client\n\n**Key Rule**: Server Components can render Client Components, but Client Components cannot directly import Server Components (use `children` prop instead).\n\n**Detailed Patterns**: See `references\u002Fcomponent-patterns.md` for:\n- Complete component boundary rules\n- Composition patterns\n- Props passing strategies\n- Common pitfalls and solutions\n\n### 2. Data Fetching\n\nNext.js extends the fetch API with powerful caching and revalidation:\n\n```tsx\n\u002F\u002F Static (cached indefinitely)\nawait fetch(url, { cache: 'force-cache' })\n\n\u002F\u002F Revalidate every 60 seconds\nawait fetch(url, { next: { revalidate: 60 } })\n\n\u002F\u002F Always fresh\nawait fetch(url, { cache: 'no-store' })\n\n\u002F\u002F Tag-based revalidation\nawait fetch(url, { next: { tags: ['posts'] } })\n```\n\n**Patterns:**\n- **Parallel fetching**: `Promise.all([fetch1, fetch2, fetch3])`\n- **Sequential fetching**: When data depends on previous results\n- **Route segment config**: Control static\u002Fdynamic rendering\n\n**Detailed Implementation**: See `references\u002Fdata-fetching.md` for:\n- Complete caching strategies\n- Revalidation methods (`revalidatePath`, `revalidateTag`)\n- Database queries in Server Components\n- generateStaticParams for SSG\n- Error handling patterns\n\n### 3. Server Actions\n\nServer Actions enable mutations without API routes:\n\n```tsx\n\u002F\u002F app\u002Factions.ts\n'use server'\n\nexport async function createPost(formData: FormData) {\n  const title = formData.get('title') as string\n  const post = await db.post.create({ data: { title } })\n\n  revalidatePath('\u002Fposts')\n  redirect(`\u002Fposts\u002F${post.id}`)\n}\n```\n\n**Progressive Enhancement**: Forms work without JavaScript, then enhance with client-side states.\n\n**Detailed Implementation**: See `references\u002Fserver-actions.md` for:\n- Progressive enhancement patterns\n- useFormStatus and useFormState hooks\n- Optimistic UI with useOptimistic\n- Validation with Zod\n- Inline vs exported Server Actions\n\n### 4. Streaming with Suspense\n\nStream components independently for better perceived performance:\n\n```tsx\nimport { Suspense } from 'react'\n\nexport default function Dashboard() {\n  return (\n    \u003Cdiv>\n      \u003CSuspense fallback={\u003CChartSkeleton \u002F>}>\n        \u003CRevenueChart \u002F>\n      \u003C\u002FSuspense>\n\n      \u003CSuspense fallback={\u003CInvoicesSkeleton \u002F>}>\n        \u003CLatestInvoices \u002F>\n      \u003C\u002FSuspense>\n    \u003C\u002Fdiv>\n  )\n}\n```\n\n**Benefits**:\n- Show content as it's ready\n- Non-blocking data fetching\n- Better Core Web Vitals\n\n**Templates**: Use `templates\u002FServerComponent.tsx` for streaming patterns\n\n### 5. Advanced Routing\n\n**Parallel Routes**: Render multiple pages simultaneously\n```\napp\u002F\n  @team\u002Fpage.tsx\n  @analytics\u002Fpage.tsx\n  layout.tsx  # Receives both as props\n```\n\n**Intercepting Routes**: Show modals while preserving URLs\n```\napp\u002F\n  photos\u002F[id]\u002Fpage.tsx      # Direct route\n  (..)photos\u002F[id]\u002Fpage.tsx  # Intercepted (modal)\n```\n\n**Partial Prerendering (PPR)**: Mix static and dynamic content\n```tsx\nexport const experimental_ppr = true\n\n\u002F\u002F Static shell + dynamic Suspense boundaries\n```\n\n**Detailed Implementation**: See `references\u002Frouting-patterns.md` for:\n- Parallel routes layout implementation\n- Intercepting routes for modals\n- PPR configuration and patterns\n- Route groups for organization\n- Dynamic, catch-all, and optional catch-all routes\n\n---\n\n## Searching References\n\nUse grep to find specific patterns in references:\n\n```bash\n# Find component patterns\ngrep -r \"Server Component\" references\u002F\n\n# Search for data fetching strategies\ngrep -A 10 \"Caching Strategies\" references\u002Fdata-fetching.md\n\n# Find Server Actions examples\ngrep -B 5 \"Progressive Enhancement\" references\u002Fserver-actions.md\n\n# Locate routing patterns\ngrep -n \"Parallel Routes\" references\u002Frouting-patterns.md\n\n# Search migration guide\ngrep -i \"pages router\\|getServerSideProps\" references\u002Fmigration-guide.md\n```\n\n---\n\n## Best Practices\n\n### Component Boundary Design\n\n- ✅ Keep Client Components at the edges (leaves) of the component tree\n- ✅ Use Server Components by default\n- ✅ Extract minimal interactive parts to Client Components\n- ✅ Pass Server Components as `children` to Client Components\n- ❌ Avoid making entire pages Client Components\n\n### Data Fetching\n\n- ✅ Fetch data in Server Components close to where it's used\n- ✅ Use parallel fetching for independent data\n- ✅ Set appropriate cache and revalidate options\n- ✅ Use `generateStaticParams` for static routes\n- ❌ Don't fetch data in Client Components with useEffect (use Server Components)\n\n### Performance\n\n- ✅ Use Suspense boundaries for streaming\n- ✅ Implement loading.tsx for instant loading states\n- ✅ Enable PPR for static\u002Fdynamic mix\n- ✅ Optimize images with next\u002Fimage\n- ✅ Use route segment config to control rendering mode\n\n### Error Handling\n\n- ✅ Implement error.tsx for error boundaries\n- ✅ Use not-found.tsx for 404 pages\n- ✅ Handle fetch errors gracefully\n- ✅ Validate Server Action inputs\n\n---\n\n## Templates\n\nUse provided templates for common patterns:\n\n- **`templates\u002FServerComponent.tsx`** - Basic async Server Component with data fetching\n- **`templates\u002FClientComponent.tsx`** - Interactive Client Component with hooks\n- **`templates\u002FServerAction.tsx`** - Server Action with validation and revalidation\n\n---\n\n## Examples\n\n### Complete Blog App\n\nSee `examples\u002Fblog-app\u002F` for a full implementation:\n- Server Components for post listing and details\n- Client Components for comments and likes\n- Server Actions for creating\u002Fediting posts\n- Streaming with Suspense\n- Parallel routes for dashboard\n\n---\n\n## Checklists\n\n### RSC Implementation Checklist\n\nSee `checklists\u002Frsc-implementation.md` for comprehensive validation covering:\n- [ ] Component boundaries properly defined (Server vs Client)\n- [ ] Data fetching with appropriate caching strategy\n- [ ] Server Actions for mutations\n- [ ] Streaming with Suspense for slow components\n- [ ] Error handling (error.tsx, not-found.tsx)\n- [ ] Loading states (loading.tsx)\n- [ ] Metadata API for SEO\n- [ ] Route segment config optimized\n\n---\n\n## Common Patterns\n\n### Search with URL State\n\n```tsx\n\u002F\u002F app\u002Fsearch\u002Fpage.tsx\nexport default async function SearchPage({\n  searchParams,\n}: {\n  searchParams: { q?: string }\n}) {\n  const query = searchParams.q || ''\n  const results = query ? await searchProducts(query) : []\n\n  return (\n    \u003Cdiv>\n      \u003CSearchForm initialQuery={query} \u002F>\n      \u003CSearchResults results={results} \u002F>\n    \u003C\u002Fdiv>\n  )\n}\n```\n\n### Authentication\n\n```tsx\nimport { cookies } from 'next\u002Fheaders'\n\nexport default async function DashboardPage() {\n  const token = cookies().get('token')?.value\n  const user = await verifyToken(token)\n\n  if (!user) {\n    redirect('\u002Flogin')\n  }\n\n  return \u003CDashboard user={user} \u002F>\n}\n```\n\n### Optimistic UI\n\n```tsx\n'use client'\n\nimport { useOptimistic } from 'react'\n\nexport function TodoList({ todos }) {\n  const [optimisticTodos, addOptimisticTodo] = useOptimistic(\n    todos,\n    (state, newTodo) => [...state, newTodo]\n  )\n\n  return \u003Cul>{\u002F* render optimisticTodos *\u002F}\u003C\u002Ful>\n}\n```\n\n---\n\n## Migration from Pages Router\n\n**Incremental Adoption**: Both `pages\u002F` and `app\u002F` can coexist\n\n**Key Changes**:\n- `getServerSideProps` → async Server Component\n- `getStaticProps` → async Server Component with caching\n- API routes → Server Actions\n- `_app.tsx` → `layout.tsx`\n- `\u003CHead>` → `generateMetadata` function\n\n**Detailed Migration**: See `references\u002Fmigration-guide.md` for:\n- Step-by-step migration guide\n- Before\u002Fafter code examples\n- Common migration pitfalls\n- Layout and metadata migration patterns\n\n---\n\n## Troubleshooting\n\n**Error: \"You're importing a component that needs useState\"**\n- **Fix**: Add `'use client'` directive to the component\n\n**Error: \"async\u002Fawait is not valid in non-async Server Components\"**\n- **Fix**: Add `async` to function declaration\n\n**Error: \"Cannot use Server Component inside Client Component\"**\n- **Fix**: Pass Server Component as `children` prop instead of importing\n\n**Error: \"Hydration mismatch\"**\n- **Fix**: Use `'use client'` for components using `Date.now()`, `Math.random()`, or browser APIs\n\n---\n\n## Resources\n\n- [Next.js 15 Documentation](https:\u002F\u002Fnextjs.org\u002Fdocs)\n- [React Server Components RFC](https:\u002F\u002Fgithub.com\u002Freactjs\u002Frfcs\u002Fblob\u002Fmain\u002Ftext\u002F0188-server-components.md)\n- [App Router Migration Guide](https:\u002F\u002Fnextjs.org\u002Fdocs\u002Fapp\u002Fbuilding-your-application\u002Fupgrading\u002Fapp-router-migration)\n- [Server Actions Documentation](https:\u002F\u002Fnextjs.org\u002Fdocs\u002Fapp\u002Fbuilding-your-application\u002Fdata-fetching\u002Fserver-actions-and-mutations)\n\n---\n\n## Next Steps\n\nAfter mastering React Server Components:\n1. Explore **Streaming API Patterns** skill for real-time data\n2. Use **Type Safety & Validation** skill for tRPC integration\n3. Apply **Edge Computing Patterns** skill for global deployment\n4. Reference **Performance Optimization** skill for Core Web Vitals\n","# React Server Components Framework\n\n## Overview\n\nReact Server Components (RSC) represent a paradigm shift in React architecture, enabling server-first rendering with client-side interactivity. This skill provides comprehensive patterns, templates, and best practices for building modern Next.js 15 applications using the App Router with Server Components, Server Actions, and streaming.\n\n**When to use this skill:**\n- Building Next.js 15+ applications with the App Router\n- Designing component boundaries (Server vs Client Components)\n- Implementing data fetching with caching and revalidation\n- Creating mutations with Server Actions\n- Optimizing performance with streaming and Suspense\n- Implementing Partial Prerendering (PPR)\n- Designing advanced routing patterns (parallel, intercepting routes)\n\n---\n\n## Why React Server Components Matter\n\nRSC fundamentally changes how we think about React applications:\n\n- **Server-First Architecture**: Components render on the server by default, reducing client bundle size\n- **Zero Client Bundle**: Server Components don't ship JavaScript to the client\n- **Direct Backend Access**: Access databases, file systems, and APIs directly from components\n- **Automatic Code Splitting**: Only Client Components and their dependencies are bundled\n- **Streaming & Suspense**: Progressive rendering for instant perceived performance\n- **Type-Safe Data Fetching**: End-to-end TypeScript from database to UI\n- **SEO & Performance**: Server rendering improves Core Web Vitals and SEO\n\n---\n\n## Core Concepts\n\n### 1. Server Components vs Client Components\n\n**Server Components** (default):\n- Can be `async` and use `await`\n- Direct database access\n- Cannot use hooks or browser APIs\n- Zero client JavaScript\n\n**Client Components** (with `'use client'`):\n- Can use hooks (`useState`, `useEffect`, etc.)\n- Browser APIs available\n- Cannot be `async`\n- Ships JavaScript to client\n\n**Key Rule**: Server Components can render Client Components, but Client Components cannot directly import Server Components (use `children` prop instead).\n\n**Detailed Patterns**: See `references\u002Fcomponent-patterns.md` for:\n- Complete component boundary rules\n- Composition patterns\n- Props passing strategies\n- Common pitfalls and solutions\n\n### 2. Data Fetching\n\nNext.js extends the fetch API with powerful caching and revalidation:\n\n```tsx\n\u002F\u002F Static (cached indefinitely)\nawait fetch(url, { cache: 'force-cache' })\n\n\u002F\u002F Revalidate every 60 seconds\nawait fetch(url, { next: { revalidate: 60 } })\n\n\u002F\u002F Always fresh\nawait fetch(url, { cache: 'no-store' })\n\n\u002F\u002F Tag-based revalidation\nawait fetch(url, { next: { tags: ['posts'] } })\n```\n\n**Patterns:**\n- **Parallel fetching**: `Promise.all([fetch1, fetch2, fetch3])`\n- **Sequential fetching**: When data depends on previous results\n- **Route segment config**: Control static\u002Fdynamic rendering\n\n**Detailed Implementation**: See `references\u002Fdata-fetching.md` for:\n- Complete caching strategies\n- Revalidation methods (`revalidatePath`, `revalidateTag`)\n- Database queries in Server Components\n- generateStaticParams for SSG\n- Error handling patterns\n\n### 3. Server Actions\n\nServer Actions enable mutations without API routes:\n\n```tsx\n\u002F\u002F app\u002Factions.ts\n'use server'\n\nexport async function createPost(formData: FormData) {\n  const title = formData.get('title') as string\n  const post = await db.post.create({ data: { title } })\n\n  revalidatePath('\u002Fposts')\n  redirect(`\u002Fposts\u002F${post.id}`)\n}\n```\n\n**Progressive Enhancement**: Forms work without JavaScript, then enhance with client-side states.\n\n**Detailed Implementation**: See `references\u002Fserver-actions.md` for:\n- Progressive enhancement patterns\n- useFormStatus and useFormState hooks\n- Optimistic UI with useOptimistic\n- Validation with Zod\n- Inline vs exported Server Actions\n\n### 4. Streaming with Suspense\n\nStream components independently for better perceived performance:\n\n```tsx\nimport { Suspense } from 'react'\n\nexport default function Dashboard() {\n  return (\n    \u003Cdiv>\n      \u003CSuspense fallback={\u003CChartSkeleton \u002F>}>\n        \u003CRevenueChart \u002F>\n      \u003C\u002FSuspense>\n\n      \u003CSuspense fallback={\u003CInvoicesSkeleton \u002F>}>\n        \u003CLatestInvoices \u002F>\n      \u003C\u002FSuspense>\n    \u003C\u002Fdiv>\n  )\n}\n```\n\n**Benefits**:\n- Show content as it's ready\n- Non-blocking data fetching\n- Better Core Web Vitals\n\n**Templates**: Use `templates\u002FServerComponent.tsx` for streaming patterns\n\n### 5. Advanced Routing\n\n**Parallel Routes**: Render multiple pages simultaneously\n```\napp\u002F\n  @team\u002Fpage.tsx\n  @analytics\u002Fpage.tsx\n  layout.tsx  # Receives both as props\n```\n\n**Intercepting Routes**: Show modals while preserving URLs\n```\napp\u002F\n  photos\u002F[id]\u002Fpage.tsx      # Direct route\n  (..)photos\u002F[id]\u002Fpage.tsx  # Intercepted (modal)\n```\n\n**Partial Prerendering (PPR)**: Mix static and dynamic content\n```tsx\nexport const experimental_ppr = true\n\n\u002F\u002F Static shell + dynamic Suspense boundaries\n```\n\n**Detailed Implementation**: See `references\u002Frouting-patterns.md` for:\n- Parallel routes layout implementation\n- Intercepting routes for modals\n- PPR configuration and patterns\n- Route groups for organization\n- Dynamic, catch-all, and optional catch-all routes\n\n---\n\n## Searching References\n\nUse grep to find specific patterns in references:\n\n```bash\n# Find component patterns\ngrep -r \"Server Component\" references\u002F\n\n# Search for data fetching strategies\ngrep -A 10 \"Caching Strategies\" references\u002Fdata-fetching.md\n\n# Find Server Actions examples\ngrep -B 5 \"Progressive Enhancement\" references\u002Fserver-actions.md\n\n# Locate routing patterns\ngrep -n \"Parallel Routes\" references\u002Frouting-patterns.md\n\n# Search migration guide\ngrep -i \"pages router\\|getServerSideProps\" references\u002Fmigration-guide.md\n```\n\n---\n\n## Best Practices\n\n### Component Boundary Design\n\n- ✅ Keep Client Components at the edges (leaves) of the component tree\n- ✅ Use Server Components by default\n- ✅ Extract minimal interactive parts to Client Components\n- ✅ Pass Server Components as `children` to Client Components\n- ❌ Avoid making entire pages Client Components\n\n### Data Fetching\n\n- ✅ Fetch data in Server Components close to where it's used\n- ✅ Use parallel fetching for independent data\n- ✅ Set appropriate cache and revalidate options\n- ✅ Use `generateStaticParams` for static routes\n- ❌ Don't fetch data in Client Components with useEffect (use Server Components)\n\n### Performance\n\n- ✅ Use Suspense boundaries for streaming\n- ✅ Implement loading.tsx for instant loading states\n- ✅ Enable PPR for static\u002Fdynamic mix\n- ✅ Optimize images with next\u002Fimage\n- ✅ Use route segment config to control rendering mode\n\n### Error Handling\n\n- ✅ Implement error.tsx for error boundaries\n- ✅ Use not-found.tsx for 404 pages\n- ✅ Handle fetch errors gracefully\n- ✅ Validate Server Action inputs\n\n---\n\n## Templates\n\nUse provided templates for common patterns:\n\n- **`templates\u002FServerComponent.tsx`** - Basic async Server Component with data fetching\n- **`templates\u002FClientComponent.tsx`** - Interactive Client Component with hooks\n- **`templates\u002FServerAction.tsx`** - Server Action with validation and revalidation\n\n---\n\n## Examples\n\n### Complete Blog App\n\nSee `examples\u002Fblog-app\u002F` for a full implementation:\n- Server Components for post listing and details\n- Client Components for comments and likes\n- Server Actions for creating\u002Fediting posts\n- Streaming with Suspense\n- Parallel routes for dashboard\n\n---\n\n## Checklists\n\n### RSC Implementation Checklist\n\nSee `checklists\u002Frsc-implementation.md` for comprehensive validation covering:\n- [ ] Component boundaries properly defined (Server vs Client)\n- [ ] Data fetching with appropriate caching strategy\n- [ ] Server Actions for mutations\n- [ ] Streaming with Suspense for slow components\n- [ ] Error handling (error.tsx, not-found.tsx)\n- [ ] Loading states (loading.tsx)\n- [ ] Metadata API for SEO\n- [ ] Route segment config optimized\n\n---\n\n## Common Patterns\n\n### Search with URL State\n\n```tsx\n\u002F\u002F app\u002Fsearch\u002Fpage.tsx\nexport default async function SearchPage({\n  searchParams,\n}: {\n  searchParams: { q?: string }\n}) {\n  const query = searchParams.q || ''\n  const results = query ? await searchProducts(query) : []\n\n  return (\n    \u003Cdiv>\n      \u003CSearchForm initialQuery={query} \u002F>\n      \u003CSearchResults results={results} \u002F>\n    \u003C\u002Fdiv>\n  )\n}\n```\n\n### Authentication\n\n```tsx\nimport { cookies } from 'next\u002Fheaders'\n\nexport default async function DashboardPage() {\n  const token = cookies().get('token')?.value\n  const user = await verifyToken(token)\n\n  if (!user) {\n    redirect('\u002Flogin')\n  }\n\n  return \u003CDashboard user={user} \u002F>\n}\n```\n\n### Optimistic UI\n\n```tsx\n'use client'\n\nimport { useOptimistic } from 'react'\n\nexport function TodoList({ todos }) {\n  const [optimisticTodos, addOptimisticTodo] = useOptimistic(\n    todos,\n    (state, newTodo) => [...state, newTodo]\n  )\n\n  return \u003Cul>{\u002F* render optimisticTodos *\u002F}\u003C\u002Ful>\n}\n```\n\n---\n\n## Migration from Pages Router\n\n**Incremental Adoption**: Both `pages\u002F` and `app\u002F` can coexist\n\n**Key Changes**:\n- `getServerSideProps` → async Server Component\n- `getStaticProps` → async Server Component with caching\n- API routes → Server Actions\n- `_app.tsx` → `layout.tsx`\n- `\u003CHead>` → `generateMetadata` function\n\n**Detailed Migration**: See `references\u002Fmigration-guide.md` for:\n- Step-by-step migration guide\n- Before\u002Fafter code examples\n- Common migration pitfalls\n- Layout and metadata migration patterns\n\n---\n\n## Troubleshooting\n\n**Error: \"You're importing a component that needs useState\"**\n- **Fix**: Add `'use client'` directive to the component\n\n**Error: \"async\u002Fawait is not valid in non-async Server Components\"**\n- **Fix**: Add `async` to function declaration\n\n**Error: \"Cannot use Server Component inside Client Component\"**\n- **Fix**: Pass Server Component as `children` prop instead of importing\n\n**Error: \"Hydration mismatch\"**\n- **Fix**: Use `'use client'` for components using `Date.now()`, `Math.random()`, or browser APIs\n\n---\n\n## Resources\n\n- [Next.js 15 Documentation](https:\u002F\u002Fnextjs.org\u002Fdocs)\n- [React Server Components RFC](https:\u002F\u002Fgithub.com\u002Freactjs\u002Frfcs\u002Fblob\u002Fmain\u002Ftext\u002F0188-server-components.md)\n- [App Router Migration Guide](https:\u002F\u002Fnextjs.org\u002Fdocs\u002Fapp\u002Fbuilding-your-application\u002Fupgrading\u002Fapp-router-migration)\n- [Server Actions Documentation](https:\u002F\u002Fnextjs.org\u002Fdocs\u002Fapp\u002Fbuilding-your-application\u002Fdata-fetching\u002Fserver-actions-and-mutations)\n\n---\n\n## Next Steps\n\nAfter mastering React Server Components:\n1. Explore **Streaming API Patterns** skill for real-time data\n2. Use **Type Safety & Validation** skill for tRPC integration\n3. Apply **Edge Computing Patterns** skill for global deployment\n4. Reference **Performance Optimization** skill for Core Web Vitals\n",{"name":5,"tags":43,"author":46,"version":47,"description":7},[34,19,36,44,28,45],"server-components",2025,"AI Agent Hub","1.0.0","main","f2ec4b3b9133d34eeaf9b38e4b0a97e8e5705a7f","benchmarks\u002Ffinal\u002Fskills\u002Fasset1__ariegoldkin--react-server-components-framework",0,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard","https:\u002F\u002Fgithub.com\u002FJSGforever","2026-08-29 18:27:56",{"source":8,"skillName":5,"commands":56,"prompt":66,"zipAvailable":67},[57,60,63],{"tool":58,"command":59},"npx","npx skills add JSGforever\u002Fskillguard --skill react-server-components-framework",{"tool":61,"command":62},"bunx","bunx skills add JSGforever\u002Fskillguard --skill react-server-components-framework",{"tool":64,"command":65},"pnpm","pnpm dlx skills add JSGforever\u002Fskillguard --skill react-server-components-framework","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__ariegoldkin--react-server-components-framework\u002FSKILL.md",true,[69,75,81,85,89,93,97,101,105,111],{"path":70,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":73,"sourceHtmlUrl":74},"checklists\u002Frsc-implementation-checklist.md","REFERENCE","参考文档",9651,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__ariegoldkin--react-server-components-framework\u002Fchecklists\u002Frsc-implementation-checklist.md",{"path":76,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":79,"sourceHtmlUrl":80},"examples\u002Fblog-app-example.tsx","OTHER","其他",12034,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__ariegoldkin--react-server-components-framework\u002Fexamples\u002Fblog-app-example.tsx",{"path":82,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":83,"sourceHtmlUrl":84},"references\u002Fcomponent-patterns.md",9725,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__ariegoldkin--react-server-components-framework\u002Freferences\u002Fcomponent-patterns.md",{"path":86,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":87,"sourceHtmlUrl":88},"references\u002Fdata-fetching.md",3249,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__ariegoldkin--react-server-components-framework\u002Freferences\u002Fdata-fetching.md",{"path":90,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":91,"sourceHtmlUrl":92},"references\u002Fmigration-guide.md",3523,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__ariegoldkin--react-server-components-framework\u002Freferences\u002Fmigration-guide.md",{"path":94,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":95,"sourceHtmlUrl":96},"references\u002Frouting-patterns.md",3343,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__ariegoldkin--react-server-components-framework\u002Freferences\u002Frouting-patterns.md",{"path":98,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":99,"sourceHtmlUrl":100},"references\u002Fserver-actions.md",4046,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__ariegoldkin--react-server-components-framework\u002Freferences\u002Fserver-actions.md",{"path":102,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":103,"sourceHtmlUrl":104},"templates\u002Fclient-component-template.tsx",2078,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__ariegoldkin--react-server-components-framework\u002Ftemplates\u002Fclient-component-template.tsx",{"path":106,"resourceType":107,"resourceTypeDesc":108,"sizeBytes":109,"sourceHtmlUrl":110},"templates\u002Fserver-action-template.ts","SCRIPT","脚本",6083,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__ariegoldkin--react-server-components-framework\u002Ftemplates\u002Fserver-action-template.ts",{"path":112,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":113,"sourceHtmlUrl":114},"templates\u002Fserver-component-template.tsx",1928,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__ariegoldkin--react-server-components-framework\u002Ftemplates\u002Fserver-component-template.tsx",[116,143,154,179,194,213],{"skillNo":117,"name":118,"nameZh":6,"description":119,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":38},"01M71HY2SNXBA9Q00WZDTZQ31Z","skillguard-codex-scanner","Hybrid deterministic+LLM agent-skill security scanner. Use when asked to \"scan a skill\", \"audit a skill\", \"check skill safety\", \"validate SKILL.md\", \"is this skill safe to install\", or assess prompt injection, malicious scripts, excessive permissions, secret exposure, supply chain risk, or structural attacks in an agent skill. Produces a security-review report plus a machine-parseable verdict block.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fsrc\u002Fskillguard\u002Fstatic_scanner\u002Fskillguard-codex-scanner\u002FSKILL.md",[],[123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142],"scanner","skillguard codex scanner","skillguard","codex","chain","skill security","security-review","review report","structural","secret","prompt injection","security scanner","when","review","malicious","permissions","exposure","audit","scripts","safe",{"skillNo":144,"name":145,"nameZh":6,"description":146,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":147,"licenseFileUrl":6,"sourceHtmlUrl":148,"categories":149,"keywords":150,"publishedAt":38},"01M71HY0SPKTT3S27BC2HPAC5M","data-exfiltrator","Analyzes data files","MIT","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Fsmoke-one-skill\u002Fasset1__cisco-ai-defense--data-exfiltrator\u002FSKILL.md",[],[151,152,153],"data","data exfiltrator","files",{"skillNo":155,"name":156,"nameZh":6,"description":157,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":158,"categories":159,"keywords":160,"publishedAt":38},"01M71HXVS9EMN44BGDW215FZ72","real-time-collaboration-engine","Build real-time collaborative editing with WebSockets, OT\u002FCRDT conflict resolution, and presence awareness. Implements cursor tracking, optimistic updates, and offline sync. Use for collaborative editors, whiteboards, video editing. Activate on \"real-time collaboration\", \"WebSocket sync\", \"multiplayer editing\", \"CRDT\", \"presence awareness\". NOT for simple chat, request-response APIs, or single-user apps.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__curiositech--real-time-collaboration-engine\u002FSKILL.md",[],[161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,19,28],"time","real time collaboration engine","real time collaboration","collaboration","engine","real time","Video","reliability","video editing","performance","conflict resolution","presence","access","apps","updates","Bash","activate","optimizer",{"skillNo":180,"name":181,"nameZh":6,"description":182,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":183,"categories":184,"keywords":185,"publishedAt":38},"01M71HXP6CTY4KFN0QVMMN0V7J","react-performance-optimizer","Optimize React apps for 60fps performance. Implements memoization, virtualization, code splitting, bundle optimization. Use for slow renders, large lists, bundle bloat. Activate on \"React performance\", \"slow render\", \"useMemo\", \"bundle size\", \"virtualization\". NOT for backend optimization, non-React frameworks, or premature optimization.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__curiositech--react-performance-optimizer\u002FSKILL.md",[],[170,186,178,19,187,188,37,36,189,190,161,191,33,174,176,192,177,28,27,193],"react performance optimizer","react performance","performance optimizer","expert","re","render","code","strategies",{"skillNo":195,"name":196,"nameZh":6,"description":197,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":198,"categories":199,"keywords":200,"publishedAt":38},"01M71HXH7QXSQB4QTDZ7SP7YXQ","llm-streaming-response-handler","Build production LLM streaming UIs with Server-Sent Events, real-time token display, cancellation, error recovery. Handles OpenAI\u002FAnthropic\u002FClaude streaming APIs. Use for chatbots, AI assistants, real-time text generation. Activate on \"LLM streaming\", \"SSE\", \"token stream\", \"chat UI\", \"real-time AI\". NOT for batch processing, non-streaming APIs, or WebSocket bidirectional chat.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__curiositech--llm-streaming-response-handler\u002FSKILL.md",[],[201,28,202,203,204,205,170,161,206,207,208,176,177,178,209,19,210,211,20,212],"llm streaming response handler","handler","error","processing","retry","chat ui","error recovery","critical","batch","display","text","read",{"skillNo":214,"name":215,"nameZh":6,"description":216,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":217,"categories":218,"keywords":219,"publishedAt":38},"01M71HXCB0E1YRKYW1Y8T0Y106","github-actions-pipeline-builder","Build production CI\u002FCD pipelines with GitHub Actions. Implements matrix builds, caching, deployments, testing, security scanning. Use for automated testing, deployments, release workflows. Activate on \"GitHub Actions\", \"CI\u002FCD\", \"workflow\", \"deployment pipeline\", \"automated testing\". NOT for Jenkins\u002FCircleCI, manual deployments, or non-GitHub repositories.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__curiositech--github-actions-pipeline-builder\u002FSKILL.md",[],[220,35,221,222,223,224,225,168,189,226,227,228,177,193,229,212,230,231,232,233],"github actions pipeline builder","github actions","pipeline builder","github","builder","pipeline","testing","ci","workflows","run","release","write","edit","git"]