[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F0VJK7WN3M9NEW9RJFVSZ0":3,"skill-same:01M7F0VJK7WN3M9NEW9RJFVSZ0":53},{"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":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":14,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7F0VJK7WN3M9NEW9RJFVSZ0","nextjs-app-router-patterns",null,"Master the Next.js 16 App Router with Server Components, Cache Components, streaming, parallel routes, and Server Actions. Use when building Next.js applications, implementing SSR\u002FSSG, or optimizing React Server Components.","shotcowboystyle\u002Fag-skills","shotcowboystyle","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F62471?v=4","01M7EZTCFCZJ6K3MYW8BPM4X6R","Curtis Blanton","01M7EZTCG1S5M04J90A931X9BX",0,"MIT","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ffrontend-mobile-development\u002Fskills\u002Fnextjs-app-router-patterns\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: nextjs-app-router-patterns\ndescription: Master the Next.js 16 App Router with Server Components, Cache Components, streaming, parallel routes, and Server Actions. Use when building Next.js applications, implementing SSR\u002FSSG, or optimizing React Server Components.\nlast_verified: 2026-10-27\n---\n\n# Next.js App Router Patterns\n\nComprehensive patterns for Next.js 16 App Router architecture, Cache Components, Server Components, and modern full-stack React development.\n\n## When to Use This Skill\n\n- Building new Next.js applications with App Router\n- Migrating from Pages Router to App Router\n- Implementing Server Components and streaming\n- Setting up parallel and intercepting routes\n- Optimizing data fetching and caching\n- Building full-stack features with Server Actions\n\n## Core Concepts\n\n### 1. Rendering Modes\n\n| Mode                  | Where        | When to Use                               |\n| --------------------- | ------------ | ----------------------------------------- |\n| **Server Components** | Server only  | Data fetching, heavy computation, secrets |\n| **Client Components** | Browser      | Interactivity, hooks, browser APIs        |\n| **Static shell**      | Build time   | Sync markup, imports, pure computation    |\n| **Cached**            | Server cache | Shared data that tolerates staleness      |\n| **Dynamic**           | Request time | `cookies()`\u002F`headers()`, per-user data    |\n| **Streaming**         | Progressive  | Large pages, slow data sources            |\n\n### 2. File Conventions\n\n```\napp\u002F\n├── layout.tsx       # Shared UI wrapper\n├── page.tsx         # Route UI\n├── loading.tsx      # Loading UI (Suspense)\n├── error.tsx        # Error boundary\n├── not-found.tsx    # 404 UI\n├── route.ts         # API endpoint\n├── template.tsx     # Re-mounted layout\n├── default.tsx      # Parallel route fallback\n└── opengraph-image.tsx  # OG image generation\n```\n\n## Quick Start\n\n```typescript\n\u002F\u002F app\u002Flayout.tsx\nimport { Inter } from 'next\u002Ffont\u002Fgoogle'\nimport { Providers } from '.\u002Fproviders'\n\nconst inter = Inter({ subsets: ['latin'] })\n\nexport const metadata = {\n  title: { default: 'My App', template: '%s | My App' },\n  description: 'Built with Next.js App Router',\n}\n\nexport default function RootLayout({\n  children,\n}: {\n  children: React.ReactNode\n}) {\n  return (\n    \u003Chtml lang=\"en\" suppressHydrationWarning>\n      \u003Cbody className={inter.className}>\n        \u003CProviders>{children}\u003C\u002FProviders>\n      \u003C\u002Fbody>\n    \u003C\u002Fhtml>\n  )\n}\n\n\u002F\u002F next.config.ts - opt in to Cache Components (Next.js 16+)\nimport type { NextConfig } from 'next'\n\nconst nextConfig: NextConfig = { cacheComponents: true }\nexport default nextConfig\n\n\u002F\u002F app\u002Fpage.tsx - Server Component by default\nimport { cacheLife, cacheTag } from 'next\u002Fcache'\n\nasync function getProducts() {\n  'use cache'\n  cacheLife('hours') \u002F\u002F fetch() is uncached by default since Next.js 15\n  cacheTag('products')\n  const res = await fetch('https:\u002F\u002Fapi.example.com\u002Fproducts')\n  return res.json()\n}\n\nexport default async function HomePage() {\n  const products = await getProducts()\n\n  return (\n    \u003Cmain>\n      \u003Ch1>Products\u003C\u002Fh1>\n      \u003CProductGrid products={products} \u002F>\n    \u003C\u002Fmain>\n  )\n}\n```\n\n## Detailed patterns and worked examples\n\nDetailed pattern documentation lives in `references\u002Fdetails.md`. Read that file when the navigation tier above is insufficient.\n\n## Best Practices\n\n### Do's\n\n- **Start with Server Components** - Add 'use client' only when needed\n- **Colocate data fetching** - Fetch data where it's used\n- **Use Suspense boundaries** - Enable streaming for slow data\n- **Leverage parallel routes** - Independent loading states\n- **Use Server Actions** - For mutations with progressive enhancement; call `updateTag()` for read-your-writes\n- **Cache explicitly** - Mark shared data with `'use cache'` + `cacheLife()`\u002F`cacheTag()`; nothing is cached implicitly\n\n### Don'ts\n\n- **Don't pass non-serializable props to Client Components** - functions, class instances and Symbols cannot cross the Server → Client boundary (Server Actions are the exception)\n- **Don't use hooks in Server Components** - No useState, useEffect\n- **Don't fetch initial data in Client Components** - Fetch in Server Components; use TanStack Query only for client-driven refetching\n- **Don't over-nest layouts** - Each layout adds to the component tree\n- **Don't ignore loading states** - Always provide loading.tsx or Suspense\n","# Next.js App Router Patterns\n\nComprehensive patterns for Next.js 16 App Router architecture, Cache Components, Server Components, and modern full-stack React development.\n\n## When to Use This Skill\n\n- Building new Next.js applications with App Router\n- Migrating from Pages Router to App Router\n- Implementing Server Components and streaming\n- Setting up parallel and intercepting routes\n- Optimizing data fetching and caching\n- Building full-stack features with Server Actions\n\n## Core Concepts\n\n### 1. Rendering Modes\n\n| Mode                  | Where        | When to Use                               |\n| --------------------- | ------------ | ----------------------------------------- |\n| **Server Components** | Server only  | Data fetching, heavy computation, secrets |\n| **Client Components** | Browser      | Interactivity, hooks, browser APIs        |\n| **Static shell**      | Build time   | Sync markup, imports, pure computation    |\n| **Cached**            | Server cache | Shared data that tolerates staleness      |\n| **Dynamic**           | Request time | `cookies()`\u002F`headers()`, per-user data    |\n| **Streaming**         | Progressive  | Large pages, slow data sources            |\n\n### 2. File Conventions\n\n```\napp\u002F\n├── layout.tsx       # Shared UI wrapper\n├── page.tsx         # Route UI\n├── loading.tsx      # Loading UI (Suspense)\n├── error.tsx        # Error boundary\n├── not-found.tsx    # 404 UI\n├── route.ts         # API endpoint\n├── template.tsx     # Re-mounted layout\n├── default.tsx      # Parallel route fallback\n└── opengraph-image.tsx  # OG image generation\n```\n\n## Quick Start\n\n```typescript\n\u002F\u002F app\u002Flayout.tsx\nimport { Inter } from 'next\u002Ffont\u002Fgoogle'\nimport { Providers } from '.\u002Fproviders'\n\nconst inter = Inter({ subsets: ['latin'] })\n\nexport const metadata = {\n  title: { default: 'My App', template: '%s | My App' },\n  description: 'Built with Next.js App Router',\n}\n\nexport default function RootLayout({\n  children,\n}: {\n  children: React.ReactNode\n}) {\n  return (\n    \u003Chtml lang=\"en\" suppressHydrationWarning>\n      \u003Cbody className={inter.className}>\n        \u003CProviders>{children}\u003C\u002FProviders>\n      \u003C\u002Fbody>\n    \u003C\u002Fhtml>\n  )\n}\n\n\u002F\u002F next.config.ts - opt in to Cache Components (Next.js 16+)\nimport type { NextConfig } from 'next'\n\nconst nextConfig: NextConfig = { cacheComponents: true }\nexport default nextConfig\n\n\u002F\u002F app\u002Fpage.tsx - Server Component by default\nimport { cacheLife, cacheTag } from 'next\u002Fcache'\n\nasync function getProducts() {\n  'use cache'\n  cacheLife('hours') \u002F\u002F fetch() is uncached by default since Next.js 15\n  cacheTag('products')\n  const res = await fetch('https:\u002F\u002Fapi.example.com\u002Fproducts')\n  return res.json()\n}\n\nexport default async function HomePage() {\n  const products = await getProducts()\n\n  return (\n    \u003Cmain>\n      \u003Ch1>Products\u003C\u002Fh1>\n      \u003CProductGrid products={products} \u002F>\n    \u003C\u002Fmain>\n  )\n}\n```\n\n## Detailed patterns and worked examples\n\nDetailed pattern documentation lives in `references\u002Fdetails.md`. Read that file when the navigation tier above is insufficient.\n\n## Best Practices\n\n### Do's\n\n- **Start with Server Components** - Add 'use client' only when needed\n- **Colocate data fetching** - Fetch data where it's used\n- **Use Suspense boundaries** - Enable streaming for slow data\n- **Leverage parallel routes** - Independent loading states\n- **Use Server Actions** - For mutations with progressive enhancement; call `updateTag()` for read-your-writes\n- **Cache explicitly** - Mark shared data with `'use cache'` + `cacheLife()`\u002F`cacheTag()`; nothing is cached implicitly\n\n### Don'ts\n\n- **Don't pass non-serializable props to Client Components** - functions, class instances and Symbols cannot cross the Server → Client boundary (Server Actions are the exception)\n- **Don't use hooks in Server Components** - No useState, useEffect\n- **Don't fetch initial data in Client Components** - Fetch in Server Components; use TanStack Query only for client-driven refetching\n- **Don't over-nest layouts** - Each layout adds to the component tree\n- **Don't ignore loading states** - Always provide loading.tsx or Suspense\n",{"name":5,"description":7,"last_verified":24},1793059200000,"main","f846d9a97082ff30d613b55a085cef425d822473","plugins\u002Ffrontend-mobile-development\u002Fskills\u002Fnextjs-app-router-patterns","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle","https:\u002F\u002Fshotcowboystyle.github.io","Building smarter with AI, automation & modern tools. Exploring how far one person can go without a big team using today’s AI.","2026-11-10 04:58:27",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add shotcowboystyle\u002Fag-skills --skill nextjs-app-router-patterns",{"tool":39,"command":40},"bunx","bunx skills add shotcowboystyle\u002Fag-skills --skill nextjs-app-router-patterns",{"tool":42,"command":43},"pnpm","pnpm dlx skills add shotcowboystyle\u002Fag-skills --skill nextjs-app-router-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ffrontend-mobile-development\u002Fskills\u002Fnextjs-app-router-patterns\u002FSKILL.md",true,[47],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"references\u002Fdetails.md","REFERENCE","参考文档",12301,"https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ffrontend-mobile-development\u002Fskills\u002Fnextjs-app-router-patterns\u002Freferences\u002Fdetails.md",[54,60,67,74,81,88],{"skillNo":55,"name":56,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7F1YRY5S5QRJ1V0BJS130QX","no-description","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fno-description\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M7F1Y9BV2FJNQJ3NB32JS5CM","good-skill","Fixture skill that satisfies every rule.","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fgood-skill\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M7F1XXBQ3NQRXZSS0KAGAR9V","broken-link","Links to a reference file that does not exist.","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fbroken-link\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M7F1XBX4R46NR9W0HXQ7XCDX","Bad_Name","Name violates the kebab-case rule and does not match the directory.","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fbad-name\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M7F1WNAF8WNEQ7S5HKT5VK0D","skill-authoring","Write, review, and validate portable agent skills in SKILL.md format. Use when creating a new skill, editing an existing one, or asked whether a skill follows the Agent Skills spec.","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Fskills\u002Fskill-authoring\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M7F1W30TC0XFNSF7YBRGETK2","weigh-bags","Record scale readings for each bag — empty (tare), outbound, current, final — and reconcile them against the itemised inventory to find unaccounted weight. Use when the user gives a bag weight, says how heavy something is, weighs their luggage, or asks how close to the limit they are. Appends to bags.yaml and runs scripts\u002Freconcile.py.","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftravel-packing-assistant\u002Fskills\u002Fweigh-bags\u002FSKILL.md",[],[]]