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.development
Standardize SRS and FRS specifications for technical behavior, interfaces, data contracts, quality constraints, and verification mapping. Use when writing SRS, functional specification, system behavior requirements, API/data contracts, or non-functional thresholds.
development
Standardize BRD and BRD-lite discovery for business goals, stakeholder impact, current-to-future state, and measurable value outcomes. Use when creating BRD, business case, project justification, ROI narrative, or AS-IS to TO-BE scope.
development
Implements a strict Red-Green-Refactor loop to ensure zero production code is written without a prior failing test. Use when: creating new features, fixing bugs, or expanding test coverage.
testing
Standardize PRD discovery and drafting for product scope, user outcomes, requirement IDs, and acceptance criteria. Use when creating PRD, product requirements, feature specification, or acceptance criteria plan.