
Nextjs Best Practices
Next.js App Router principles covering Server Components, data fetching, routing, caching, and server actions.
- skills.sh installs
- 633
- GitHub stars
- 34.1K
- last updated
- Aug 21, 2026
What it does
- Covers Server vs Client Component decisions, fetch strategies (static, ISR, and dynamic), and cache layers with revalidation methods
- Includes file conventions (
page.tsx,layout.tsx,loading.tsx,error.tsx,not-found.tsx) plus route groups, parallel routes, and intercepting routes - Enforces server-by-default rendering, input validation with Zod, and loading and error boundaries before client-side fallbacks
- Designed for developers building or reviewing Next.js App Router projects that need guidance on rendering and data flow
Install
$ npx -y skills add davila7/claude-code-templates --skill nextjs-best-practices -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
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)
│
└── Both?
└── Split: Server parent + Client child
By Default
| Type | Use |
|---|---|
| Server | Data fetching, layout, static content |
| Client | Forms, buttons, interactive UI |
2. Data Fetching Patterns
Fetch Strategy
| Pattern | Use |
|---|---|
| Default | Static (cached at build) |
| Revalidate | ISR (time-based refresh) |
| No-store | Dynamic (every request) |
Data Flow
| Source | Pattern |
|---|---|
| Database | Server Component fetch |
| API | fetch with caching |
| User input | Client state + server action |
3. Routing Principles
File Conventions
| File | Purpose |
|---|---|
page.tsx | Route UI |
layout.tsx | Shared layout |
loading.tsx | Loading state |
error.tsx | Error boundary |
not-found.tsx | 404 page |
Route Organization
Details
- Repository
- github.com/davila7/claude-code-templates
- Categories
- Frontend & UI Code, Backend & APIs
- First seen
- May 16, 2026
More from davila7/claude-code-templates
All 398- Gdpr Dsgvo Expert630
- Peer Review612
- Prompt Engineering605
- Cto Advisor595
- Context Window Management589
- Product Manager Toolkit585
- Agent Memory Mcp575
- I18n Localization572
- Agent Manager Skill568
- Research Lookup567
- Seaborn565
- Tailwind Patterns564
- Feature Design Assistant559
- Architecture558
- Nodejs Best Practices558
- Planning With Files558
- Product Strategist558
- Seo Fundamentals557
- React Best Practices553
- Create Plan543
- Polars539
- Agent Tool Builder537
- Software Architecture534
- Database Design532
Similar to Nextjs Best Practices
More Frontend & UI Code
nextjs-developmentmanutej/luxor-claude-marketplace475 installsComprehensive Next.js guidance for App Router, Server Components, data fetching, routing, and middleware.
nextjs-app-router-patternswshobson/agents34.1K installsComprehensive App Router patterns for Next.js 14+ covering Server Components, streaming, and data fetching.
nexthairyf/skills860 installsNext.js framework guide covering App Router, Server Components, data fetching, caching, and Server Actions for full-stack React.
nextjs-corebobmatnyc/claude-mpm-skills362 installsApp Router patterns for Server Components, Server Actions, route handlers, and explicit caching with revalidation.
nextjs-app-routergiuseppe-trisciuoglio/developer-kit4.1K installsModern App Router guide for Next.js 16+ covering Server Components, Server Actions, caching, and routing conventions.
nextjs-data-fetchinggiuseppe-trisciuoglio/developer-kit3.9K installsServer and client data fetching patterns for Next.js App Router, covering ISR, revalidation, and loading states.