Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
sickn33 avatar

Nextjs Best Practices

  • 6.8k installs
  • 44.4k repo stars
  • Updated August 4, 2026
  • sickn33/antigravity-awesome-skills

nextjs-best-practices is an agent skill for Next.js App Router principles. Server Components, data fetching, routing patterns.

About

Next js App Router principles Server Components data fetching routing patterns name nextjs-best-practices description Next js App Router principles Server Components data fetching routing patterns risk unknown source community date_added 2026-02-27 Next js Best Practices Principles for Next js App Router development 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 Pattern Use Route groups name Organize without URL Parallel routes slot Multiple same-level pages

  • Next.js Best Practices
  • Validate input with Zod
  • Return proper status codes
  • Handle errors gracefully
  • Use Edge runtime when possible

Nextjs Best Practices by the numbers

  • 6,833 all-time installs (skills.sh)
  • +56 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #234 of 2,153 Testing & QA skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

nextjs-best-practices capabilities & compatibility

Capabilities
next.js best practices · validate input with zod · return proper status codes · handle errors gracefully · use edge runtime when possible
Use cases
documentation
From the docs

What nextjs-best-practices says it does

--- name: nextjs-best-practices description: "Next.js App Router principles.
SKILL.md
Server Components, data fetching, routing patterns." risk: unknown source: community date_added: "2026-02-27" --- # Next.js Best Practices > Principles for Next.js App Router development.
SKILL.md
Server vs Client Components ### Decision Tree ``` Does it need...?
SKILL.md
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill nextjs-best-practices

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs6.8k
repo stars44.4k
Security audit3 / 3 scanners passed
Last updatedAugust 4, 2026
Repositorysickn33/antigravity-awesome-skills

When should developers use nextjs-best-practices and what problem does it solve?

Next.js App Router principles. Server Components, data fetching, routing patterns.

Who is it for?

Developers working with nextjs-best-practices patterns described in the skill documentation.

Skip if: Skip when cached docs are empty or the task is outside the skill's documented scope.

When should I use this skill?

Next.js App Router principles. Server Components, data fetching, routing patterns.

What you get

Grounded guidance and workflows from SKILL.md for nextjs-best-practices.

  • Server and Client Component architecture
  • App Router file structure

By the numbers

  • Community skill date_added 2026-02-27

Files

SKILL.mdMarkdownGitHub ↗

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

TypeUse
ServerData fetching, layout, static content
ClientForms, buttons, interactive UI

---

2. Data Fetching Patterns

Fetch Strategy

PatternUse
DefaultStatic (cached at build)
RevalidateISR (time-based refresh)
No-storeDynamic (every request)

Data Flow

SourcePattern
DatabaseServer Component fetch
APIfetch with caching
User inputClient state + server action

---

3. Routing Principles

File Conventions

FilePurpose
page.tsxRoute UI
layout.tsxShared layout
loading.tsxLoading state
error.tsxError boundary
not-found.tsx404 page

Route Organization

PatternUse
Route groups (name)Organize without URL
Parallel routes @slotMultiple same-level pages
Intercepting (.)Modal overlays

---

4. API Routes

Route Handlers

MethodUse
GETRead data
POSTCreate data
PUT/PATCHUpdate data
DELETERemove data

Best Practices

  • Validate input with Zod
  • Return proper status codes
  • Handle errors gracefully
  • Use Edge runtime when possible

---

5. Performance Principles

Image Optimization

  • Use next/image component
  • Set priority for above-fold
  • Provide blur placeholder
  • Use responsive sizes

Bundle Optimization

  • Dynamic imports for heavy components
  • Route-based code splitting (automatic)
  • Analyze with bundle analyzer

---

6. Metadata

Static vs Dynamic

TypeUse
Static exportFixed metadata
generateMetadataDynamic per-route

Essential Tags

  • title (50-60 chars)
  • description (150-160 chars)
  • Open Graph images
  • Canonical URL

---

7. Caching Strategy

Cache Layers

LayerControl
Requestfetch options
Datarevalidate/tags
Full routeroute config

Revalidation

MethodUse
Time-basedrevalidate: 60
On-demandrevalidatePath/Tag
No cacheno-store

---

8. Server Actions

Use Cases

  • Form submissions
  • Data mutations
  • Revalidation triggers

Best Practices

  • Mark with 'use server'
  • Validate all inputs
  • Return typed responses
  • Handle errors

---

9. Anti-Patterns

❌ Don't✅ Do
'use client' everywhereServer by default
Fetch in client componentsFetch in server
Skip loading statesUse loading.tsx
Ignore error boundariesUse error.tsx
Large client bundlesDynamic imports

---

10. Project Structure

app/
├── (marketing)/     # Route group
│   └── page.tsx
├── (dashboard)/
│   ├── layout.tsx   # Dashboard layout
│   └── page.tsx
├── api/
│   └── [resource]/
│       └── route.ts
└── components/
    └── ui/

---

Remember: Server Components are the default for a reason. Start there, add client only when needed.

When to Use

This skill is applicable to execute the workflow or actions described in the overview.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

Related skills

How it compares

Pick nextjs-best-practices over generic React skills when work specifically involves Next.js App Router Server Component boundaries and file-based routing.

FAQ

What does nextjs-best-practices do?

Next.js App Router principles. Server Components, data fetching, routing patterns.

When should I invoke nextjs-best-practices?

Next.js App Router principles. Server Components, data fetching, routing patterns.

Where is the source documentation?

Ground claims in SKILL.md excerpts and linked reference files from the cached docs.

Is Nextjs Best Practices safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.