Next Best Practices

Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add 0xranx/agentbrief --skill next-best-practices
Manual install
git clone --depth 1 https://github.com/0xranx/agentbrief.git /tmp/agentbrief
mkdir -p ~/.claude/skills
cp -r /tmp/agentbrief/briefs/nextjs-developer/skills/next-best-practices ~/.claude/skills/next-best-practices

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Next.js Best Practices

Apply these rules when writing or reviewing Next.js code.

## File Conventions

See [file-conventions.md](./file-conventions.md) for:
- Project structure and special files
- Route segments (dynamic, catch-all, groups)
- Parallel and intercepting routes
- Middleware rename in v16 (middleware → proxy)

## RSC Boundaries

Detect invalid React Server Component patterns.

See [rsc-boundaries.md](./rsc-boundaries.md) for:
- Async client component detection (invalid)
- Non-serializable props detection
- Server Action exceptions

## Async Patterns

Next.js 15+ async API changes.

See [async-patterns.md](./async-patterns.md) for:
- Async `params` and `searchParams`
- Async `cookies()` and `headers()`
- Migration codemod

## Runtime Selection

See [runtime-selection.md](./runtime-selection.md) for:
- Default to Node.js runtime
- When Edge runtime is appropriate

## Directives

See [directives.md](./directives.md) for:
- `'use client'`, `'use server'` (React)
- `'use cache'` (Next.js)

## Functions

See [functions.md](./functions.md) for:
- Navigation hooks: `useRouter`, `usePathname`, `useSearchParams`, `useParams`
- Server functions: `cookies`, `headers`, `draftMode`, `after`
- Generate functions: `generateStaticParams`, `generateMetadata`

## Error Handling

See [error-handling.md](./error-handling.md) for:
- `error.tsx`, `global-error.tsx`, `not-found.tsx`
- `redirect`, `permanentRedirect`, `notFound`
- `forbidden`, `unauthorized` (auth errors)
Read the full skill on GitHub

Details

Skill name
next-best-practices
Path
briefs/nextjs-developer/skills/next-best-practices/SKILL.md
License
MIT
Repo updated
28 March 2026

FAQ

What does the Next Best Practices skill do?

Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling

How do I install the Next Best Practices skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add 0xranx/agentbrief --skill next-best-practices. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Next Best Practices popular?

It lives in 0xranx/agentbrief, which has 43 GitHub stars and 0 forks.

Related skills

Typescript Advanced Types

43

0xranx/agentbrief

Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications. Use when implementing complex type logic, creating reusable type utilities, or ensuring compile-time type safety in TypeScript projects.

Software Development

Analytics Setup

43

0xranx/agentbrief

When the user needs to set up product analytics, event tracking, or says 'set up analytics,' 'add tracking,' 'GA4,' 'Mixpanel,' 'PostHog,' 'Amplitude,' 'what events should we track,' 'conversion tracking,' 'funnel tracking,' or is launching a product and needs to instrument it for data collection.

Data & Analytics

API Documentation

43

0xranx/agentbrief

Create comprehensive API documentation for developers. Use when documenting REST APIs, GraphQL schemas, or SDK methods. Handles OpenAPI/Swagger, interactive docs, examples, and API reference guides.

Software Development

Nextjs

48

frankxai/claude-skills-library

Next.js 15+ App Router development patterns including Server Components, Client Components, data fetching, layouts, and server actions. Use when creating pages, routes, layouts, components, API route handlers, server actions, loading states, error boundaries, or working with Next.js navigation and metadata.

Frontend & Design

Material System

48

frankxai/claude-skills-library

Give a site one material — a short block in design.md that fixes its metal, field, glass, and depth settings from the brand's tokens — and a surface map that says which route carries the one GPU surface and why. Use when planning shaders, glass, liquid-metal marks, or 3D across a whole site or several sites; when asked how the liquid-logo, shader-backdrop, liquid-glass, and r3f-scene recipes fit together; when a brand wants a signature look that is consistent between its website, Open Graph images, and social clips; or before the first GPU surface lands in a repo. Produces a proposal for the b

Frontend & Design

Nextjs Agent Team

48

frankxai/claude-skills-library

Multi-agent workflow for planning, building, testing, and shipping Next.js applications. Use when building a Next.js app end-to-end with a team of specialist agents, or coordinating plan→build→test→ship for a Next.js project.

Frontend & Design

Browse the most popular Claude skills, all frontend & design skills, or write your own with the skills generator.