nextjs-best-practices

Installation
Summary

Server Components by default, client interactivity on demand, with structured data fetching and caching strategies.

  • Server Components handle data fetching and static content; Client Components ('use client') manage forms, state, and event handlers. Split responsibilities when both are needed.
  • Data fetching uses static caching by default, with ISR (time-based revalidation) and dynamic (no-store) options for different freshness requirements.
  • Routing relies on file conventions (page.tsx, layout.tsx, loading.tsx, error.tsx) and patterns like route groups, parallel routes, and intercepting routes for modals.
  • Caching operates across three layers: request-level (fetch options), data-level (revalidate/tags), and full-route caching with on-demand or time-based revalidation.
  • Server Actions handle form submissions and mutations with input validation; avoid 'use client' everywhere, large client bundles, and skipping loading/error boundaries.
SKILL.md

Next.js Best Practices

Principles for Next.js App Router development.


1. Server vs Client Components

Decision Tree

Does it need...?
├── useState, useEffect, event handlers
│   └── Client Component ('use client')
├── Direct data fetching, no interactivity
│   └── Server Component (default)
Related skills

More from davila7/claude-code-templates

Installs
513
GitHub Stars
27.2K
First Seen
Jan 25, 2026