nextjs-performance-architect

Audits and optimizes Next.js App Router applications for caching, rendering, bundles, and Core Web Vitals.

1|Updated Aug 25, 2026
One-click install
npx skills add https://github.com/sabiscore/swarmxq --skill nextjs-performance-architect-sabiscore
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-performance-architect
Source: https://github.com/sabiscore/swarmxq/tree/main/.ai/skills/nextjs-performance-architect
Command: npx skills add https://github.com/sabiscore/swarmxq --skill nextjs-performance-architect-sabiscore

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Next.js App Router performance issues are hard to diagnose because RSC boundaries, the four cache layers, and PPR semantics are counterintuitive. This Skill provides a structured audit protocol that pinpoints slow LCP, bloated bundles, misconfigured caching, and incorrect server/client component splits. ## Core Features & Use Cases - RSC Architecture Audit: Detects anti-patterns like 'use client' at layout roots, sequential await waterfalls, and client-side fetching, then provides corrected parallel-fetch patterns. - Caching Strategy Generation: Produces explicit fetch cache configs (force-cache, revalidate, no-store, revalidateTag) across all four Next.js cache layers. - PPR, Turbopack & Bundle Analysis: Guides Partial Prerendering setup with Suspense boundaries, Turbopack migration, and bundle analyzer interpretation. - Core Web Vitals Fixes: Concrete code patterns for LCP (<2.5s), CLS (<0.1), and INP (<200ms) targets. - Use Case: A user says "my Next.js dashboard is slow." The Skill audits the page, finds a 'use client' root and sequential fetches, rewrites it as an RSC with Promise.all and Suspense streaming, and sets ISR revalidation. ## Quick Start Ask the assistant to audit your Next.js page or app directory for performance problems and generate optimized caching and rendering configurations.

Frequently Asked Questions about nextjs-performance-architect

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

FAQPage Schema
How do I fix a slow Next.js App Router page?

Start by identifying the main complaint: slow LCP, large bundle, slow API response, or stale data. Then audit for anti-patterns like 'use client' at the layout root, sequential await fetches, and missing cache directives, and apply parallel fetching with explicit cache strategies.

When should I use RSC vs 'use client' in Next.js?

Use Server Components by default for anything non-interactive. Add 'use client' only at leaf components that need useState, useEffect, event handlers, or browser APIs, since placing it at a layout or page root strips RSC benefits from the entire subtree.

How does caching work in Next.js 15 App Router?

Next.js has four cache layers: request memoization, Data Cache, Full Route Cache, and Router Cache. Since Next.js 15, fetch defaults to no-store, so you must explicitly set cache: 'force-cache' or next: { revalidate: N } to get caching behavior.

Does Next.js Partial Prerendering work with dynamic data?

Yes. PPR prerenders a static shell at build time and streams dynamic content through Suspense boundaries per request. Dynamic holes must be wrapped in Suspense, and static parts must not call cookies(), headers(), or Math.random().

Why is my Next.js bundle size so large?

Common causes are client components importing heavy libraries, barrel imports like import * from icon packs, and date libraries such as moment. Run ANALYZE=true with @next/bundle-analyzer, use named imports, and move non-interactive logic to Server Components.

What are good Core Web Vitals targets for Next.js?

Target LCP under 2.5 seconds, CLS under 0.1, and INP under 200ms. Use next/image with priority on the LCP image, explicit width and height to prevent layout shift, and startTransition to keep heavy updates off the interaction path.