
Nextjs Best Practices
This one keeps you honest about Next.js App Router defaults. It pushes server components first, client components only when you need interactivity, which is the right instinct but easy to forget when you're used to older patterns. The decision trees are useful, especially the server vs client split and the caching layers breakdown. What I like is the anti-patterns section calling out "use client everywhere" because that's exactly what happens when teams migrate without rethinking their approach. The routing conventions table and server actions guidance are solid references when you're setting up new routes or forms. Good for teams transitioning from Pages Router or anyone who keeps reaching for client components out of habit.
- skills.sh installs
- 632
- GitHub stars
- 33.2K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add davila7/claude-code-templates --skill nextjs-best-practices --agent claude-codeInstalls into .claude/skills of the current project.
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
Sponsors
Details
- Repository
- github.com/davila7/claude-code-templates
- Categories
- Frontend Development, Backend & APIs
- First seen
- May 16, 2026
More from davila7/claude-code-templates
All 618- Gdpr Dsgvo Expert627
- Peer Review612
- Prompt Engineering604
- Web Design Guidelines603
- Cto Advisor595
- Latex Posters592
- Context Window Management587
- Humanizer585
- Product Manager Toolkit585
- Agent Memory Mcp575
- I18n Localization570
- Audiocraft Audio Generation569
- Agent Manager Skill568
- Research Lookup567
- Seaborn565
- Tailwind Patterns564
- Brainstorming562
- Feature Design Assistant559
- Nodejs Best Practices558
- Planning With Files558
- Product Strategist558
- Seo Fundamentals556
- Architecture555
- Seo Audit555