install
source · Clone the upstream repo
git clone https://github.com/ComeOnOliver/skillshub
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ComeOnOliver/skillshub "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/pproenca/dot-skills/nextjs" ~/.claude/skills/comeonoliver-skillshub-nextjs && rm -rf "$T"
manifest:
skills/pproenca/dot-skills/nextjs/SKILL.mdsource content
Next.js Community Next.js 16 App Router Best Practices
Comprehensive performance optimization guide for Next.js 16 App Router applications, maintained by the Next.js Community. Contains 40 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.
When to Apply
Reference these guidelines when:
- Writing new Next.js 16 App Router code
- Configuring caching strategies with 'use cache' directive
- Implementing server components and data fetching
- Setting up routing with parallel and intercepting routes
- Creating server actions for form handling and mutations
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Build & Bundle Optimization | CRITICAL | |
| 2 | Caching Strategy | CRITICAL | |
| 3 | Server Components & Data Fetching | HIGH | |
| 4 | Routing & Navigation | HIGH | |
| 5 | Server Actions & Mutations | MEDIUM-HIGH | |
| 6 | Streaming & Loading States | MEDIUM | |
| 7 | Metadata & SEO | MEDIUM | |
| 8 | Client Components | LOW-MEDIUM | |
Quick Reference
1. Build & Bundle Optimization (CRITICAL)
- Configure optimizePackageImports for Icon Librariesbuild-optimize-package-imports
- Use Dynamic Imports for Heavy Componentsbuild-dynamic-imports
- Avoid Barrel File Imports in App Routerbuild-barrel-files
- Enable Turbopack File System Cachingbuild-turbopack-config
- Configure Server External Packages for Node Dependenciesbuild-external-packages
2. Caching Strategy (CRITICAL)
- Use the 'use cache' Directive for Explicit Cachingcache-use-cache-directive
- Use revalidateTag with cacheLife Profilescache-revalidate-tag
- Configure Fetch Cache Options Correctlycache-fetch-options
- Use revalidatePath for Route-Level Cache Invalidationcache-revalidate-path
- Use React cache() for Request Deduplicationcache-react-cache
- Configure Route Segment Caching with Exportscache-segment-config
3. Server Components & Data Fetching (HIGH)
- Fetch Data in Parallel in Server Componentsserver-parallel-fetching
- Stream Server Components for Progressive Loadingserver-component-streaming
- Colocate Data Fetching with Componentsserver-data-colocation
- Use Preload Pattern for Critical Dataserver-preload-pattern
- Avoid Client-Side Data Fetching for Initial Dataserver-avoid-client-fetching
- Handle Server Component Errors Gracefullyserver-error-handling
4. Routing & Navigation (HIGH)
- Use Parallel Routes for Independent Contentroute-parallel-routes
- Use Intercepting Routes for Modal Patternsroute-intercepting-routes
- Configure Link Prefetching Appropriatelyroute-prefetching
- Use proxy.ts for Network Boundary Logicroute-proxy-ts
- Use notFound() for Missing Resourcesroute-not-found
5. Server Actions & Mutations (MEDIUM-HIGH)
- Use Server Actions for Form Submissionsaction-server-action-forms
- Show Pending States with useFormStatusaction-pending-states
- Handle Server Action Errors Gracefullyaction-error-handling
- Use Optimistic Updates for Instant Feedbackaction-optimistic-updates
- Revalidate Cache After Mutationsaction-revalidation
6. Streaming & Loading States (MEDIUM)
- Place Suspense Boundaries Strategicallystream-suspense-boundaries
- Use loading.tsx for Route-Level Loading Statesstream-loading-tsx
- Use error.tsx for Route-Level Error Boundariesstream-error-tsx
- Match Skeleton Dimensions to Actual Contentstream-skeleton-matching
- Nest Suspense for Progressive Disclosurestream-nested-suspense
7. Metadata & SEO (MEDIUM)
- Use generateMetadata for Dynamic Metadatameta-generate-metadata
- Generate Sitemaps Dynamicallymeta-sitemap
- Configure Robots for Crawl Controlmeta-robots
- Generate Dynamic OpenGraph Imagesmeta-opengraph-images
8. Client Components (LOW-MEDIUM)
- Minimize 'use client' Boundary Scopeclient-use-client-boundary
- Pass Server Components as Children to Client Componentsclient-children-pattern
- Avoid Hydration Mismatchesclient-hydration-mismatch
- Load Third-Party Scripts Efficientlyclient-third-party-scripts
How to Use
Read individual reference files for detailed explanations and code examples:
- Section definitions - Category structure and impact levels
- Rule template - Template for adding new rules
- build-dynamic-imports - Example rule file
- cache-use-cache-directive - Example rule file
Related Skills
- For React 19 fundamentals, see
skillreact-19 - For data fetching patterns, see
skilltanstack-query - For client-side forms, see
skillreact-hook-form
Full Compiled Document
For the complete guide with all rules expanded:
AGENTS.md