nextjs-best-practices — community travel-photos, community, ide skills, Claude Code, Cursor, Windsurf

v1.0.0
GitHub

About this Skill

Perfect for Frontend Agents needing optimized Next.js application development with Server and Client Components. Responsive travel photo website without bulky CMS features.

mjannino mjannino
[0]
[0]
Updated: 3/5/2026

Agent Capability Analysis

The nextjs-best-practices skill by mjannino is an open-source community AI agent skill for Claude Code and other IDE workflows, helping agents execute tasks with better context, repeatability, and domain-specific guidance.

Ideal Agent Persona

Perfect for Frontend Agents needing optimized Next.js application development with Server and Client Components.

Core Value

Empowers agents to develop scalable and performant Next.js applications using App Router, leveraging Server Components for data fetching and layout, and Client Components for interactivity and event handling with useState, useEffect, and event handlers.

Capabilities Granted for nextjs-best-practices

Architecting responsive travel photo websites without bulky CMS features
Implementing decision trees for Server vs Client Component selection
Optimizing application performance by splitting components into Server parents and Client children

! Prerequisites & Limits

  • Requires understanding of Next.js App Router development principles
  • Limited to Next.js framework
  • Dependent on correct component type selection (Server or Client) for optimal performance
Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

nextjs-best-practices

Install nextjs-best-practices, an AI agent skill for AI agent workflows and automation. Works with Claude Code, Cursor, and Windsurf with one-command setup.

SKILL.md
Readonly

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.

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is nextjs-best-practices?

Perfect for Frontend Agents needing optimized Next.js application development with Server and Client Components. Responsive travel photo website without bulky CMS features.

How do I install nextjs-best-practices?

Run the command: npx killer-skills add mjannino/travel-photos/nextjs-best-practices. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for nextjs-best-practices?

Key use cases include: Architecting responsive travel photo websites without bulky CMS features, Implementing decision trees for Server vs Client Component selection, Optimizing application performance by splitting components into Server parents and Client children.

Which IDEs are compatible with nextjs-best-practices?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for nextjs-best-practices?

Requires understanding of Next.js App Router development principles. Limited to Next.js framework. Dependent on correct component type selection (Server or Client) for optimal performance.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add mjannino/travel-photos/nextjs-best-practices. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use nextjs-best-practices immediately in the current project.

Related Skills

Looking for an alternative to nextjs-best-practices or another community skill for your workflow? Explore these related open-source skills.

View All

widget-generator

Logo of f
f

f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.

149.6k
0
AI

flags

Logo of vercel
vercel

flags is a Next.js feature management skill that enables developers to efficiently add or modify framework feature flags, streamlining React application development.

138.4k
0
Browser

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI