nextjs-15

Document Next.js App Router patterns for routing, server components, and middleware.

Updated Mar 23, 2026
One-click install
npx skills add https://github.com/giruclawbot/giru-backup --skill nextjs-15-giruclawbot
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-15
Source: https://github.com/giruclawbot/giru-backup/tree/main/skills/nextjs-15
Command: npx skills add https://github.com/giruclawbot/giru-backup --skill nextjs-15-giruclawbot

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about nextjs-15

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure files when using the Next.js App Router?

Next.js App Router file structure conventions dictate organizing layouts, pages, loading, and error files hierarchically. Separating private components into dedicated folders ensures predictable routing and prevents architectural mistakes during project implementation.

How do I create a server action in Next.js to handle form mutations?

Creating a server action in Next.js involves defining an async function to process form mutations like user creation. You must implement revalidation to refresh data caches and use redirects to navigate users after the server action successfully completes.

What is the best way to protect a dashboard route with middleware in Next.js?

Protecting a dashboard route with middleware in Next.js requires configuring a matcher to target specific paths. You write logic inside the middleware function to check authentication and redirect unauthorized users away from protected routes.

How do I fetch data and stream UI components in Next.js server components?

Fetching data and streaming UI in Next.js server components uses async functions for parallel data fetching. Wrapping dynamic page sections with React Suspense enables streaming, allowing the UI to render progressively as data resolves.

Can I generate dynamic metadata for my pages using the Next.js App Router?

You can generate dynamic metadata for pages using the Next.js App Router by exporting a generateMetadata function. This function accesses route parameters to dynamically produce page titles and descriptions for SEO purposes.

Does Next.js App Router support API route handlers alongside server actions?

Next.js App Router fully supports API route handlers alongside server actions. Route handlers provide templates for building REST endpoints within the App Router, offering an alternative to server actions for handling external API requests.