[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CVSBEXTC9HZXZCYAWVFDEC":3,"skill-same:01M7CVSBEXTC9HZXZCYAWVFDEC":106},{"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":73,"commitSha":74,"skillDirectory":75,"forksCount":14,"repositoryHtmlUrl":76,"repositoryHomepageUrl":77,"ownerHtmlUrl":78,"ownerBlogUrl":79,"ownerDescription":80,"updatedAt":81,"install":82,"resources":95},"01M7CVSBEXTC9HZXZCYAWVFDEC","nextjs",null,"Next.js App Router expert guidance. Use when building, debugging, or architecting Next.js applications â€” routing, Server Components, Server Actions, Cache Components, layouts, middleware\u002Fproxy, data fetching, rendering strategies, and deployment on Vercel.","realsudarshan\u002FSD-skill","realsudarshan","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128029723?v=4","01M7CTP2JEKQ9KBJ51NRZ2777Z","Sudarshan Dhakal","01M7CTP2JYR2PRY3BWGA30HX7J",0,"MIT","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Fofficial-openai\u002Fopenai-local-vercel-nextjs\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: nextjs\ndescription: Next.js App Router expert guidance. Use when building, debugging, or architecting Next.js applications â€” routing, Server Components, Server Actions, Cache Components, layouts, middleware\u002Fproxy, data fetching, rendering strategies, and deployment on Vercel.\nmetadata:\n  priority: 5\n  docs:\n    - \"https:\u002F\u002Fnextjs.org\u002Fdocs\"\n    - \"https:\u002F\u002Fnextjs.org\u002Fdocs\u002Fapp\"\n  sitemap: \"https:\u002F\u002Fnextjs.org\u002Fsitemap.xml\"\n  pathPatterns:\n    - 'next.config.*'\n    - 'next-env.d.ts'\n    - 'app\u002F**'\n    - 'pages\u002F**'\n    - 'src\u002Fapp\u002F**'\n    - 'src\u002Fpages\u002F**'\n    - 'tailwind.config.*'\n    - 'postcss.config.*'\n    - 'tsconfig.json'\n    - 'tsconfig.*.json'\n    - 'apps\u002F*\u002Fapp\u002F**'\n    - 'apps\u002F*\u002Fpages\u002F**'\n    - 'apps\u002F*\u002Fsrc\u002Fapp\u002F**'\n    - 'apps\u002F*\u002Fsrc\u002Fpages\u002F**'\n    - 'apps\u002F*\u002Fnext.config.*'\n  bashPatterns:\n    - '\\bnext\\s+(dev|build|start|lint)\\b'\n    - '\\bnext\\s+experimental-analyze\\b'\n    - '\\bnpx\\s+create-next-app\\b'\n    - '\\bbunx\\s+create-next-app\\b'\n    - '\\bnpm\\s+run\\s+(dev|build|start)\\b'\n    - '\\bpnpm\\s+(dev|build)\\b'\n    - '\\bbun\\s+run\\s+(dev|build)\\b'\n  promptSignals:\n    phrases:\n      - \"next.js\"\n      - \"nextjs\"\n      - \"app router\"\n      - \"server component\"\n      - \"server action\"\n    allOf:\n      - [middleware, next]\n      - [layout, route]\n    anyOf:\n      - \"pages router\"\n      - \"getserversideprops\"\n      - \"use server\"\n    noneOf: []\n    minScore: 6\n---\n\n# Next.js (v16+) â€” App Router\n\nYou are an expert in Next.js 16 with the App Router. Always prefer the App Router over the legacy Pages Router unless the user's project explicitly uses Pages Router.\n\n## Critical Pattern: Lazy Initialization for Build-Safe Modules\n\nNever initialize database clients (Neon, Drizzle), Redis (Upstash), or service SDKs (Resend, Slack) at module scope.\n\nDuring `next build`, static generation can evaluate modules before runtime env vars are present, which causes startup crashes. Always initialize these clients lazily inside getter functions.\n\n```ts\nimport { drizzle } from 'drizzle-orm\u002Fneon-http'\nimport { neon } from '@neondatabase\u002Fserverless'\n\nlet _db: ReturnType\u003Ctypeof drizzle> | null = null\n\nexport function getDb() {\n  if (!_db) _db = drizzle(neon(process.env.DATABASE_URL!))\n  return _db\n}\n```\n\nApply the same lazy singleton pattern to Redis and SDK clients (`getRedis()`, `getResend()`, `getSlackClient()`) instead of creating them at import time.\n\n## Scaffolding\n\nWhen running `create-next-app`, **always** pass `--yes` to skip interactive prompts (React Compiler, import alias) that hang in non-interactive shells:\n\n```bash\nnpx create-next-app@latest my-app --yes --typescript --tailwind --eslint --app --src-dir --import-alias \"@\u002F*\" --turbopack --use-npm\n```\n\n**If the target directory contains ANY non-Next.js files** (`.git\u002F`, config files, etc.), you **MUST** add `--force`. Without it, `create-next-app` will fail with \"The directory contains files that could conflict\" and block scaffolding. **Check the directory first** â€” if it has anything in it, use `--force`:\n\n```bash\nnpx create-next-app@latest . --yes --force --typescript --tailwind --eslint --app --src-dir --import-alias \"@\u002F*\" --turbopack --use-npm\n```\n\n### Geist Font Fix (Tailwind v4 + shadcn)\n\n`shadcn init` rewrites `globals.css` with `--font-sans: var(--font-sans)` in `@theme inline` â€” a circular reference that falls back to Times\u002Fserif. Even `var(--font-geist-sans)` doesn't work because Tailwind v4's `@theme inline` resolves at **CSS parse time**, not runtime.\n\n**Two fixes required after `create-next-app` + `shadcn init`:**\n\n1. **Use literal font names in `globals.css`** (not CSS variable references):\n\n```css\n@theme inline {\n  \u002F* CORRECT â€” literal names that @theme can resolve at parse time *\u002F\n  --font-sans: \"Geist\", \"Geist Fallback\", ui-sans-serif, system-ui, sans-serif;\n  --font-mono: \"Geist Mono\", \"Geist Mono Fallback\", ui-monospace, monospace;\n}\n```\n\n2. **Move font variable classNames from `\u003Cbody>` to `\u003Chtml>`** in layout.tsx:\n\n```tsx\n\u002F\u002F app\u002Flayout.tsx â€” CORRECT\n\u003Chtml lang=\"en\" className={`${geistSans.variable} ${geistMono.variable}`}>\n  \u003Cbody className=\"antialiased\">\n```\n\n```tsx\n\u002F\u002F app\u002Flayout.tsx â€” WRONG (default scaffold output)\n\u003Chtml lang=\"en\">\n  \u003Cbody className={`${geistSans.variable} ${geistMono.variable} antialiased`}>\n```\n\n**Always apply both fixes** after running `create-next-app` + `shadcn init` with Tailwind v4.\n\n## UI Defaults for App Router Pages\n\nWhen building pages, layouts, and route-level UI in this stack, default to shadcn\u002Fui + Geist instead of raw Tailwind scaffolding.\n- Start from theme tokens: `bg-background text-foreground`, not ad-hoc palette classes.\n- Use Geist Sans for interface text and Geist Mono for code, metrics, IDs, timestamps.\n- Reach for shadcn primitives first: Button, Input, Textarea, Card, Tabs, Table, Dialog, AlertDialog, Sheet, DropdownMenu, Badge, Separator, Skeleton.\n- For product, admin, and AI surfaces, default to dark mode with restrained accents and designed empty\u002Floading\u002Ferror states.\n- Common route compositions: Settings route (Tabs+Card+form), Dashboard route (filter bar+Card+Table), Mobile nav (Sheet+Button).\n\n## Key Architecture\n\nNext.js 16 uses React 19.2 features and the App Router (file-system routing under `app\u002F`). Ensure React **19.2.4+** for security patches (see CVE section below).\n\n### File Conventions\n- `layout.tsx` â€” Persistent wrapper, preserves state across navigations\n- `page.tsx` â€” Unique UI for a route, makes route publicly accessible\n- `loading.tsx` â€” Suspense fallback shown while segment loads\n- `error.tsx` â€” Error boundary for a segment\n- `not-found.tsx` â€” 404 UI for a segment\n- `route.ts` â€” API endpoint (Route Handler)\n- `template.tsx` â€” Like layout but re-mounts on navigation\n- `default.tsx` â€” Fallback for parallel routes\n\n### Routing\n- Dynamic segments: `[id]`, catch-all: `[...slug]`, optional catch-all: `[[...slug]]`\n- Route groups: `(group)` â€” organize without affecting URL\n- Parallel routes: `@slot` â€” render multiple pages in same layout\n- Intercepting routes: `(.)`, `(..)`, `(...)`, `(..)(..)` â€” modal patterns\n\n## Server Components (Default)\n\nAll components in the App Router are Server Components by default. They:\n- Run on the server only, ship zero JavaScript to the client\n- Can directly `await` data (fetch, DB queries, file system)\n- Cannot use `useState`, `useEffect`, or browser APIs\n- Cannot use event handlers (`onClick`, `onChange`)\n\n```tsx\n\u002F\u002F app\u002Fusers\u002Fpage.tsx â€” Server Component (default)\nexport default async function UsersPage() {\n  const users = await db.query('SELECT * FROM users')\n  return \u003CUserList users={users} \u002F>\n}\n```\n\n## Client Components\n\nAdd `'use client'` at the top of the file when you need interactivity or browser APIs.\n\n```tsx\n'use client'\nimport { useState } from 'react'\n\nexport function Counter() {\n  const [count, setCount] = useState(0)\n  return \u003Cbutton onClick={() => setCount(count + 1)}>{count}\u003C\u002Fbutton>\n}\n```\n\n**Rule**: Push `'use client'` as far down the component tree as possible. Keep data fetching in Server Components and pass data down as props.\n\n## Server Actions \u002F Server Functions\n\nAsync functions marked with `'use server'` that run on the server. Use for mutations.\n\n```tsx\n\u002F\u002F app\u002Factions.ts\n'use server'\n\nexport async function createUser(formData: FormData) {\n  const name = formData.get('name') as string\n  await db.insert('users', { name })\n  revalidatePath('\u002Fusers')\n}\n```\n\nUse Server Actions for:\n- Form submissions and data mutations\n- In-app mutations with `revalidatePath` \u002F `revalidateTag`\n\nUse Route Handlers (`route.ts`) for:\n- Public APIs consumed by external clients\n- Webhooks\n- Large file uploads\n- Streaming responses\n\n## Cache Components (Next.js 16)\n\nThe `'use cache'` directive enables component and function-level caching.\n\n```tsx\n'use cache'\n\nexport async function CachedUserList() {\n  cacheLife('hours') \u002F\u002F Configure cache duration\n  cacheTag('users')  \u002F\u002F Tag for on-demand invalidation\n  const users = await db.query('SELECT * FROM users')\n  return \u003CUserList users={users} \u002F>\n}\n```\n\n### Cache Scope Variants\n\n`'use cache'` supports scope modifiers that control where cached data is stored:\n\n```tsx\n\u002F\u002F Default â€” cached in the deployment's local data cache\n'use cache'\n\n\u002F\u002F Remote cache â€” shared across all deployments and regions (Vercel only)\n'use cache: remote'\n\n\u002F\u002F Private cache â€” per-request cache, never shared between users\n'use cache: private'\n```\n\n| Variant | Shared across deployments? | Shared across users? | Use case |\n|---------|---------------------------|---------------------|----------|\n| `'use cache'` | No (per-deployment) | Yes | Default, most use cases |\n| `'use cache: remote'` | Yes | Yes | Expensive computations shared globally |\n| `'use cache: private'` | No | No | User-specific cached data (e.g., profile) |\n\n### Cache Handler Configuration\n\nNext.js 16 uses `cacheHandlers` (plural) to configure separate handlers for different cache types:\n\n```ts\n\u002F\u002F next.config.ts\nconst nextConfig = {\n  cacheHandlers: {\n    default: require.resolve('.\u002Fcache-handler-default.mjs'),\n    remote: require.resolve('.\u002Fcache-handler-remote.mjs'),\n    fetch: require.resolve('.\u002Fcache-handler-fetch.mjs'),\n  },\n}\n```\n\n**Important**: `cacheHandlers` (plural, Next.js 16+) replaces `cacheHandler` (singular, Next.js 15). The singular form configured one handler for all cache types. The plural form allows per-type handlers (`default`, `remote`, `fetch`). Using the old singular `cacheHandler` in Next.js 16 triggers a deprecation warning.\n\n### Cache Invalidation\n\nInvalidate with `updateTag('users')` from a Server Action (immediate expiration, Server Actions only) or `revalidateTag('users', 'max')` for stale-while-revalidate from Server Actions or Route Handlers.\n\n**Important**: The single-argument `revalidateTag(tag)` is deprecated in Next.js 16. Always pass a `cacheLife` profile as the second argument (e.g., `'max'`, `'hours'`, `'days'`).\n\n| Function | Context | Behavior |\n|----------|---------|----------|\n| `updateTag(tag)` | Server Actions only | Immediate expiration, read-your-own-writes |\n| `revalidateTag(tag, 'max')` | Server Actions + Route Handlers | Stale-while-revalidate (recommended) |\n| `revalidateTag(tag, { expire: 0 })` | Route Handlers (webhooks) | Immediate expiration from external triggers |\n\n## Proxy (formerly Middleware)\n\nIn Next.js 16, `middleware.ts` is renamed to `proxy.ts`. It runs **exclusively on the Node.js runtime** â€” the Edge runtime is not supported in proxy and cannot be configured.\n\n**File location**: Place `proxy.ts` at the same level as your `app\u002F` directory:\n- Standard project: `proxy.ts` at project root\n- With `--src-dir` (or `srcDir: true`): `src\u002Fproxy.ts` (inside `src\u002F`, alongside `app\u002F`)\n\nIf you place `proxy.ts` in the wrong location, Next.js will silently ignore it and no request interception will occur.\n\n**Constraints**:\n- Proxy can only **rewrite**, **redirect**, or **modify headers** â€” it cannot return full response bodies. Use Route Handlers for that.\n- Config flags are renamed: `skipMiddlewareUrlNormalize` â†’ `skipProxyUrlNormalize`.\n- Keep it light: use for high-level traffic control (e.g., redirecting users without a session cookie). Detailed auth should live in Server Components or Server Actions.\n- **OpenNext note**: OpenNext doesn't support `proxy.ts` yet â€” keep using `middleware.ts` if self-hosting with OpenNext.\n\n```ts\n\u002F\u002F proxy.ts (or src\u002Fproxy.ts if using src directory)\nimport type { NextRequest } from 'next\u002Fserver'\n\nexport function proxy(request: NextRequest) {\n  \u002F\u002F Rewrite, redirect, set headers, etc.\n}\n\nexport const config = { matcher: ['\u002Fdashboard\u002F:path*'] }\n```\n\n## Upgrading\n\nUse the built-in upgrade command (available since 16.1.0):\n\n```bash\npnpm next upgrade        # or npm\u002Fyarn\u002Fbun equivalent\n```\n\nFor versions before 16.1.0: `npx @next\u002Fcodemod@canary upgrade latest`\n\nIf your AI coding assistant supports MCP, the **Next.js DevTools MCP** can automate upgrade and migration tasks.\n\n## What's New in Next.js 16.1\n\nNext.js 16.1 (December 2025, latest stable patch: 16.1.6) builds on 16.0 with developer experience improvements:\n\n1. **Turbopack File System Caching (Stable)** â€” Compiler artifacts are now cached on disk between `next dev` restarts, delivering up to 14Ã— faster startup on large projects. Enabled by default, no config needed. File system caching for `next build` is planned next.\n2. **Bundle Analyzer (Experimental)** â€” New built-in bundle analyzer works with Turbopack. Offers route-specific filtering, import tracing, and RSC boundary analysis to identify bloated dependencies in both server and client bundles. Enable with `experimental.bundleAnalyzer: true` in `next.config`.\n3. **`next dev --inspect`** â€” Debug your dev server without global `NODE_OPTIONS=--inspect`. Applies the inspector only to the relevant process.\n4. **`next upgrade` command** â€” New CLI command to simplify version upgrades: `npx @next\u002Fcodemod@canary upgrade latest`.\n5. **Transitive External Dependencies** â€” Turbopack correctly resolves and externalizes transitive deps in `serverExternalPackages` without extra config.\n6. **20 MB smaller installs** â€” Streamlined Turbopack caching layer reduces `node_modules` footprint.\n\n## React 19.2 Features\n\nNext.js 16+ uses React 19.2. These features are available in App Router applications:\n\n### `useEffectEvent` Hook\n\nCreates a stable function that always accesses the latest props and state without triggering effect re-runs. Use when your effect needs to read a value but shouldn't re-run when that value changes:\n\n```tsx\n'use client'\nimport { useEffect, useEffectEvent } from 'react'\n\nfunction ChatRoom({ roomId, theme }: { roomId: string; theme: string }) {\n  const onConnected = useEffectEvent(() => {\n    showNotification(`Connected to ${roomId}`, theme) \u002F\u002F reads latest theme\n  })\n\n  useEffect(() => {\n    const connection = createConnection(roomId)\n    connection.on('connected', onConnected)\n    connection.connect()\n    return () => connection.disconnect()\n  }, [roomId]) \u002F\u002F theme is NOT a dependency â€” onConnected reads it via useEffectEvent\n}\n```\n\nCommon use cases: logging with current state, notifications using current theme, callbacks that need fresh values but aren't the trigger for the effect.\n\n### `\u003CActivity>` Component\n\nPreserves component state when hiding and showing UI, without unmounting. Solves the classic tradeoff between unmounting (loses state) and CSS `display:none` (effects keep running):\n\n```tsx\n'use client'\nimport { Activity, useState } from 'react'\n\nfunction TabContainer() {\n  const [activeTab, setActiveTab] = useState('inbox')\n\n  return (\n    \u003Cdiv>\n      \u003Cnav>\n        \u003Cbutton onClick={() => setActiveTab('inbox')}>Inbox\u003C\u002Fbutton>\n        \u003Cbutton onClick={() => setActiveTab('drafts')}>Drafts\u003C\u002Fbutton>\n      \u003C\u002Fnav>\n      \u003CActivity mode={activeTab === 'inbox' ? 'visible' : 'hidden'}>\n        \u003CInboxPanel \u002F>\n      \u003C\u002FActivity>\n      \u003CActivity mode={activeTab === 'drafts' ? 'visible' : 'hidden'}>\n        \u003CDraftsPanel \u002F>\n      \u003C\u002FActivity>\n    \u003C\u002Fdiv>\n  )\n}\n```\n\nUse for: tabbed interfaces, modals, sidebars, background tasks â€” anywhere you need to maintain component state without keeping everything actively rendered. When `mode=\"hidden\"`, effects are suspended (not running in the background).\n\n### View Transitions API\n\nReact 19.2 supports the browser View Transitions API for animating elements across navigations. Next.js 16 has built-in support â€” elements can animate between route changes without manual transition logic.\n\nKey change: `useId` now generates IDs with `_r_` prefix (instead of `:r:`) to be valid for `view-transition-name` and XML 1.0 names.\n\n## Layout Deduplication During Prefetching\n\nNext.js 16 deduplicates shared layouts during prefetching. When multiple `\u003CLink>` components point to routes with a shared layout, the layout is downloaded **once** instead of separately for each link.\n\n**Impact**: A page with 50 product links that share a layout downloads ~198KB instead of ~2.4MB â€” a 92% reduction in prefetch network transfer.\n\nCombined with **incremental prefetching**, Next.js only fetches route segments not already in cache, cancels prefetch requests when links leave the viewport, re-prefetches on hover or viewport re-entry, and re-prefetches when data is invalidated.\n\n## Bundle Analyzer (`next experimental-analyze`)\n\nBuilt-in bundle analyzer that works with Turbopack (available since Next.js 16.1):\n\n```bash\n# Analyze and serve results in browser\nnext experimental-analyze --serve\n\n# Analyze with custom port\nnext experimental-analyze --serve --port 4001\n\n# Write analysis to .next\u002Fdiagnostics\u002Fanalyze (no server)\nnext experimental-analyze\n```\n\nFeatures:\n- Route-specific filtering between client and server bundles\n- Full import chain tracing â€” see exactly why a module is included\n- Traces imports across RSC boundaries and dynamic imports\n- No application build required â€” analyzes module graph directly\n\nSave output for comparison: `cp -r .next\u002Fdiagnostics\u002Fanalyze .\u002Fanalyze-before-refactor`\n\n**Legacy**: For projects not using Turbopack, use `@next\u002Fbundle-analyzer` with `ANALYZE=true npm run build`.\n\n## Next.js 16.2 (Canary)\n\nNext.js 16.2 is currently in canary (latest: 16.2.0-canary.84, March 2026). Key areas in development:\n\n1. **Turbopack File System Caching for `next build`** â€” Extending the stable `next dev` FS cache to production builds for faster CI.\n2. **Proxy refinements** â€” Continued iteration on `proxy.ts` (the Node.js-runtime replacement for `middleware.ts` introduced in 16.0). The proxy API is stabilizing with improved request context and streaming support.\n3. **React Compiler optimizations** â€” Further automatic memoization improvements building on the stable React Compiler in 16.0.\n\n> **Note**: Canary releases are not recommended for production. Track progress at the [Next.js Changelog](https:\u002F\u002Fnext-changelog.vercel.app\u002F) or [GitHub Releases](https:\u002F\u002Fgithub.com\u002Fvercel\u002Fnext.js\u002Freleases).\n\n## DevTools MCP\n\nNext.js 16 includes **Next.js DevTools MCP**, a Model Context Protocol integration for AI-assisted debugging. It enables AI agents to diagnose issues, explain behavior, and suggest fixes within your development workflow. If your AI coding assistant supports MCP, DevTools MCP can also automate upgrade and migration tasks.\n\n## Breaking Changes in Next.js 16\n\n1. **Async Request APIs**: `cookies()`, `headers()`, `params`, `searchParams` are all async â€” must `await` them\n2. **Proxy replaces Middleware**: Rename `middleware.ts` â†’ `proxy.ts`, runs on Node.js only (Edge not supported)\n3. **Turbopack is top-level config**: Move from `experimental.turbopack` to `turbopack` in `next.config`\n4. **View Transitions**: Built-in support for animating elements across navigations\n5. **Node.js 20.9+ required**: Dropped support for Node 18\n6. **TypeScript 5.1+ required**\n\n## React 19 Gotchas\n\n### `useRef()` Requires an Initial Value\n\nReact 19 strict mode enforces that `useRef()` must be called with an explicit initial value. Omitting it causes a type error or runtime warning:\n\n```tsx\n\u002F\u002F WRONG â€” React 19 strict mode complains\nconst ref = useRef()       \u002F\u002F âŒ missing initial value\nconst ref = useRef\u003CHTMLDivElement>()  \u002F\u002F âŒ still missing\n\n\u002F\u002F CORRECT\nconst ref = useRef\u003CHTMLDivElement>(null)  \u002F\u002F âœ…\nconst ref = useRef(0)                     \u002F\u002F âœ…\n```\n\nThis affects all `useRef` calls in client components. The fix is always to pass an explicit initial value (usually `null` for DOM refs).\n\n## Security: Critical CVEs\n\nMultiple vulnerabilities affect **all Next.js App Router applications** (13.4+, 14.x, 15.x, 16.x). Upgrade immediately.\n\n### CVE-2025-66478 \u002F CVE-2025-55182 â€” Remote Code Execution (CVSS 10.0, Critical)\n\nA deserialization vulnerability in the React Server Components (RSC) \"Flight\" protocol allows unauthenticated remote code execution via crafted HTTP requests. Near-100% exploit reliability against default configurations. **Actively exploited in the wild.** No workaround â€” upgrade is required. Rotate all application secrets after patching.\n\n- Affects: Next.js App Router applications (15.x, 16.x, 14.3.0-canary.77+)\n- Does NOT affect: Pages Router apps, Edge Runtime, Next.js 13.x, stable Next.js 14.x\n\n### CVE-2025-55184 â€” Denial of Service (CVSS 7.5, High)\n\nSpecially crafted HTTP requests cause the server process to hang indefinitely, consuming CPU and blocking legitimate users. No authentication required, low attack complexity.\n\n### CVE-2025-55183 â€” Source Code Exposure (CVSS 5.3, Medium)\n\nMalformed HTTP requests can trick Server Actions into returning their compiled source code instead of the expected response. Environment variables are not exposed, but any hardcoded secrets in Server Action code can leak.\n\n### CVE-2026-23864 â€” Denial of Service via Memory Exhaustion (CVSS 7.5, High)\n\nDisclosed January 26, 2026. The original DoS fix for CVE-2025-55184 was incomplete â€” additional vectors allow specially crafted HTTP requests to Server Function endpoints to crash the server via out-of-memory exceptions or excessive CPU usage. No authentication required.\n\n### CVE-2025-29927 â€” Middleware Authorization Bypass (CVSS 9.1, Critical)\n\nAn attacker can bypass middleware-based authorization by sending a crafted `x-middleware-subrequest` header, skipping all middleware logic. This affects any Next.js application that relies on `middleware.ts` (or `proxy.ts` in 16+) as the **sole** authorization gate. Patched in Next.js 14.2.25, 15.2.3, and all 16.x releases.\n\n**Mitigation**: Never rely on middleware\u002Fproxy as the only auth layer. Always re-validate authorization in Server Components, Server Actions, or Route Handlers. If you cannot patch immediately, block `x-middleware-subrequest` at your reverse proxy or WAF.\n\n### Patched Versions\n\n| Release Line | Minimum Safe Version (all CVEs) |\n|---|---|\n| 14.x | `next@14.2.35` |\n| 15.0.x | `next@15.0.5` |\n| 15.1.x | `next@15.1.9` |\n| 15.2.x | `next@15.2.6` |\n| 15.3.x | `next@15.3.6` |\n| 15.4.x | `next@15.4.8` |\n| 15.5.x | `next@15.5.7` |\n| 16.0.x | `next@16.0.11` |\n| 16.1.x | `next@16.1.5` |\n\nUpgrade React to at least **19.0.1** \u002F **19.1.2** \u002F **19.2.1** for the RCE fix (CVE-2025-55182), and **19.2.4+** to fully address all DoS vectors (CVE-2025-55184, CVE-2025-67779, CVE-2026-23864).\n\n```bash\n# Upgrade to latest patched versions\nnpm install next@latest react@latest react-dom@latest\n```\n\nVercel deployed WAF rules automatically for hosted projects, but **WAF is defense-in-depth, not a substitute for patching**.\n\n## Rendering Strategy Decision\n\n| Strategy | When to Use |\n|----------|-------------|\n| SSG (`generateStaticParams`) | Content rarely changes, maximum performance |\n| ISR (`revalidate: N`) | Content changes periodically, acceptable staleness |\n| SSR (Server Components) | Per-request fresh data, personalized content |\n| Cache Components (`'use cache'`) | Mix static shell with dynamic parts |\n| Client Components | Interactive UI, browser APIs needed |\n| Streaming (Suspense) | Show content progressively as data loads |\n\n### Rendering Strategy Guidance\n\n```\nChoosing a rendering strategy?\nâ”œâ”€ Content changes less than once per day?\nâ”‚  â”œâ”€ Same for all users? â†’ SSG (`generateStaticParams`)\nâ”‚  â””â”€ Personalized? â†’ SSG shell + client fetch for personalized parts\nâ”‚\nâ”œâ”€ Content changes frequently but can be slightly stale?\nâ”‚  â”œâ”€ Revalidate on schedule? â†’ ISR with `revalidate: N` seconds\nâ”‚  â””â”€ Revalidate on demand? â†’ `revalidateTag()` or `revalidatePath()`\nâ”‚\nâ”œâ”€ Content must be fresh on every request?\nâ”‚  â”œâ”€ Cacheable per-request? â†’ Cache Components (`'use cache'` + `cacheLife`)\nâ”‚  â”œâ”€ Personalized per-user? â†’ SSR with Streaming (Suspense boundaries)\nâ”‚  â””â”€ Real-time? â†’ Client-side with SWR\u002FReact Query + SSR for initial load\nâ”‚\nâ””â”€ Mostly static with one dynamic section?\n   â””â”€ Partial Prerendering: static shell + Suspense for dynamic island\n```\n\n### Caching Strategy Matrix\n\n| Data Type | Strategy | Implementation |\n|-----------|----------|----------------|\n| Static assets (JS, CSS, images) | Immutable cache | Automatic with Vercel (hashed filenames) |\n| API responses (shared) | Cache Components | `'use cache'` + `cacheLife('hours')` |\n| API responses (per-user) | No cache or short TTL | `cacheLife({ revalidate: 60 })` with user-scoped key |\n| Configuration data | Edge Config | `@vercel\u002Fedge-config` (\u003C 5ms reads) |\n| Database queries | ISR + on-demand | `revalidateTag('products')` on write |\n| Full pages | SSG \u002F ISR | `generateStaticParams` + `revalidate` |\n| Search results | Client-side + SWR | `useSWR` with stale-while-revalidate |\n\n### Image Optimization Pattern\n\n```tsx\n\u002F\u002F BEFORE: Unoptimized, causes LCP & CLS issues\n\u003Cimg src=\"\u002Fhero.jpg\" \u002F>\n\n\u002F\u002F AFTER: Optimized with next\u002Fimage\nimport Image from 'next\u002Fimage';\n\u003CImage src=\"\u002Fhero.jpg\" width={1200} height={600} priority alt=\"Hero\" \u002F>\n```\n\n### Font Loading Pattern\n\n```tsx\n\u002F\u002F BEFORE: External font causes CLS\n\u003Clink href=\"https:\u002F\u002Ffonts.googleapis.com\u002Fcss2?family=Inter\" rel=\"stylesheet\" \u002F>\n\n\u002F\u002F AFTER: Zero-CLS with next\u002Ffont\nimport { Inter } from 'next\u002Ffont\u002Fgoogle';\nconst inter = Inter({ subsets: ['latin'] });\n```\n\n### Cache Components Pattern\n\n```tsx\n\u002F\u002F BEFORE: Re-fetches on every request\nasync function ProductList() {\n  const products = await db.query('SELECT * FROM products');\n  return \u003Cul>{products.map(p => \u003Cli key={p.id}>{p.name}\u003C\u002Fli>)}\u003C\u002Ful>;\n}\n\n\u002F\u002F AFTER: Cached with automatic revalidation\n'use cache';\nimport { cacheLife } from 'next\u002Fcache';\n\nasync function ProductList() {\n  cacheLife('hours');\n  const products = await db.query('SELECT * FROM products');\n  return \u003Cul>{products.map(p => \u003Cli key={p.id}>{p.name}\u003C\u002Fli>)}\u003C\u002Ful>;\n}\n```\n\n### Optimistic UI Pattern\n\n```tsx\n\u002F\u002F Instant feedback while Server Action processes\n'use client';\nimport { useOptimistic } from 'react';\n\nfunction LikeButton({ count, onLike }) {\n  const [optimisticCount, addOptimistic] = useOptimistic(count);\n  return (\n    \u003Cbutton onClick={() => { addOptimistic(count + 1); onLike(); }}>\n      {optimisticCount} likes\n    \u003C\u002Fbutton>\n  );\n}\n```\n\n## OG Image Generation\n\nNext.js supports file-based OG image generation via `opengraph-image.tsx` and `twitter-image.tsx` special files. These use `@vercel\u002Fog` (built on Satori) to render JSX to images at the Edge runtime.\n\n### File Convention\n\nPlace an `opengraph-image.tsx` (or `twitter-image.tsx`) in any route segment to auto-generate social images for that route:\n\n```tsx\n\u002F\u002F app\u002Fblog\u002F[slug]\u002Fopengraph-image.tsx\nimport { ImageResponse } from 'next\u002Fog'\n\nexport const runtime = 'edge'\nexport const alt = 'Blog post'\nexport const size = { width: 1200, height: 630 }\nexport const contentType = 'image\u002Fpng'\n\nexport default async function Image({\n  params,\n}: {\n  params: Promise\u003C{ slug: string }>\n}) {\n  const { slug } = await params\n  const post = await fetch(`https:\u002F\u002Fapi.example.com\u002Fposts\u002F${slug}`).then(r => r.json())\n\n  return new ImageResponse(\n    (\n      \u003Cdiv\n        style={{\n          fontSize: 48,\n          background: 'linear-gradient(to bottom, #000, #111)',\n          color: 'white',\n          width: '100%',\n          height: '100%',\n          display: 'flex',\n          alignItems: 'center',\n          justifyContent: 'center',\n          padding: 48,\n        }}\n      >\n        {post.title}\n      \u003C\u002Fdiv>\n    ),\n    { ...size }\n  )\n}\n```\n\n### Key Points\n\n- **`ImageResponse`** â€” Import from `next\u002Fog` (re-exports `@vercel\u002Fog`). Renders JSX to PNG\u002FSVG images.\n- **Edge runtime** â€” OG image routes run on the Edge runtime by default. Export `runtime = 'edge'` explicitly for clarity.\n- **Exports** â€” `alt`, `size`, and `contentType` configure the generated `\u003Cmeta>` tags automatically.\n- **Static or dynamic** â€” Without params, the image is generated at build time. With dynamic segments, it generates per-request.\n- **Supported CSS** â€” Satori supports a Flexbox subset. Use inline `style` objects (no Tailwind). `display: 'flex'` is required on containers.\n- **Fonts** â€” Load custom fonts via `fetch` and pass to `ImageResponse` options: `{ fonts: [{ name, data, style, weight }] }`.\n- **Twitter fallback** â€” If no `twitter-image.tsx` exists, `opengraph-image.tsx` is used for Twitter cards too.\n\n### When to Use\n\n| Approach | When |\n|----------|------|\n| `opengraph-image.tsx` file | Dynamic per-route OG images with data fetching |\n| Static `opengraph-image.png` file | Same image for every page in a segment |\n| `generateMetadata` with `openGraph.images` | Point to an external image URL |\n\n## Deployment on Vercel\n\n- Zero-config: Vercel auto-detects Next.js and optimizes\n- `vercel dev` for local development with Vercel features\n- Server Components â†’ Serverless\u002FEdge Functions automatically\n- Image optimization via `next\u002Fimage` (automatic on Vercel)\n- Font optimization via `next\u002Ffont` (automatic on Vercel)\n\n## Common Patterns\n\n### Data Fetching in Server Components\n```tsx\n\u002F\u002F Parallel data fetching\nconst [users, posts] = await Promise.all([\n  getUsers(),\n  getPosts(),\n])\n```\n\n### Streaming with Suspense\n```tsx\nimport { Suspense } from 'react'\n\nexport default function Page() {\n  return (\n    \u003Cdiv>\n      \u003Ch1>Dashboard\u003C\u002Fh1>\n      \u003CSuspense fallback={\u003CSkeleton \u002F>}>\n        \u003CSlowDataComponent \u002F>\n      \u003C\u002FSuspense>\n    \u003C\u002Fdiv>\n  )\n}\n```\n\n### Error Handling\n```tsx\n\u002F\u002F app\u002Fdashboard\u002Ferror.tsx\n'use client'\n\nexport default function Error({ error, reset }: {\n  error: Error & { digest?: string }\n  reset: () => void\n}) {\n  return (\n    \u003Cdiv>\n      \u003Ch2>Something went wrong\u003C\u002Fh2>\n      \u003Cbutton onClick={() => reset()}>Try again\u003C\u002Fbutton>\n    \u003C\u002Fdiv>\n  )\n}\n```\n\n## Official Documentation\n\n- [Next.js Documentation](https:\u002F\u002Fnextjs.org\u002Fdocs)\n- [App Router](https:\u002F\u002Fnextjs.org\u002Fdocs\u002Fapp\u002Fgetting-started)\n- [Routing](https:\u002F\u002Fnextjs.org\u002Fdocs\u002Fapp\u002Fbuilding-your-application\u002Frouting)\n- [Data Fetching](https:\u002F\u002Fnextjs.org\u002Fdocs\u002Fapp\u002Fbuilding-your-application\u002Fdata-fetching)\n- [Rendering](https:\u002F\u002Fnextjs.org\u002Fdocs\u002Fapp\u002Fbuilding-your-application\u002Frendering)\n- [Caching](https:\u002F\u002Fnextjs.org\u002Fdocs\u002Fapp\u002Fbuilding-your-application\u002Fcaching)\n- [Deploying](https:\u002F\u002Fnextjs.org\u002Fdocs\u002Fapp\u002Fgetting-started\u002Fdeploying)\n- [Upgrading](https:\u002F\u002Fnextjs.org\u002Fdocs\u002Fapp\u002Fguides\u002Fupgrading)\n- [GitHub: Next.js](https:\u002F\u002Fgithub.com\u002Fvercel\u002Fnext.js)\n","# Next.js (v16+) â€” App Router\n\nYou are an expert in Next.js 16 with the App Router. Always prefer the App Router over the legacy Pages Router unless the user's project explicitly uses Pages Router.\n\n## Critical Pattern: Lazy Initialization for Build-Safe Modules\n\nNever initialize database clients (Neon, Drizzle), Redis (Upstash), or service SDKs (Resend, Slack) at module scope.\n\nDuring `next build`, static generation can evaluate modules before runtime env vars are present, which causes startup crashes. Always initialize these clients lazily inside getter functions.\n\n```ts\nimport { drizzle } from 'drizzle-orm\u002Fneon-http'\nimport { neon } from '@neondatabase\u002Fserverless'\n\nlet _db: ReturnType\u003Ctypeof drizzle> | null = null\n\nexport function getDb() {\n  if (!_db) _db = drizzle(neon(process.env.DATABASE_URL!))\n  return _db\n}\n```\n\nApply the same lazy singleton pattern to Redis and SDK clients (`getRedis()`, `getResend()`, `getSlackClient()`) instead of creating them at import time.\n\n## Scaffolding\n\nWhen running `create-next-app`, **always** pass `--yes` to skip interactive prompts (React Compiler, import alias) that hang in non-interactive shells:\n\n```bash\nnpx create-next-app@latest my-app --yes --typescript --tailwind --eslint --app --src-dir --import-alias \"@\u002F*\" --turbopack --use-npm\n```\n\n**If the target directory contains ANY non-Next.js files** (`.git\u002F`, config files, etc.), you **MUST** add `--force`. Without it, `create-next-app` will fail with \"The directory contains files that could conflict\" and block scaffolding. **Check the directory first** â€” if it has anything in it, use `--force`:\n\n```bash\nnpx create-next-app@latest . --yes --force --typescript --tailwind --eslint --app --src-dir --import-alias \"@\u002F*\" --turbopack --use-npm\n```\n\n### Geist Font Fix (Tailwind v4 + shadcn)\n\n`shadcn init` rewrites `globals.css` with `--font-sans: var(--font-sans)` in `@theme inline` â€” a circular reference that falls back to Times\u002Fserif. Even `var(--font-geist-sans)` doesn't work because Tailwind v4's `@theme inline` resolves at **CSS parse time**, not runtime.\n\n**Two fixes required after `create-next-app` + `shadcn init`:**\n\n1. **Use literal font names in `globals.css`** (not CSS variable references):\n\n```css\n@theme inline {\n  \u002F* CORRECT â€” literal names that @theme can resolve at parse time *\u002F\n  --font-sans: \"Geist\", \"Geist Fallback\", ui-sans-serif, system-ui, sans-serif;\n  --font-mono: \"Geist Mono\", \"Geist Mono Fallback\", ui-monospace, monospace;\n}\n```\n\n2. **Move font variable classNames from `\u003Cbody>` to `\u003Chtml>`** in layout.tsx:\n\n```tsx\n\u002F\u002F app\u002Flayout.tsx â€” CORRECT\n\u003Chtml lang=\"en\" className={`${geistSans.variable} ${geistMono.variable}`}>\n  \u003Cbody className=\"antialiased\">\n```\n\n```tsx\n\u002F\u002F app\u002Flayout.tsx â€” WRONG (default scaffold output)\n\u003Chtml lang=\"en\">\n  \u003Cbody className={`${geistSans.variable} ${geistMono.variable} antialiased`}>\n```\n\n**Always apply both fixes** after running `create-next-app` + `shadcn init` with Tailwind v4.\n\n## UI Defaults for App Router Pages\n\nWhen building pages, layouts, and route-level UI in this stack, default to shadcn\u002Fui + Geist instead of raw Tailwind scaffolding.\n- Start from theme tokens: `bg-background text-foreground`, not ad-hoc palette classes.\n- Use Geist Sans for interface text and Geist Mono for code, metrics, IDs, timestamps.\n- Reach for shadcn primitives first: Button, Input, Textarea, Card, Tabs, Table, Dialog, AlertDialog, Sheet, DropdownMenu, Badge, Separator, Skeleton.\n- For product, admin, and AI surfaces, default to dark mode with restrained accents and designed empty\u002Floading\u002Ferror states.\n- Common route compositions: Settings route (Tabs+Card+form), Dashboard route (filter bar+Card+Table), Mobile nav (Sheet+Button).\n\n## Key Architecture\n\nNext.js 16 uses React 19.2 features and the App Router (file-system routing under `app\u002F`). Ensure React **19.2.4+** for security patches (see CVE section below).\n\n### File Conventions\n- `layout.tsx` â€” Persistent wrapper, preserves state across navigations\n- `page.tsx` â€” Unique UI for a route, makes route publicly accessible\n- `loading.tsx` â€” Suspense fallback shown while segment loads\n- `error.tsx` â€” Error boundary for a segment\n- `not-found.tsx` â€” 404 UI for a segment\n- `route.ts` â€” API endpoint (Route Handler)\n- `template.tsx` â€” Like layout but re-mounts on navigation\n- `default.tsx` â€” Fallback for parallel routes\n\n### Routing\n- Dynamic segments: `[id]`, catch-all: `[...slug]`, optional catch-all: `[[...slug]]`\n- Route groups: `(group)` â€” organize without affecting URL\n- Parallel routes: `@slot` â€” render multiple pages in same layout\n- Intercepting routes: `(.)`, `(..)`, `(...)`, `(..)(..)` â€” modal patterns\n\n## Server Components (Default)\n\nAll components in the App Router are Server Components by default. They:\n- Run on the server only, ship zero JavaScript to the client\n- Can directly `await` data (fetch, DB queries, file system)\n- Cannot use `useState`, `useEffect`, or browser APIs\n- Cannot use event handlers (`onClick`, `onChange`)\n\n```tsx\n\u002F\u002F app\u002Fusers\u002Fpage.tsx â€” Server Component (default)\nexport default async function UsersPage() {\n  const users = await db.query('SELECT * FROM users')\n  return \u003CUserList users={users} \u002F>\n}\n```\n\n## Client Components\n\nAdd `'use client'` at the top of the file when you need interactivity or browser APIs.\n\n```tsx\n'use client'\nimport { useState } from 'react'\n\nexport function Counter() {\n  const [count, setCount] = useState(0)\n  return \u003Cbutton onClick={() => setCount(count + 1)}>{count}\u003C\u002Fbutton>\n}\n```\n\n**Rule**: Push `'use client'` as far down the component tree as possible. Keep data fetching in Server Components and pass data down as props.\n\n## Server Actions \u002F Server Functions\n\nAsync functions marked with `'use server'` that run on the server. Use for mutations.\n\n```tsx\n\u002F\u002F app\u002Factions.ts\n'use server'\n\nexport async function createUser(formData: FormData) {\n  const name = formData.get('name') as string\n  await db.insert('users', { name })\n  revalidatePath('\u002Fusers')\n}\n```\n\nUse Server Actions for:\n- Form submissions and data mutations\n- In-app mutations with `revalidatePath` \u002F `revalidateTag`\n\nUse Route Handlers (`route.ts`) for:\n- Public APIs consumed by external clients\n- Webhooks\n- Large file uploads\n- Streaming responses\n\n## Cache Components (Next.js 16)\n\nThe `'use cache'` directive enables component and function-level caching.\n\n```tsx\n'use cache'\n\nexport async function CachedUserList() {\n  cacheLife('hours') \u002F\u002F Configure cache duration\n  cacheTag('users')  \u002F\u002F Tag for on-demand invalidation\n  const users = await db.query('SELECT * FROM users')\n  return \u003CUserList users={users} \u002F>\n}\n```\n\n### Cache Scope Variants\n\n`'use cache'` supports scope modifiers that control where cached data is stored:\n\n```tsx\n\u002F\u002F Default â€” cached in the deployment's local data cache\n'use cache'\n\n\u002F\u002F Remote cache â€” shared across all deployments and regions (Vercel only)\n'use cache: remote'\n\n\u002F\u002F Private cache â€” per-request cache, never shared between users\n'use cache: private'\n```\n\n| Variant | Shared across deployments? | Shared across users? | Use case |\n|---------|---------------------------|---------------------|----------|\n| `'use cache'` | No (per-deployment) | Yes | Default, most use cases |\n| `'use cache: remote'` | Yes | Yes | Expensive computations shared globally |\n| `'use cache: private'` | No | No | User-specific cached data (e.g., profile) |\n\n### Cache Handler Configuration\n\nNext.js 16 uses `cacheHandlers` (plural) to configure separate handlers for different cache types:\n\n```ts\n\u002F\u002F next.config.ts\nconst nextConfig = {\n  cacheHandlers: {\n    default: require.resolve('.\u002Fcache-handler-default.mjs'),\n    remote: require.resolve('.\u002Fcache-handler-remote.mjs'),\n    fetch: require.resolve('.\u002Fcache-handler-fetch.mjs'),\n  },\n}\n```\n\n**Important**: `cacheHandlers` (plural, Next.js 16+) replaces `cacheHandler` (singular, Next.js 15). The singular form configured one handler for all cache types. The plural form allows per-type handlers (`default`, `remote`, `fetch`). Using the old singular `cacheHandler` in Next.js 16 triggers a deprecation warning.\n\n### Cache Invalidation\n\nInvalidate with `updateTag('users')` from a Server Action (immediate expiration, Server Actions only) or `revalidateTag('users', 'max')` for stale-while-revalidate from Server Actions or Route Handlers.\n\n**Important**: The single-argument `revalidateTag(tag)` is deprecated in Next.js 16. Always pass a `cacheLife` profile as the second argument (e.g., `'max'`, `'hours'`, `'days'`).\n\n| Function | Context | Behavior |\n|----------|---------|----------|\n| `updateTag(tag)` | Server Actions only | Immediate expiration, read-your-own-writes |\n| `revalidateTag(tag, 'max')` | Server Actions + Route Handlers | Stale-while-revalidate (recommended) |\n| `revalidateTag(tag, { expire: 0 })` | Route Handlers (webhooks) | Immediate expiration from external triggers |\n\n## Proxy (formerly Middleware)\n\nIn Next.js 16, `middleware.ts` is renamed to `proxy.ts`. It runs **exclusively on the Node.js runtime** â€” the Edge runtime is not supported in proxy and cannot be configured.\n\n**File location**: Place `proxy.ts` at the same level as your `app\u002F` directory:\n- Standard project: `proxy.ts` at project root\n- With `--src-dir` (or `srcDir: true`): `src\u002Fproxy.ts` (inside `src\u002F`, alongside `app\u002F`)\n\nIf you place `proxy.ts` in the wrong location, Next.js will silently ignore it and no request interception will occur.\n\n**Constraints**:\n- Proxy can only **rewrite**, **redirect**, or **modify headers** â€” it cannot return full response bodies. Use Route Handlers for that.\n- Config flags are renamed: `skipMiddlewareUrlNormalize` â†’ `skipProxyUrlNormalize`.\n- Keep it light: use for high-level traffic control (e.g., redirecting users without a session cookie). Detailed auth should live in Server Components or Server Actions.\n- **OpenNext note**: OpenNext doesn't support `proxy.ts` yet â€” keep using `middleware.ts` if self-hosting with OpenNext.\n\n```ts\n\u002F\u002F proxy.ts (or src\u002Fproxy.ts if using src directory)\nimport type { NextRequest } from 'next\u002Fserver'\n\nexport function proxy(request: NextRequest) {\n  \u002F\u002F Rewrite, redirect, set headers, etc.\n}\n\nexport const config = { matcher: ['\u002Fdashboard\u002F:path*'] }\n```\n\n## Upgrading\n\nUse the built-in upgrade command (available since 16.1.0):\n\n```bash\npnpm next upgrade        # or npm\u002Fyarn\u002Fbun equivalent\n```\n\nFor versions before 16.1.0: `npx @next\u002Fcodemod@canary upgrade latest`\n\nIf your AI coding assistant supports MCP, the **Next.js DevTools MCP** can automate upgrade and migration tasks.\n\n## What's New in Next.js 16.1\n\nNext.js 16.1 (December 2025, latest stable patch: 16.1.6) builds on 16.0 with developer experience improvements:\n\n1. **Turbopack File System Caching (Stable)** â€” Compiler artifacts are now cached on disk between `next dev` restarts, delivering up to 14Ã— faster startup on large projects. Enabled by default, no config needed. File system caching for `next build` is planned next.\n2. **Bundle Analyzer (Experimental)** â€” New built-in bundle analyzer works with Turbopack. Offers route-specific filtering, import tracing, and RSC boundary analysis to identify bloated dependencies in both server and client bundles. Enable with `experimental.bundleAnalyzer: true` in `next.config`.\n3. **`next dev --inspect`** â€” Debug your dev server without global `NODE_OPTIONS=--inspect`. Applies the inspector only to the relevant process.\n4. **`next upgrade` command** â€” New CLI command to simplify version upgrades: `npx @next\u002Fcodemod@canary upgrade latest`.\n5. **Transitive External Dependencies** â€” Turbopack correctly resolves and externalizes transitive deps in `serverExternalPackages` without extra config.\n6. **20 MB smaller installs** â€” Streamlined Turbopack caching layer reduces `node_modules` footprint.\n\n## React 19.2 Features\n\nNext.js 16+ uses React 19.2. These features are available in App Router applications:\n\n### `useEffectEvent` Hook\n\nCreates a stable function that always accesses the latest props and state without triggering effect re-runs. Use when your effect needs to read a value but shouldn't re-run when that value changes:\n\n```tsx\n'use client'\nimport { useEffect, useEffectEvent } from 'react'\n\nfunction ChatRoom({ roomId, theme }: { roomId: string; theme: string }) {\n  const onConnected = useEffectEvent(() => {\n    showNotification(`Connected to ${roomId}`, theme) \u002F\u002F reads latest theme\n  })\n\n  useEffect(() => {\n    const connection = createConnection(roomId)\n    connection.on('connected', onConnected)\n    connection.connect()\n    return () => connection.disconnect()\n  }, [roomId]) \u002F\u002F theme is NOT a dependency â€” onConnected reads it via useEffectEvent\n}\n```\n\nCommon use cases: logging with current state, notifications using current theme, callbacks that need fresh values but aren't the trigger for the effect.\n\n### `\u003CActivity>` Component\n\nPreserves component state when hiding and showing UI, without unmounting. Solves the classic tradeoff between unmounting (loses state) and CSS `display:none` (effects keep running):\n\n```tsx\n'use client'\nimport { Activity, useState } from 'react'\n\nfunction TabContainer() {\n  const [activeTab, setActiveTab] = useState('inbox')\n\n  return (\n    \u003Cdiv>\n      \u003Cnav>\n        \u003Cbutton onClick={() => setActiveTab('inbox')}>Inbox\u003C\u002Fbutton>\n        \u003Cbutton onClick={() => setActiveTab('drafts')}>Drafts\u003C\u002Fbutton>\n      \u003C\u002Fnav>\n      \u003CActivity mode={activeTab === 'inbox' ? 'visible' : 'hidden'}>\n        \u003CInboxPanel \u002F>\n      \u003C\u002FActivity>\n      \u003CActivity mode={activeTab === 'drafts' ? 'visible' : 'hidden'}>\n        \u003CDraftsPanel \u002F>\n      \u003C\u002FActivity>\n    \u003C\u002Fdiv>\n  )\n}\n```\n\nUse for: tabbed interfaces, modals, sidebars, background tasks â€” anywhere you need to maintain component state without keeping everything actively rendered. When `mode=\"hidden\"`, effects are suspended (not running in the background).\n\n### View Transitions API\n\nReact 19.2 supports the browser View Transitions API for animating elements across navigations. Next.js 16 has built-in support â€” elements can animate between route changes without manual transition logic.\n\nKey change: `useId` now generates IDs with `_r_` prefix (instead of `:r:`) to be valid for `view-transition-name` and XML 1.0 names.\n\n## Layout Deduplication During Prefetching\n\nNext.js 16 deduplicates shared layouts during prefetching. When multiple `\u003CLink>` components point to routes with a shared layout, the layout is downloaded **once** instead of separately for each link.\n\n**Impact**: A page with 50 product links that share a layout downloads ~198KB instead of ~2.4MB â€” a 92% reduction in prefetch network transfer.\n\nCombined with **incremental prefetching**, Next.js only fetches route segments not already in cache, cancels prefetch requests when links leave the viewport, re-prefetches on hover or viewport re-entry, and re-prefetches when data is invalidated.\n\n## Bundle Analyzer (`next experimental-analyze`)\n\nBuilt-in bundle analyzer that works with Turbopack (available since Next.js 16.1):\n\n```bash\n# Analyze and serve results in browser\nnext experimental-analyze --serve\n\n# Analyze with custom port\nnext experimental-analyze --serve --port 4001\n\n# Write analysis to .next\u002Fdiagnostics\u002Fanalyze (no server)\nnext experimental-analyze\n```\n\nFeatures:\n- Route-specific filtering between client and server bundles\n- Full import chain tracing â€” see exactly why a module is included\n- Traces imports across RSC boundaries and dynamic imports\n- No application build required â€” analyzes module graph directly\n\nSave output for comparison: `cp -r .next\u002Fdiagnostics\u002Fanalyze .\u002Fanalyze-before-refactor`\n\n**Legacy**: For projects not using Turbopack, use `@next\u002Fbundle-analyzer` with `ANALYZE=true npm run build`.\n\n## Next.js 16.2 (Canary)\n\nNext.js 16.2 is currently in canary (latest: 16.2.0-canary.84, March 2026). Key areas in development:\n\n1. **Turbopack File System Caching for `next build`** â€” Extending the stable `next dev` FS cache to production builds for faster CI.\n2. **Proxy refinements** â€” Continued iteration on `proxy.ts` (the Node.js-runtime replacement for `middleware.ts` introduced in 16.0). The proxy API is stabilizing with improved request context and streaming support.\n3. **React Compiler optimizations** â€” Further automatic memoization improvements building on the stable React Compiler in 16.0.\n\n> **Note**: Canary releases are not recommended for production. Track progress at the [Next.js Changelog](https:\u002F\u002Fnext-changelog.vercel.app\u002F) or [GitHub Releases](https:\u002F\u002Fgithub.com\u002Fvercel\u002Fnext.js\u002Freleases).\n\n## DevTools MCP\n\nNext.js 16 includes **Next.js DevTools MCP**, a Model Context Protocol integration for AI-assisted debugging. It enables AI agents to diagnose issues, explain behavior, and suggest fixes within your development workflow. If your AI coding assistant supports MCP, DevTools MCP can also automate upgrade and migration tasks.\n\n## Breaking Changes in Next.js 16\n\n1. **Async Request APIs**: `cookies()`, `headers()`, `params`, `searchParams` are all async â€” must `await` them\n2. **Proxy replaces Middleware**: Rename `middleware.ts` â†’ `proxy.ts`, runs on Node.js only (Edge not supported)\n3. **Turbopack is top-level config**: Move from `experimental.turbopack` to `turbopack` in `next.config`\n4. **View Transitions**: Built-in support for animating elements across navigations\n5. **Node.js 20.9+ required**: Dropped support for Node 18\n6. **TypeScript 5.1+ required**\n\n## React 19 Gotchas\n\n### `useRef()` Requires an Initial Value\n\nReact 19 strict mode enforces that `useRef()` must be called with an explicit initial value. Omitting it causes a type error or runtime warning:\n\n```tsx\n\u002F\u002F WRONG â€” React 19 strict mode complains\nconst ref = useRef()       \u002F\u002F âŒ missing initial value\nconst ref = useRef\u003CHTMLDivElement>()  \u002F\u002F âŒ still missing\n\n\u002F\u002F CORRECT\nconst ref = useRef\u003CHTMLDivElement>(null)  \u002F\u002F âœ…\nconst ref = useRef(0)                     \u002F\u002F âœ…\n```\n\nThis affects all `useRef` calls in client components. The fix is always to pass an explicit initial value (usually `null` for DOM refs).\n\n## Security: Critical CVEs\n\nMultiple vulnerabilities affect **all Next.js App Router applications** (13.4+, 14.x, 15.x, 16.x). Upgrade immediately.\n\n### CVE-2025-66478 \u002F CVE-2025-55182 â€” Remote Code Execution (CVSS 10.0, Critical)\n\nA deserialization vulnerability in the React Server Components (RSC) \"Flight\" protocol allows unauthenticated remote code execution via crafted HTTP requests. Near-100% exploit reliability against default configurations. **Actively exploited in the wild.** No workaround â€” upgrade is required. Rotate all application secrets after patching.\n\n- Affects: Next.js App Router applications (15.x, 16.x, 14.3.0-canary.77+)\n- Does NOT affect: Pages Router apps, Edge Runtime, Next.js 13.x, stable Next.js 14.x\n\n### CVE-2025-55184 â€” Denial of Service (CVSS 7.5, High)\n\nSpecially crafted HTTP requests cause the server process to hang indefinitely, consuming CPU and blocking legitimate users. No authentication required, low attack complexity.\n\n### CVE-2025-55183 â€” Source Code Exposure (CVSS 5.3, Medium)\n\nMalformed HTTP requests can trick Server Actions into returning their compiled source code instead of the expected response. Environment variables are not exposed, but any hardcoded secrets in Server Action code can leak.\n\n### CVE-2026-23864 â€” Denial of Service via Memory Exhaustion (CVSS 7.5, High)\n\nDisclosed January 26, 2026. The original DoS fix for CVE-2025-55184 was incomplete â€” additional vectors allow specially crafted HTTP requests to Server Function endpoints to crash the server via out-of-memory exceptions or excessive CPU usage. No authentication required.\n\n### CVE-2025-29927 â€” Middleware Authorization Bypass (CVSS 9.1, Critical)\n\nAn attacker can bypass middleware-based authorization by sending a crafted `x-middleware-subrequest` header, skipping all middleware logic. This affects any Next.js application that relies on `middleware.ts` (or `proxy.ts` in 16+) as the **sole** authorization gate. Patched in Next.js 14.2.25, 15.2.3, and all 16.x releases.\n\n**Mitigation**: Never rely on middleware\u002Fproxy as the only auth layer. Always re-validate authorization in Server Components, Server Actions, or Route Handlers. If you cannot patch immediately, block `x-middleware-subrequest` at your reverse proxy or WAF.\n\n### Patched Versions\n\n| Release Line | Minimum Safe Version (all CVEs) |\n|---|---|\n| 14.x | `next@14.2.35` |\n| 15.0.x | `next@15.0.5` |\n| 15.1.x | `next@15.1.9` |\n| 15.2.x | `next@15.2.6` |\n| 15.3.x | `next@15.3.6` |\n| 15.4.x | `next@15.4.8` |\n| 15.5.x | `next@15.5.7` |\n| 16.0.x | `next@16.0.11` |\n| 16.1.x | `next@16.1.5` |\n\nUpgrade React to at least **19.0.1** \u002F **19.1.2** \u002F **19.2.1** for the RCE fix (CVE-2025-55182), and **19.2.4+** to fully address all DoS vectors (CVE-2025-55184, CVE-2025-67779, CVE-2026-23864).\n\n```bash\n# Upgrade to latest patched versions\nnpm install next@latest react@latest react-dom@latest\n```\n\nVercel deployed WAF rules automatically for hosted projects, but **WAF is defense-in-depth, not a substitute for patching**.\n\n## Rendering Strategy Decision\n\n| Strategy | When to Use |\n|----------|-------------|\n| SSG (`generateStaticParams`) | Content rarely changes, maximum performance |\n| ISR (`revalidate: N`) | Content changes periodically, acceptable staleness |\n| SSR (Server Components) | Per-request fresh data, personalized content |\n| Cache Components (`'use cache'`) | Mix static shell with dynamic parts |\n| Client Components | Interactive UI, browser APIs needed |\n| Streaming (Suspense) | Show content progressively as data loads |\n\n### Rendering Strategy Guidance\n\n```\nChoosing a rendering strategy?\nâ”œâ”€ Content changes less than once per day?\nâ”‚  â”œâ”€ Same for all users? â†’ SSG (`generateStaticParams`)\nâ”‚  â””â”€ Personalized? â†’ SSG shell + client fetch for personalized parts\nâ”‚\nâ”œâ”€ Content changes frequently but can be slightly stale?\nâ”‚  â”œâ”€ Revalidate on schedule? â†’ ISR with `revalidate: N` seconds\nâ”‚  â””â”€ Revalidate on demand? â†’ `revalidateTag()` or `revalidatePath()`\nâ”‚\nâ”œâ”€ Content must be fresh on every request?\nâ”‚  â”œâ”€ Cacheable per-request? â†’ Cache Components (`'use cache'` + `cacheLife`)\nâ”‚  â”œâ”€ Personalized per-user? â†’ SSR with Streaming (Suspense boundaries)\nâ”‚  â””â”€ Real-time? â†’ Client-side with SWR\u002FReact Query + SSR for initial load\nâ”‚\nâ””â”€ Mostly static with one dynamic section?\n   â””â”€ Partial Prerendering: static shell + Suspense for dynamic island\n```\n\n### Caching Strategy Matrix\n\n| Data Type | Strategy | Implementation |\n|-----------|----------|----------------|\n| Static assets (JS, CSS, images) | Immutable cache | Automatic with Vercel (hashed filenames) |\n| API responses (shared) | Cache Components | `'use cache'` + `cacheLife('hours')` |\n| API responses (per-user) | No cache or short TTL | `cacheLife({ revalidate: 60 })` with user-scoped key |\n| Configuration data | Edge Config | `@vercel\u002Fedge-config` (\u003C 5ms reads) |\n| Database queries | ISR + on-demand | `revalidateTag('products')` on write |\n| Full pages | SSG \u002F ISR | `generateStaticParams` + `revalidate` |\n| Search results | Client-side + SWR | `useSWR` with stale-while-revalidate |\n\n### Image Optimization Pattern\n\n```tsx\n\u002F\u002F BEFORE: Unoptimized, causes LCP & CLS issues\n\u003Cimg src=\"\u002Fhero.jpg\" \u002F>\n\n\u002F\u002F AFTER: Optimized with next\u002Fimage\nimport Image from 'next\u002Fimage';\n\u003CImage src=\"\u002Fhero.jpg\" width={1200} height={600} priority alt=\"Hero\" \u002F>\n```\n\n### Font Loading Pattern\n\n```tsx\n\u002F\u002F BEFORE: External font causes CLS\n\u003Clink href=\"https:\u002F\u002Ffonts.googleapis.com\u002Fcss2?family=Inter\" rel=\"stylesheet\" \u002F>\n\n\u002F\u002F AFTER: Zero-CLS with next\u002Ffont\nimport { Inter } from 'next\u002Ffont\u002Fgoogle';\nconst inter = Inter({ subsets: ['latin'] });\n```\n\n### Cache Components Pattern\n\n```tsx\n\u002F\u002F BEFORE: Re-fetches on every request\nasync function ProductList() {\n  const products = await db.query('SELECT * FROM products');\n  return \u003Cul>{products.map(p => \u003Cli key={p.id}>{p.name}\u003C\u002Fli>)}\u003C\u002Ful>;\n}\n\n\u002F\u002F AFTER: Cached with automatic revalidation\n'use cache';\nimport { cacheLife } from 'next\u002Fcache';\n\nasync function ProductList() {\n  cacheLife('hours');\n  const products = await db.query('SELECT * FROM products');\n  return \u003Cul>{products.map(p => \u003Cli key={p.id}>{p.name}\u003C\u002Fli>)}\u003C\u002Ful>;\n}\n```\n\n### Optimistic UI Pattern\n\n```tsx\n\u002F\u002F Instant feedback while Server Action processes\n'use client';\nimport { useOptimistic } from 'react';\n\nfunction LikeButton({ count, onLike }) {\n  const [optimisticCount, addOptimistic] = useOptimistic(count);\n  return (\n    \u003Cbutton onClick={() => { addOptimistic(count + 1); onLike(); }}>\n      {optimisticCount} likes\n    \u003C\u002Fbutton>\n  );\n}\n```\n\n## OG Image Generation\n\nNext.js supports file-based OG image generation via `opengraph-image.tsx` and `twitter-image.tsx` special files. These use `@vercel\u002Fog` (built on Satori) to render JSX to images at the Edge runtime.\n\n### File Convention\n\nPlace an `opengraph-image.tsx` (or `twitter-image.tsx`) in any route segment to auto-generate social images for that route:\n\n```tsx\n\u002F\u002F app\u002Fblog\u002F[slug]\u002Fopengraph-image.tsx\nimport { ImageResponse } from 'next\u002Fog'\n\nexport const runtime = 'edge'\nexport const alt = 'Blog post'\nexport const size = { width: 1200, height: 630 }\nexport const contentType = 'image\u002Fpng'\n\nexport default async function Image({\n  params,\n}: {\n  params: Promise\u003C{ slug: string }>\n}) {\n  const { slug } = await params\n  const post = await fetch(`https:\u002F\u002Fapi.example.com\u002Fposts\u002F${slug}`).then(r => r.json())\n\n  return new ImageResponse(\n    (\n      \u003Cdiv\n        style={{\n          fontSize: 48,\n          background: 'linear-gradient(to bottom, #000, #111)',\n          color: 'white',\n          width: '100%',\n          height: '100%',\n          display: 'flex',\n          alignItems: 'center',\n          justifyContent: 'center',\n          padding: 48,\n        }}\n      >\n        {post.title}\n      \u003C\u002Fdiv>\n    ),\n    { ...size }\n  )\n}\n```\n\n### Key Points\n\n- **`ImageResponse`** â€” Import from `next\u002Fog` (re-exports `@vercel\u002Fog`). Renders JSX to PNG\u002FSVG images.\n- **Edge runtime** â€” OG image routes run on the Edge runtime by default. Export `runtime = 'edge'` explicitly for clarity.\n- **Exports** â€” `alt`, `size`, and `contentType` configure the generated `\u003Cmeta>` tags automatically.\n- **Static or dynamic** â€” Without params, the image is generated at build time. With dynamic segments, it generates per-request.\n- **Supported CSS** â€” Satori supports a Flexbox subset. Use inline `style` objects (no Tailwind). `display: 'flex'` is required on containers.\n- **Fonts** â€” Load custom fonts via `fetch` and pass to `ImageResponse` options: `{ fonts: [{ name, data, style, weight }] }`.\n- **Twitter fallback** â€” If no `twitter-image.tsx` exists, `opengraph-image.tsx` is used for Twitter cards too.\n\n### When to Use\n\n| Approach | When |\n|----------|------|\n| `opengraph-image.tsx` file | Dynamic per-route OG images with data fetching |\n| Static `opengraph-image.png` file | Same image for every page in a segment |\n| `generateMetadata` with `openGraph.images` | Point to an external image URL |\n\n## Deployment on Vercel\n\n- Zero-config: Vercel auto-detects Next.js and optimizes\n- `vercel dev` for local development with Vercel features\n- Server Components â†’ Serverless\u002FEdge Functions automatically\n- Image optimization via `next\u002Fimage` (automatic on Vercel)\n- Font optimization via `next\u002Ffont` (automatic on Vercel)\n\n## Common Patterns\n\n### Data Fetching in Server Components\n```tsx\n\u002F\u002F Parallel data fetching\nconst [users, posts] = await Promise.all([\n  getUsers(),\n  getPosts(),\n])\n```\n\n### Streaming with Suspense\n```tsx\nimport { Suspense } from 'react'\n\nexport default function Page() {\n  return (\n    \u003Cdiv>\n      \u003Ch1>Dashboard\u003C\u002Fh1>\n      \u003CSuspense fallback={\u003CSkeleton \u002F>}>\n        \u003CSlowDataComponent \u002F>\n      \u003C\u002FSuspense>\n    \u003C\u002Fdiv>\n  )\n}\n```\n\n### Error Handling\n```tsx\n\u002F\u002F app\u002Fdashboard\u002Ferror.tsx\n'use client'\n\nexport default function Error({ error, reset }: {\n  error: Error & { digest?: string }\n  reset: () => void\n}) {\n  return (\n    \u003Cdiv>\n      \u003Ch2>Something went wrong\u003C\u002Fh2>\n      \u003Cbutton onClick={() => reset()}>Try again\u003C\u002Fbutton>\n    \u003C\u002Fdiv>\n  )\n}\n```\n\n## Official Documentation\n\n- [Next.js Documentation](https:\u002F\u002Fnextjs.org\u002Fdocs)\n- [App Router](https:\u002F\u002Fnextjs.org\u002Fdocs\u002Fapp\u002Fgetting-started)\n- [Routing](https:\u002F\u002Fnextjs.org\u002Fdocs\u002Fapp\u002Fbuilding-your-application\u002Frouting)\n- [Data Fetching](https:\u002F\u002Fnextjs.org\u002Fdocs\u002Fapp\u002Fbuilding-your-application\u002Fdata-fetching)\n- [Rendering](https:\u002F\u002Fnextjs.org\u002Fdocs\u002Fapp\u002Fbuilding-your-application\u002Frendering)\n- [Caching](https:\u002F\u002Fnextjs.org\u002Fdocs\u002Fapp\u002Fbuilding-your-application\u002Fcaching)\n- [Deploying](https:\u002F\u002Fnextjs.org\u002Fdocs\u002Fapp\u002Fgetting-started\u002Fdeploying)\n- [Upgrading](https:\u002F\u002Fnextjs.org\u002Fdocs\u002Fapp\u002Fguides\u002Fupgrading)\n- [GitHub: Next.js](https:\u002F\u002Fgithub.com\u002Fvercel\u002Fnext.js)\n",{"name":5,"metadata":24,"description":7},{"docs":25,"sitemap":28,"priority":29,"bashPatterns":30,"pathPatterns":38,"promptSignals":54},[26,27],"https:\u002F\u002Fnextjs.org\u002Fdocs","https:\u002F\u002Fnextjs.org\u002Fdocs\u002Fapp","https:\u002F\u002Fnextjs.org\u002Fsitemap.xml",5,[31,32,33,34,35,36,37],"\\bnext\\s+(dev|build|start|lint)\\b","\\bnext\\s+experimental-analyze\\b","\\bnpx\\s+create-next-app\\b","\\bbunx\\s+create-next-app\\b","\\bnpm\\s+run\\s+(dev|build|start)\\b","\\bpnpm\\s+(dev|build)\\b","\\bbun\\s+run\\s+(dev|build)\\b",[39,40,41,42,43,44,45,46,47,48,49,50,51,52,53],"next.config.*","next-env.d.ts","app\u002F**","pages\u002F**","src\u002Fapp\u002F**","src\u002Fpages\u002F**","tailwind.config.*","postcss.config.*","tsconfig.json","tsconfig.*.json","apps\u002F*\u002Fapp\u002F**","apps\u002F*\u002Fpages\u002F**","apps\u002F*\u002Fsrc\u002Fapp\u002F**","apps\u002F*\u002Fsrc\u002Fpages\u002F**","apps\u002F*\u002Fnext.config.*",{"allOf":55,"anyOf":62,"noneOf":66,"phrases":67,"minScore":72},[56,59],[57,58],"middleware","next",[60,61],"layout","route",[63,64,65],"pages router","getserversideprops","use server",[],[68,5,69,70,71],"next.js","app router","server component","server action",6,"main","92c2f40ebfad0c0aa3cc1faa89ffd6b23f9e8d1b","official-openai\u002Fopenai-local-vercel-nextjs","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill","https:\u002F\u002Fsd-skill.vercel.app","https:\u002F\u002Fgithub.com\u002Frealsudarshan","sudarshandhakal.com.np","Innvotative","2026-11-12 23:03:50",{"source":8,"skillName":5,"commands":83,"prompt":93,"zipAvailable":94},[84,87,90],{"tool":85,"command":86},"npx","npx skills add realsudarshan\u002FSD-skill --skill nextjs",{"tool":88,"command":89},"bunx","bunx skills add realsudarshan\u002FSD-skill --skill nextjs",{"tool":91,"command":92},"pnpm","pnpm dlx skills add realsudarshan\u002FSD-skill --skill nextjs","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Fofficial-openai\u002Fopenai-local-vercel-nextjs\u002FSKILL.md",true,[96,102],{"path":97,"resourceType":98,"resourceTypeDesc":99,"sizeBytes":100,"sourceHtmlUrl":101},"agents\u002Fopenai.yaml","REFERENCE","参考文档",95,"https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Fofficial-openai\u002Fopenai-local-vercel-nextjs\u002Fagents\u002Fopenai.yaml",{"path":103,"resourceType":98,"resourceTypeDesc":99,"sizeBytes":104,"sourceHtmlUrl":105},"references\u002Fapp-router-files.md",2615,"https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Fofficial-openai\u002Fopenai-local-vercel-nextjs\u002Freferences\u002Fapp-router-files.md",[107,116,124,132,140,148],{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":111,"licenseFileUrl":112,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":19},"01M7CW5Y6EPMPMNDWE4EN2GXRX","winui-app","Bootstrap, develop, and design modern WinUI 3 desktop applications with C# and the Windows App SDK using official Microsoft guidance, WinUI Gallery patterns, Windows App SDK samples, and CommunityToolkit components. Use when creating a brand new app, preparing a machine for WinUI, reviewing, refactoring, planning, troubleshooting, environment-checking, or setting up WinUI 3 XAML, controls, navigation, windowing, theming, accessibility, responsiveness, performance, deployment, or related Windows app design and development work.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Freccomended\u002Fwinui-app\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Freccomended\u002Fwinui-app\u002FSKILL.md",[],[],{"skillNo":117,"name":118,"nameZh":6,"description":119,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":120,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":19},"01M7CW5RWFX7616ENEG573VFWG","vercel-deploy","Deploy applications and websites to Vercel. Use when the user requests deployment actions like \"deploy my app\", \"deploy and give me the link\", \"push this live\", or \"create a preview deployment\".","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Freccomended\u002Fvercel-deploy\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Freccomended\u002Fvercel-deploy\u002FSKILL.md",[],[],{"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":111,"licenseFileUrl":128,"sourceHtmlUrl":129,"categories":130,"keywords":131,"publishedAt":19},"01M7CW5M4VZHQPWG764X1W0S3B","security-best-practices","Perform language and framework specific security best-practice reviews and suggest improvements. Trigger only when the user explicitly requests security best practices guidance, a security review\u002Freport, or secure-by-default coding help. Trigger only for supported languages (python, javascript\u002Ftypescript, go). Do not trigger for general code review, debugging, or non-security tasks.","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Freccomended\u002Fsecurity-best-practices\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Freccomended\u002Fsecurity-best-practices\u002FSKILL.md",[],[],{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":111,"licenseFileUrl":136,"sourceHtmlUrl":137,"categories":138,"keywords":139,"publishedAt":19},"01M7CW5EBTWA7PQ54HYFT1YW39","playwright","Use when the task requires automating a real browser from the terminal (navigation, form filling, snapshots, screenshots, data extraction, UI-flow debugging) via `playwright-cli` or the bundled wrapper script.","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Freccomended\u002Fplaywright\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Freccomended\u002Fplaywright\u002FSKILL.md",[],[],{"skillNo":141,"name":142,"nameZh":6,"description":143,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":111,"licenseFileUrl":144,"sourceHtmlUrl":145,"categories":146,"keywords":147,"publishedAt":19},"01M7CW4DA7SZ4D9JMR3P7VJVM0","openai-docs","Use when the user asks how to build with OpenAI products or APIs and needs up-to-date official documentation with citations, help choosing the latest model for a use case, or model upgrade and prompt-upgrade guidance; prioritize OpenAI docs MCP tools, use bundled references only as helper context, and restrict any fallback browsing to official OpenAI domains.","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Freccomended\u002Fopenai-docs\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Freccomended\u002Fopenai-docs\u002FSKILL.md",[],[],{"skillNo":149,"name":150,"nameZh":6,"description":151,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":111,"licenseFileUrl":152,"sourceHtmlUrl":153,"categories":154,"keywords":155,"publishedAt":19},"01M7CW3EHY7X60KB9SYEMRD3YR","netlify-deploy","Deploy web projects to Netlify using the Netlify CLI (`npx netlify`). Use when the user asks to deploy, host, publish, or link a site\u002Frepo on Netlify, including preview and production deploys.","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Freccomended\u002Fnetlify-deploy\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Frealsudarshan\u002FSD-skill\u002Fblob\u002Fmain\u002Freccomended\u002Fnetlify-deploy\u002FSKILL.md",[],[]]