skills/nextjs/nextjs-app-router/SKILL.md
Configure file-system routing with nested layouts, route groups, parallel routes, and error boundaries in Next.js App Router. Use when creating page routes, adding loading/error states, or organizing routes with groups and dynamic segments.
npx skillsauth add hoangnguyen0403/agent-skills-standard nextjs-app-routerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
app/dashboard/page.tsx as Server Component.app/dashboard/layout.tsx returning {children}.app/dashboard/loading.tsx for Suspense boundary.app/dashboard/error.tsx with 'use client' and reset prop.await params, cookies(), headers().See implementation examples
app/ directory. Define routes with app/dashboard/layout.tsx returning {children}; shared UI nests inside app/layout.tsx automatically. Handle states with loading.tsx, error.tsx, and not-found.tsx.(auth)) to excluded from URL path. Use Dynamic Routes (brackets [slug]) and define static paths via generateStaticParams.@modal) by adding slot to parent layout and providing default.tsx fallback. Use Intercepting Routes ((.)route) for advanced layouts like dashboards.await params: Promise, searchParams, cookies(), and headers().middleware.ts for edge-side authentication and redirection. Ensure all Route Handlers (route.ts) secured with appropriate auth checks.'use client' at leaf nodes for interactivity (hooks/events).app/dashboard/loading.tsx to auto-wrap routes in Suspense boundary. In error.tsx, use 'use client' and provide reset: () => void function.(auth) to organize without affecting URL path._lib to exclude from routing.[slug] or [...slug] (catch-all).@folder): Render multiple pages in same layout. Use default.tsx for fallback.(..)folder): Load routes within current layout context.app/layout.tsx) for <html> and <body> tags.params, cookies(), headers() Promises in Next.js 15+; always await.'use client' at tree root: Place at leaves; keep layouts and pages as Server Components.<html>/<body> in nested layouts: Only app/layout.tsx (root layout) should include them.error.tsx: Every route segment needs Client Component error boundary.testing
Infer the requesting operator's technical fluency from message content (never ask directly) and adapt register — business, hybrid, or technical — across SDLC workflow output. Use when starting sdlc, brainstorm-feature, plan-feature, verify-work, publish-notes, or session-report, or whenever a request's phrasing signals a non-technical or cross-stack operator.
documentation
Define transaction boundaries, locking, and consistency guarantees for multi-step writes. Use when designing atomic operations, retries, idempotency, or concurrent write behavior.
development
Design relational or document schemas from access patterns, cardinality, and lifecycle. Use when modeling entities, choosing embed vs normalize, or shaping schema boundaries before implementation.
data-ai
Diagnose database latency with explain plans, index ownership, and query-shape review. Use when a query is slow, an index is missing, or scans and N+1 patterns appear.