Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

nextjs

БесплатноЗапускает вложенные скриптыНе проверен

Next.js 16 with App Router, Server Components, Server Actions, Cache Components. Use for React 19.2 apps, SSR, or encountering async params, proxy.ts…

secondskyот secondsky★ 257 звёзд на GitHub18 установок в других каталогах

Об этом скилле

Next.js App Router - Production Patterns

Version: Next.js 16.2.0 React Version: 19.2.0 Node.js: 20.9+ Last Verified: 2025-11-21

Table of Contents

  1. When to Use This Skill
  2. When NOT to Use This Skill
  3. Next.js 16 Breaking Changes
  4. Cache Components & Caching APIs
  5. Server Components
  6. Server Actions
  7. Route Handlers
  8. React 19.2 Features
  9. Metadata API
  10. Image & Font Optimization
  11. Top 5 Critical Errors
  12. Performance Patterns
  13. TypeScript Configuration

When to Use This Skill

Use this skill when you need:

  • Next.js 16 App Router patterns (layouts, loading, error boundaries, routing)
  • Server Components best practices (data fetching, composition, streaming)
  • Server Actions patterns (forms, mutations, revalidation, error handling)
  • Cache Components with "use cache" directive (NEW in Next.js 16)
  • New caching APIs: revalidateTag(), updateTag(), refresh() (Updated in Next.js 16)
  • Migration from Next.js 15 to 16 (async params, proxy.ts, parallel routes)
  • Route Handlers (API endpoints, webhooks, streaming responses)
  • Proxy patterns (proxy.ts replaces middleware.ts in Next.js 16)
  • Async route params (params, searchParams, cookies(), headers() now async)
  • Parallel routes with default.js (breaking change in Next.js 16)
  • React 19.2 features (View Transitions, useEffectEvent(), React Compiler)
  • Metadata API (SEO, Open Graph, Twitter Cards, sitemaps)
  • Image optimization (next/image with updated defaults in Next.js 16)
  • Performance optimization (lazy loading, code splitting, PPR, ISR)

When NOT to Use This Skill

Do NOT use this skill for:

  • Cloudflare Workers deployment → Use the cloudflare-nextjs skill (OpenNext adapter: @opennextjs/cloudflare, getCloudflareContext, caching tiers, Workers-specific errors). Note: cloudflare-nextjs covers the proxy.ts exception for Cloudflare (keep middleware.ts there).
  • Pages Router patterns → This skill covers App Router ONLY (Pages Router is legacy)
  • Authentication libraries → Use clerk-auth, auth-js, or other auth-specific skills
  • Database integration → Use cloudflare-d1, drizzle-orm-d1, or database-specific skills
  • UI component libraries → Use tailwind-v4-shadcn skill for Tailwind + shadcn/ui
  • State management → Use zustand-state-management, tanstack-query skills
  • Form libraries → Use react-hook-form-zod skill

Next.js 16 Breaking Changes

CRITICAL: Next.js 16 has multiple breaking changes. For detailed migration steps, see references/next-16-migration-guide.md.

Breaking Change Before After
Async params params.slug const { slug } = await params
Async headers cookies() sync await cookies()
Middleware middleware.ts proxy.ts (renamed)
Parallel routes default.js optional default.js required
Caching Auto-cached fetch Opt-in with "use cache"
revalidateTag() 1 argument 2 arguments (tag + cacheLife)
Node.js 18.x+ 20.9+ required
React 18.x 19.2+ required

Quick Fix for Async Params:

// ✅ Next.js 16 pattern
export default async function Page({ params }: { params: Promise<{ id: string }> }) {
  const { id } = await params
  return <div>{id}</div>
}

Codemod: bunx @next/codemod@canary upgrade latest

See: references/next-16-migration-guide.md for complete migration guide with examples.


Cache Components & Caching APIs

"use cache" Directive (NEW in Next.js 16)

'use cache'

export async function BlogPosts() {
  const posts = await db.posts.findMany()
  return posts.map(post => <article key={post.id}>{post.title}</article>)
}

Caching APIs Summary

API Purpose Example
"use cache" Opt-in component/function caching 'use cache' at top
revalidateTag() Invalidate by tag revalidateTag('posts', 'max')
updateTag() Update cache without revalidation updateTag('posts', newData)
refresh() Refresh current page refresh()
revalidatePath() Invalidate by path revalidatePath('/posts')

PPR (Partial Prerendering)

// next.config.ts
const config = { experimental: { ppr: true } }

// page.tsx
export const experimental_ppr = true

export default function Page() {
  return (
    <>
      <StaticHeader />
      <Suspense fallback={<Skeleton />}>
        <DynamicContent />
      </Suspense>
    </>
  )
}

See: `refer

Полный SKILL.md на GitHub

Установить nextjs в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Write
Edit
Bash
Glob
Grep

Вложенные файлы

references/caching-apis.mdreferences/error-catalog.mdreferences/next-16-migration-guide.mdreferences/server-actions-patterns.mdreferences/top-errors.mdscripts/check-versions.shtemplates/app-router-async-params.tsxtemplates/async-params-page.tsxtemplates/cache-component-use-cache.tsxtemplates/package.jsontemplates/parallel-routes-with-default.tsxtemplates/proxy-migration.tstemplates/route-handler-api.tstemplates/server-action-form.tsxtemplates/server-actions-form.tsx

FAQ

Что делает скилл nextjs?

Next.js 16 with App Router, Server Components, Server Actions, Cache Components. Use for React 19.2 apps, SSR, or encountering async params, proxy.ts migration, use cache errors.

Как установить скилл nextjs?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл nextjs запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить nextjs с