What problem does it solve?
Modern Next.js applications using the App Router introduce many new conventions—file-based routing, server components, server actions, route handlers, middleware, and streaming—that can be confusing and inconsistent across projects. This Skill compiles clear patterns and pragmatic examples to reduce onboarding time, prevent architectural mistakes, and accelerate implementation.
Core Features & Use Cases
- App Router file conventions: Recommended layout, page, loading, error, and private component organization for predictable routes.
- Server components & data fetching: Guidance on async server components, parallel fetching, and streaming with Suspense.
- Server actions & mutations: Patterns for defining server actions, revalidation, and redirects tied to form submissions.
- Route handlers & middleware: Examples for API route handlers, middleware-based auth redirects, and matcher configuration.
- Metadata and server-only modules: Static and dynamic metadata generation and safe usage of server-only imports.
- Use case: Implement a user creation flow that uses a server action to create a user, revalidates the users list, redirects to /users, and protects /dashboard via middleware.
Quick Start
Create an implementation plan and concise code examples for adding a createUser server action, associated API route handler or server action usage, middleware to protect /dashboard, and metadata updates for a Next.js App Router project.