accessibility
FreeEnsure accessibility in UI components including semantic HTML, ARIA attributes, keyboard navigation, and WCAG 2.2 AA compliance.
The English summary is being prepared. Showing the original description.
Structured workflow for upgrading Next.js applications across major versions. Use when migrating a Next.js project from one major version to another (e.g., 13 to 14, 14 to 15, 15 to 16). Covers codemod automation, breaking change detection, incremental migration paths, and post-upgrade validation.
The English summary is being prepared. Showing the original description.
Review the instructions the agent will receive before you install.
Structured 9-step workflow for upgrading Next.js applications across major versions. Handles codemod automation, dependency updates, breaking change resolution, and validation.
Use this skill when:
Identify the current Next.js version and target version.
# Check current version
cat package.json | grep '"next"'
# Check Node.js version (Next.js 15+ requires Node 18.18+, Next.js 16 requires Node 20+)
node --version
Version Requirements:
| Next.js | Minimum Node.js | Minimum React |
|---|---|---|
| 13 | 16.14 | 18.2.0 |
| 14 | 18.17 | 18.2.0 |
| 15 | 18.18 | 19.0.0 |
| 16 | 20.0 | 19.0.0 |
git checkout -b upgrade/nextjs-{target-version}
Always upgrade on a dedicated branch. Never upgrade on main directly.
Use the official Next.js codemod CLI to automate breaking change migrations.
# Interactive mode (recommended) -- selects applicable codemods
npx @next/codemod@latest upgrade latest
# Or target a specific version
npx @next/codemod@latest upgrade 15
npx @next/codemod@latest upgrade 16
Key Codemods by Version:
next-image-to-legacy-image -- Renames next/image imports to next/legacy/imagenext-image-experimental -- Migrates from next/legacy/image to new next/imagemetadata -- Moves Head metadata to Metadata API exportsnext-async-request-apis -- Converts synchronous dynamic APIs (cookies(), headers(), params, searchParams) to asyncnext-dynamic-ssr-false -- Replaces ssr: false with { loading } pattern for next/dynamicnext-og-import -- Moves OG image generation imports to next/ognext-use-cache -- Converts unstable_cache to 'use cache' directivenext-cache-life -- Migrates cache revalidation to cacheLife() APInext-form -- Wraps <form> elements with next/form where applicable# Update Next.js and React together
npm install next@latest react@latest react-dom@latest
# For Next.js 15+, also update React types
npm install -D @types/react@latest @types/react-dom@latest
# Update eslint config
npm install -D eslint-config-next@latest
Peer Dependency Conflicts:
If you encounter peer dependency conflicts:
--legacy-peer-deps only as a last resort (document why)Review and update next.config.js / next.config.ts:
// next.config.ts (Next.js 15+ recommends TypeScript config)
import type { NextConfig } from 'next';
const nextConfig: NextConfig = {
// Next.js 15+: experimental features that graduated
// Remove these from experimental:
// - serverActions (now stable in 14+)
// - appDir (now stable in 14+)
// - ppr (now stable in 16+)
// Next.js 16+: new cache configuration
cacheComponents: true, // Enable component-level caching
};
export default nextConfig;
Configuration Changes by Version:
| Version | Change |
|---|---|
| 14 | appDir removed from experimental (now default) |
| 14 | serverActions removed from experimental (now stable) |
| 15 | bundlePagesRouterDependencies now default true |
| 15 | swcMinify removed (now always enabled) |
| 16 | dynamicIO replaces several caching behaviors |
| 16 | cacheComponents: true enables component caching |
After running codemods, manually resolve remaining breaking changes.
Common Breaking Changes (15 to 16):
Async Request APIs: cookies(), headers(), params, searchParams are now async
// Before (Next.js 14)
export default function Page({ params }: { params: { id: string } }) {
const { id } = params;
}
// After (Next.js 15+)
export default async function Page({ params }: { params: Promise<{ id: string }> }) {
const { id } = await params;
}
Caching Default Changed: fetch() requests are no longer cached by default in Next.js 15+
// Before: cached by default
fetch('https://api.example.com/data');
// After: explicitly opt-in to caching
fetch('https://api.example.com/data', { cache: 'force-cache' });
// Or use 'use cache' directive in Next.js 16
Route Handlers: GET route handlers are no longer cached by default
// Next.js 15+: explicitly set caching
export const dynamic = 'force-static';
# Run existing test suite
npm test
# Run build to catch compile-time errors
npm run build
# Run dev server and check key pages manually
npm run dev
Validation Checklist:
# Regenerate TypeScript declarations
npm run build
# Fix any new type errors
npx tsc --noEmit
Common Type Fixes:
PageProps type changes (params/searchParams become Promise in 15+)Metadata type updates (new fields added)NextRequest/NextResponse API changes# Create detailed commit
git add -A
git commit -m "chore: upgrade Next.js from {old} to {new}
Breaking changes resolved:
- [list specific changes]
Codemods applied:
- [list codemods run]
Manual fixes:
- [list manual changes]"
For large version jumps (e.g., 13 to 16), upgrade incrementally:
Next.js 13 -> 14 -> 15 -> 16
Why incremental?
For each version step:
.next directory: rm -rf .nextrm -rf node_modules && npm installrm -rf .next/cacheNextResponse.rewrite() behavior changed in 15--legacy-peer-deps without documenting the specific conflict and resolution plan — suppressing peer errors hides version conflicts that will cause runtime failures.| Anti-Pattern | Why It Fails | Correct Approach |
|---|---|---|
| Upgrading on the main branch directly | Half-migrated code can reach production; rollback requires a revert commit | Always create upgrade/nextjs-{version} branch; merge only after full validation |
| Skipping intermediate versions | Version-specific codemods are not composable; skipped breaking changes cause runtime failures | Upgrade one major version at a time: 13→14→15→16; commit a checkpoint at each step |
| Manual migration before running codemods | Creates divergence from codemod output; codemods cannot merge cleanly with manual edits | Run codemods first; apply manual fixes only for patterns codemods could not handle |
Using --legacy-peer-deps without documentation | Hidden version conflicts cause runtime failures not visible at install time | Resolve conflicts explicitly; use the flag only with a documented justification |
| Validating only in dev mode | Dev server skips SSG, edge runtime, and build optimizations that can fail post-upgrade | Run npm run build plus the full test suite; check SSR, SSG, and API routes explicitly |
No reviews yet. Tell others what you thought.
No login needed. Share how it worked for you, ask a question, or note where it did not run.
No comments yet. Be the first to write one.
Ensure accessibility in UI components including semantic HTML, ARIA attributes, keyboard navigation, and WCAG 2.2 AA compliance.
The English summary is being prepared. Showing the original description.
Use when you want to improve response quality through meta-cognitive reasoning. Applies 15+ reasoning methods to reconsider and refine initial outputs.
The English summary is being prepared. Showing the original description.
N-round opposing-stance debates for trade-off analysis. Assigns pro/con roles to agents, runs structured debate rounds with quality scoring, and produces a moderator synthesis with confidence-rated recommendation. Generalizable to architecture, technology, security, and design decisions.
The English summary is being prepared. Showing the original description.
Force adversarial code review stance that eliminates confirmation bias — reviewer must find issues or re-analyze
The English summary is being prepared. Showing the original description.
Creates specialized AI agents on-demand when no existing agent matches a request. Use when the Router cannot find a suitable agent for a task. Enables self-evolution by generating persistent agents.
The English summary is being prepared. Showing the original description.
LLM-as-judge evaluation framework with 5-dimension rubric (accuracy, groundedness, coherence, completeness, helpfulness) for scoring AI-generated content quality with weighted composite scores and evidence citations
The English summary is being prepared. Showing the original description.