next-best-practices
Originally fromvercel-labs/next-skills
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. Useexport function proxy(request: NextRequest)andexport 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: trueand"use cache"directive; PPR-ready - Async APIs:
params,searchParams,cookies(),headers()are async; useawait - Caching:
revalidateTag(tag, profile)requires second arg;updateTag()in Server Actions for read-your-writes;refresh()for uncached data
File Conventions
Related skills
More from blockmatic/basilic
hey api codegen
|
37typebox + fastify
|
32ai sdk v6 ui
|
32typescript-advanced-patterns
Advanced TypeScript patterns for type-safe, maintainable code using sophisticated type system features. Use when building type-safe APIs, implementing complex domain models, or leveraging TypeScript's advanced type capabilities.
28drizzle orm
|
28emilkowal-animations
Emil Kowalski's animation best practices for web interfaces. Use when writing, reviewing, or implementing animations in React, CSS, or Framer Motion. Triggers on tasks involving transitions, easing, gestures, toasts, drawers, or motion.
27