nextjs-framework

Apply Next.js App Router best practices for rendering, caching, and deployment.

59|12|Updated Feb 26, 2026
One-click install
npx skills add https://github.com/etylsarin/opencastle --skill nextjs-framework
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-framework
Source: https://github.com/etylsarin/opencastle/tree/main/src/orchestrator/plugins/nextjs
Command: npx skills add https://github.com/etylsarin/opencastle --skill nextjs-framework

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Many teams struggle with correct App Router structure, rendering choices, server/client component boundaries, caching and revalidation, middleware, and deployment configuration in Next.js which leads to bugs, poor performance, and fragile builds. This Skill consolidates best practices to reduce architectural mistakes, speed development, and improve runtime behavior across routes and API handlers.

Core Features & Use Cases

  • Project Structure & Routing: Guidance on App Router conventions, route groups, dynamic/parallel routes, and where to place shared components and utilities.
  • Rendering & Data Fetching: Advice on choosing between static, ISR, SSR, CSR, and streaming; parallel fetch patterns; Server Actions; and revalidation/tagging strategies.
  • Platform & Deployment: Recommendations for middleware, next.config tuning, image/font optimization, runtime selection (nodejs vs edge), and deployment outputs (Vercel, standalone, Docker).
  • Use Case: Migrate a Pages Router app to the App Router, convert heavy client code to server components, and set per-route caching and revalidation to reduce TTFB and bundle size.

Quick Start

Ask the nextjs-framework skill to review the app directory and recommend per-route rendering, caching, and component boundaries to improve performance and correctness.

Frequently Asked Questions about nextjs-framework

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

FAQPage Schema
How do I structure Next.js App Router pages, layouts, and route handlers for static and dynamic rendering?

Next.js App Router structure relies on route groups, dynamic routes, and parallel routes to organize pages and layouts. You configure per-route static or dynamic rendering by setting appropriate data fetching and caching behaviors within each route segment.

How do I set correct server and client component boundaries in a Next.js app?

Next.js server and client component boundaries separate data fetching from interactivity. You convert heavy client code to server components by default, only marking client components where state, effects, or browser APIs are strictly required.

What is the best way to configure fetch caching and revalidation in Next.js App Router?

Next.js fetch caching and revalidation uses route segment config and fetch options. You apply per-route caching, revalidation tagging, and streaming strategies to reduce Time to First Byte and ensure data freshness across API handlers.

How do I migrate a Next.js Pages Router app to the App Router?

Migrating a Next.js Pages Router app to the App Router involves mapping pages to app directory layouts, converting data fetching to server components, and updating middleware matchers to align with new routing conventions.

Does Next.js middleware work with both Node.js and Edge runtimes for deployment?

Next.js middleware supports Edge runtime execution and requires specific matchers to filter requests. You select between Node.js and Edge runtimes in next.config to tune image, font optimization, and deployment outputs for Vercel, standalone, or Docker.

Why does my Next.js App Router build fail with incorrect server and client component boundaries?

Next.js App Router builds fail when server components attempt to use client-only APIs or client components perform direct database access. You diagnose rendering and performance issues by reviewing component boundaries and ensuring correct server/client separation.