# Next.js 16 + React 19 Production Pack

> Seven agent skills and three CI-ready checks that make your AI agent ship Next.js 16 right: Cache Components, Server Actions security, Web Vitals, upgrades.

Next.js 16 + React 19 Production Pack is a paid AI agent skill on Agensi by Abdalkader Alhamoud, in Frontend & Web Apps. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $24 (one-time purchase)
- Creator: [Abdalkader Alhamoud](https://www.agensi.io/creators/abdalkaderdev)
- Category: [Frontend & Web Apps](https://www.agensi.io/skills/frontend-web-apps)
- Version: 1.0
- Last updated: 2026-10-13
- Security: scan passed (2026-10-13); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/next-js-16-react-19-production-pack
- Tags: web-design, code-review, security, next16, react19, app-router, server-components, server-actions

## About this skill

Agents write a Next.js page fine. They get production wrong, because most of what they learned describes Next.js 13 to 15: `export const dynamic = 'force-dynamic'` next to `cacheComponents: true` (build error), `cookies()` inside `'use cache'` (fails at request time, after the build passed), `revalidateTag('posts')` with one argument (deprecated and a type error), `redirect()` inside a `try` block (swallowed, the user never moves), Server Actions with no auth check because "the page is protected by middleware", whole database rows passed to Client Components, `middleware.ts` renamed to `proxy.ts` even though it needed the Edge runtime, `priority` on images that now wants `preload`, `quality={80}` that the 16 optimizer rejects with a 400, `notFound()` inside Suspense that quietly returns 200, and a Next.js 14 app left on a line that received no fixes for 2026's RCE and SSRF advisories.

This pack gives the agent current rules, checked against the docs bundled in `next@16.4.0`, npm, react.dev and GitHub security advisories, and proven in a real 16.4.0 app:

- **nextjs-production**: routing between skills, pre-flight checklist, current versions, the 2026 security floor, version boundaries from 15.0 to 16.4.
- **nextjs-app-router**: Server/Client boundaries, async `params` with `PageProps` / `LayoutProps` / `RouteContext`, Suspense placement, `error.tsx` `retry`, `catchError`, parallel routes and 16.4 strict matching, `proxy.ts`, route handlers, metadata, React 19.3 (`ViewTransition`, Fragment refs, `browser()`).
- **nextjs-caching**: Cache Components, `use cache` and its `private` / `remote` variants, `cacheLife` prerender thresholds, `updateTag` vs `revalidateTag(tag, 'max')` vs `refresh`, a verified webhook handler, `partialPrefetching`, `instant`, `ensureStatic`, and a migration table from the old segment configs.
- **nextjs-server-actions**: `useActionState` forms with zod 4, auth and ownership inside every action, mass assignment, DAL with `server-only`, the CSRF origin check tested with forged and missing `Origin` headers, `allowedOrigins`, encryption keys, deployment skew.
- **nextjs-performance**: LCP/INP/CLS diagnosis, `next/image` 16 defaults with verified 400s, `next/font`, `next/script`, `next analyze`, React Compiler, field vitals reporting.
- **nextjs-migration**: every breaking change from 14 to 15 to 16 with its codemod, Turbopack and custom webpack, removed config, Pages Router to App Router mapping.
- **nextjs-self-hosting**: standalone output and Docker (verified), env vars at build vs runtime, cache handlers and multi-instance tag coordination, CDN headers, nginx streaming, CSP with and without nonces, advisories for self-hosters.

Three zero-dependency Node scripts, each with `--json` and a non-zero exit for CI: `audit-upgrade.mjs` (security floor, versions, removed config, middleware, sync request APIs, image props, parallel defaults), `lint-cache.mjs` (runtime APIs in cached scopes, missing `cacheLife`, segment config conflicts, one-argument `revalidateTag`, `updateTag` outside actions), and `check-server-actions.mjs` (missing auth and validation, raw records returned, `Object.fromEntries(formData)`, `redirect` in `try`, invalid `'use server'` exports, secret env reads in client files).

Works with Claude Code (skills folder or plugin), Codex, Gemini CLI and Cursor. Plain Agent Skills format.

Versions: Next.js 16.4 (notes back to 15.0, migration from 14), React 19.3, React Compiler 1.0, `eslint-config-next` 16.4. Reviewed after every Next.js minor release and every new `next` or React Server Components advisory.

## Requires

- next
- Node.js
- @next/codemod
- tsc
- eslint

## Known limitations

Scripts need Node.js 20+. Targets Next.js 16.4 and React 19.3, verified in a real 16.4 app on 2026-10-14. use cache: remote, custom cache handlers, codemods, Docker images and Pages-to-App migration steps follow the official docs but were not run end to end. Firefox/Safari-specific behaviour was not tested.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Next.js 16 + React 19 Production Pack skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### Why not just ask my agent?

Next.js 16 changed caching (Cache Components, use cache, updateTag), renamed middleware to proxy and moved request APIs to async. Agents trained on 14 and 15 write code that fails the build or caches the wrong thing. The pack has the current rules with the exact build errors, plus three scripts that catch the mistakes before you build.

### Which versions?

next 16.4.0, react and react-dom 19.3.0, checked against npm and the GitHub advisories on 2026-10-14. Security floors: 16.3.8 on 16 and 15.5.27 on 15.

### What is in the zip?

One entry skill with six guides (App Router, caching, Server Actions, performance, migration, self-hosting) and three zero-dependency Node scripts: lint-cache.mjs, check-server-actions.mjs and audit-upgrade.mjs.

### Does it help upgrade from 14 or 15?

Yes. audit-upgrade.mjs flags the security floor, removed config, middleware, sync request APIs, image props and parallel-route defaults, and the migration guide walks the fixes in order.

### Do I need Vercel?

No. There is a self-hosting guide for the standalone server, CDN cache headers and the image optimizer, verified on next start.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
