| name | reviewing-nextjs-16-patterns |
| description | Review code for Next.js 16 compliance - security patterns, caching, breaking changes. Use when reviewing Next.js code, preparing for migration, or auditing for violations. Use when this capability is needed. |
| metadata | {"author":"djankies"} |
Next.js 16 Patterns Review
Comprehensive review for Next.js 16 compliance covering security vulnerabilities, caching patterns, breaking changes, and migration readiness.
Review Process
For comprehensive security review patterns, use the reviewing-security skill from the review plugin. For dependency auditing, use the reviewing-dependencies skill from the review plugin.
1. Security Audit
CVE-2025-29927 - Server Action Authentication
Check all Server Actions for proper authentication:
grep -r "use server" --include="*.ts" --include="*.tsx" --include="*.js" --include="*.jsx"
For each Server Action verify:
Middleware Security
find . -name "middleware.ts" -o -name "middleware.js"
Verify:
Server Component Data Access
grep -r "export default async function" app/
Check each Server Component:
2. Caching Patterns
use cache Adoption
grep -r "fetch(" --include="*.ts" --include="*.tsx"
grep -r "export async function" --include="*.ts"
Verify:
Cache Lifecycle Configuration
Check for proper cache profiles:
Revalidation Strategy
grep -r "revalidateTag\|revalidatePath" --include="*.ts" --include="*.tsx"
Verify:
3. Breaking Changes
Async Request APIs
grep -r "cookies()\|headers()\|params\|searchParams" --include="*.ts" --include="*.tsx"
Check for required async usage:
Middleware to Proxy Migration
grep -r "NextResponse.rewrite\|NextResponse.redirect" middleware.ts
Verify migration:
Route Handler Changes
find app -name "route.ts" -o -name "route.js"
Check each route handler:
generateStaticParams Changes
grep -r "generateStaticParams" --include="*.ts" --include="*.tsx"
Verify:
4. Migration Verification
Dependency Updates
Check package.json:
Configuration Updates
Check next.config.js:
Build Validation
Run and verify:
npm run build
Runtime Testing
Violation Severity
Critical
- Missing authentication in Server Actions (CVE-2025-29927)
- Synchronous cookies()/headers() calls
- Security middleware removed or broken
High
- Missing cache directives on expensive operations
- Incorrect async params usage
- Broken revalidation strategy
Medium
- Using deprecated unstable_cache
- Middleware patterns that should be proxies
- Missing cache lifecycle configuration
Nitpick
- Suboptimal cache profiles
- Missing cache tags for fine-grained invalidation
- Legacy fetch caching patterns
Best Practices
- Run security audit first - Critical vulnerabilities take priority
- Group related violations - Fix all async API issues together
- Test incrementally - Verify each category before moving on
- Document decisions - Record why certain patterns were chosen
- Update documentation - Keep project docs current with Next.js 16 patterns
Converted and distributed by TomeVault — claim your Tome and manage your conversions.