nextjs-best-practices

Guides Next.js App Router development with Server Components, data fetching, and routing patterns.

2|Updated Feb 15, 2026
One-click install
npx skills add https://github.com/SkinnnyJay/simpill-utils --skill nextjs-best-practices-skinnnyjay
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: nextjs-best-practices
Source: https://github.com/SkinnnyJay/simpill-utils/tree/main/.agents/skills/nextjs-best-practices
Command: npx skills add https://github.com/SkinnnyJay/simpill-utils --skill nextjs-best-practices-skinnnyjay

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers building Next.js applications often struggle with deciding between Server and Client Components, choosing the right data fetching strategy, and structuring routes correctly, leading to bloated client bundles and poor performance. ## Core Features & Use Cases - Component Decision Guidance: Provides a decision tree for choosing Server vs Client Components based on interactivity and data fetching needs. - Data Fetching & Caching Patterns: Covers static rendering, ISR revalidation, no-store dynamic fetching, and cache layer controls. - Routing & Project Structure: Documents file conventions (page.tsx, layout.tsx, loading.tsx, error.tsx), route groups, parallel routes, and intercepting routes. - Use Case: When building a dashboard page that fetches database data and includes an interactive form, use this Skill to split the page into a Server Component parent for data fetching and a Client Component child for the form, with proper loading and error boundaries. ## Quick Start Review my Next.js app directory structure and tell me which components should be Server Components and how to set up data fetching with revalidation.

Frequently Asked Questions about nextjs-best-practices

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

FAQPage Schema
How do I decide between Server and Client Components in Next.js?▼

Use Server Components by default for data fetching, layouts, and static content. Add 'use client' only when you need useState, useEffect, or event handlers. For mixed needs, split into a Server parent with a Client child.

How to fetch data in Next.js App Router with caching?▼

Fetch data directly in Server Components using fetch with caching options. Use default static caching for build-time data, revalidate for time-based ISR refresh, and no-store for dynamic per-request data.

What are route groups and parallel routes in Next.js?▼

Route groups using (name) folders organize routes without affecting the URL path. Parallel routes using @slot folders render multiple pages at the same level, while intercepting routes with (.) enable modal overlays.

When should I use Server Actions in Next.js?▼

Use Server Actions for form submissions, data mutations, and revalidation triggers. Mark functions with 'use server', validate all inputs with Zod, return typed responses, and handle errors gracefully.

Why is my Next.js client bundle too large?▼

Large bundles usually come from applying 'use client' everywhere instead of defaulting to Server Components. Use dynamic imports for heavy components, rely on automatic route-based code splitting, and analyze output with a bundle analyzer.