nextjs

Optimize Next.js 16 App Router caching, rendering, and routing performance.

1|Updated Apr 13, 2026
One-click install
npx skills add https://github.com/yahav123147/paid-ads-cro-skills --skill nextjs-yahav123147
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs
Source: https://github.com/yahav123147/paid-ads-cro-skills/tree/main/skills/nextjs
Command: npx skills add https://github.com/yahav123147/paid-ads-cro-skills --skill nextjs-yahav123147

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Next.js 16 App Router codebases often suffer from slow builds, inefficient caching, and suboptimal rendering patterns that increase latency and hurt UX; this skill provides a structured set of best practices to prevent those issues.

Core Features & Use Cases

  • Build & bundle optimization: improve dev startup and bundle size by avoiding slow import patterns and enabling framework-specific optimizations like Turbopack caching and dynamic imports.
  • Caching strategy guidance: choose the right caching mode (force-cache, no-store, revalidation, tags, and the use cache directive) and invalidate correctly after mutations.
  • Server-first architecture for performance: apply Server Components patterns such as parallel fetching, streaming with Suspense, server data colocation, and resilient error handling.
  • Routing & navigation performance: design App Router structures using parallel routes, intercepting routes, prefetching strategy, notFound handling, and proxy.ts network boundaries.
  • Production-grade metadata and UX loading states: implement route-level loading.tsx and error.tsx behaviors and generate dynamic SEO metadata.

Quick Start

Apply the nextjs skill to my Next.js 16 App Router code by reviewing caching, rendering, routing, and streaming choices and rewriting the relevant sections to follow the highest-impact rules in AGENTS.md.

Frequently Asked Questions about nextjs

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

FAQPage Schema
How do I optimize Next.js 16 App Router caching and revalidation?

Next.js 16 App Router caching is optimized by choosing correct fetch strategies like force-cache or no-store, applying the 'use cache' directive, and invalidating mutations using revalidatePath and revalidateTag.

What is the best way to implement Suspense streaming in Server Components?

Suspense streaming in Server Components is implemented by wrapping asynchronous fetches in Suspense boundaries to progressively stream HTML, improving perceived loading performance with resilient error handling and route loading states.

Does this Next.js skill work with Turbopack build optimizations?

Yes, this skill guides Next.js 16 build and bundle optimization by enabling Turbopack caching and dynamic imports to improve dev startup and reduce bundle size by avoiding slow import patterns.

How do I handle dynamic SEO metadata in Next.js App Router?

Handle dynamic SEO metadata in the Next.js App Router by generating route-level metadata using Next.js 16 specific APIs, ensuring it follows server-first rendering patterns and correct client boundaries.

Why are my Next.js App Router builds slow and how can I fix them?

Slow Next.js App Router builds are often caused by inefficient caching and slow import patterns. Fix them by applying Turbopack caching, dynamic imports, and correct server data colocation to reduce latency.

When should I use Server Actions for mutations in Next.js?

Use Server Actions for mutations in Next.js when you need to update server-side data and invalidate caches correctly, applying revalidatePath and revalidateTag after mutations to ensure fresh data.