next-best-practices

Installation
SKILL.md

Next.js v16 Best Practices

Apply these rules when writing or reviewing Next.js 16+ code.

Scope

Target: Next.js 16+, App Router, Node.js 20.9+, TypeScript 5+.

Next.js 16 Patterns

  • proxy.ts: Replaces middleware.ts. Runs on Node.js runtime. Use export function proxy(request: NextRequest) and export const config = { matcher }. Same redirect/rewrite/headers/cookies APIs. Migration: npx @next/codemod@canary middleware-to-proxy .
  • Turbopack: Default bundler; opt out with next build --webpack, next dev --webpack
  • Cache Components: Opt-in via cacheComponents: true and "use cache" directive; PPR-ready
  • Async APIs: params, searchParams, cookies(), headers() are async; use await
  • Caching: revalidateTag(tag, profile) requires second arg; updateTag() in Server Actions for read-your-writes; refresh() for uncached data

File Conventions

Related skills
Installs
22
GitHub Stars
88
First Seen
Jan 31, 2026