Communitygithub.com

Next.js 16 Launchpad

Next.js 16 を Turbopack、Cache Components、proxy.ts と共に使用するためのスキル。App Router と React 19.2 を用いたブートストラップ、マイグレーション、ビルドを支援します。

Next.js 16 Launchpad とは?

このスキルは、Next.js 16 の新機能を活用したプロジェクトのセットアップ、移行、開発を効率的に進めるためのものです。主な機能として、デフォルトで有効になった Turbopack(ビルド速度 2~5 倍向上)、`'use cache'` ディレクティブを用いた Cache Components、そしてミドルウェアに代わる `proxy.ts` による明示的な制御をサポートします。Node.js 20.9.0+、TypeScript 5.1.0+、React 19.2+ を必要とし、App Router と React 19.2 に最適化されています。Pages Router や Next.js 15 以前のプロジェクトには適用されません。このスキルは、一般的な開発パターン(サーバーコンポーネント、クライアントコンポーネント、Cache Components、プロキシバウンダリ、ストリーミング)に加え、v15 からの具体的な移行手順や注意点を提供します。生産的なパターンとして E コマースサイトや認証付きダッシュボードの実装例も含まれており、Vercel へのデプロイや Docker/Node のスタンドアロン構成もカバーしています。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/aiskillstore/marketplace/calel33/next-js-16-launchpad

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Next.js 16 Launchpad は何をしますか?

Next.js 16: Turbopack がデフォルトに(ビルドが 2~5 倍高速化)、Cache Components('use cache')、proxy.ts による明示的な制御。

使用するタイミング

✅ Next.js 16、Turbopack、Cache Components、proxy 移行、App Router、React 19.2

❌ Pages Router、Next.js ≤15、一般的な React の質問

必要条件

ツールバージョン
Node.js20.9.0+
TypeScript5.1.0+
React19.2+

クイックスタート

# 新規プロジェクト
npx create-next-app@latest my-app

# 既存プロジェクトのアップグレード
npx @next/codemod@canary upgrade latest
npm install next@latest react@latest react-dom@latest

推奨: TypeScript、ESLint、Tailwind、App Router、Turbopack、@/* エイリアス。

最小限のセットアップ

// app/layout.tsx
export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>{children}</body>
    </html>
  )
}
// app/page.tsx
export default function Page() {
  return <h1>Hello, Next.js 16!</h1>
}

設定

// next.config.ts
import type { NextConfig } from 'next'

const nextConfig: NextConfig = {
  cacheComponents: true,
  reactCompiler: true,
}

export default nextConfig

v15 → v16 の変更点

v15v16
experimental.turbopackデフォルト有効
experimental.pprcacheComponents
middleware.ts (Edge)proxy.ts (Node)
同期 paramsawait params

コアパターン

1. サーバーコンポーネント(デフォルト)

export default async function BlogPage() {
  const res = await fetch('https://api.example.com/posts')
  const posts = await res.json()
  return <PostList posts={posts} />
}

2. Cache Components

import { cacheLife } from 'next/cache'

export default async function BlogPage() {
  'use cache'
  cacheLife('hours')
  const posts = await fetch('https://api.example.com/posts').then(r => r.json())
  return <PostList posts={posts} />
}

3. クライアントコンポーネント

'use client'
import { useState } from 'react'

export default function Counter() {
  const [count, setCount] = useState(0)
  return (
    <div>
      <p>Count: {count}</p>
      <button onClick={() => setCount(count + 1)}>+</button>
    </div>
  )
}

4. プロキシバウンダリ

// app/proxy.ts
export function proxy(request: NextRequest) {
  if (!request.cookies.get('auth') && request.nextUrl.pathname.startsWith('/dashboard')) {
    return NextResponse.redirect(new URL('/login', request.url))
  }
  return NextResponse.next()
}

5. Cache Tags + サーバーアクション

// app/blog/page.tsx
'use cache'
cacheLife('hours')
cacheTag('blog-posts')

export default async function BlogList() {
  const posts = await db.posts.findMany()
  return <PostList posts={posts} />
}
// app/actions.ts
'use server'
import { updateTag } from 'next/cache'

export async function createPost(data: PostData) {
  await db.posts.create(data)
  updateTag('blog-posts')
}

6. Suspense を使ったストリーミング

export default function Dashboard() {
  return (
    <div>
      <Suspense fallback={<Skeleton />}>
        <RevenueCard />
      </Suspense>
      <Suspense fallback={<Skeleton />}>
        <UsersCard />
      </Suspense>
    </div>
  )
}

async function RevenueCard() {
  const data = await db.analytics.revenue()
  return <div>{data}</div>
}

主要なコンセプト

  1. Turbopack - Rust 製バンドラー、インクリメンタルコンパイル、Fast Refresh
  2. サーバーコンポーネント - app/ 内ではデフォルト、クライアント JS ゼロ
  3. クライアントコンポーネント - 'use client'、フック、ブラウザ API
  4. Cache Components - 'use cache' + cacheLife() による PPR
  5. プロキシバウンダリ - proxy.ts による認証/リライト/リダイレクト
  6. 部分プリレンダリング - 静的シェル + 動的ストリーミング

移行チェックリスト

  1. 非同期リクエスト API

    npx @next/codemod@canary async-request-api
    

    更新: const { slug } = await params

  2. middleware.ts → proxy.ts

    • ファイル名を変更し、proxy をエクスポート
    • Node ランタイムのみ(Edge ではない)
  3. 設定の更新

    • experimental.* フラグを削除
    • cacheComponents、reactCompiler を有効化
    • serverRuntimeConfig/publicRuntimeConfig を削除
  4. Cache Components

    • experimental.ppr を cacheComponents: true に置き換え
    • 動的セクションを <Suspense> でラップ
  5. 画像

    • クエリ文字列のために images.localPatterns を設定

完全なガイドは references/nextjs16-migration-playbook.md を参照してください。

よくある落とし穴

❌ 'use cache' とランタイム API(cookies()、headers())の混在 ❌ Cache Components を有効にした際の <Suspense> の欠落 ❌ Turbopack 下でのチルダ Sass インポート ❌ Edge ランタイムでの proxy.ts の実行

✅ cookies/headers を先に読み取り、キャッシュされたコンポーネントに props として渡す ✅ 動的な子要素を <Suspense> でラップ ✅ 標準の Sass インポートを使用する ✅ プロキシには Node ランタイムを使用する

判断ガイド

Cache Components を有効にしますか? → 静的/準静的なコンテンツには「はい」 → 完全に動的なダッシュボードには「いいえ」

認証はどこに置きますか? → ルート間のチェックには proxy.ts → API 固有のロジックにはルートハンドラ

いつ 'use client' を使用しますか? → フック、状態、またはブラウザ API が必要な場合のみ → プレゼンテーション用コンポーネントはサーバーサイドに維持

プロダクションパターン

E コマース

// ストリーミングを使用した商品ページ
export default async function Product({ params }) {
  const { id } = await params
  const product = await db.products.findById(id)
  
  return (
    <>
      <ProductInfo product={product} />
      <Suspense fallback={<ReviewsSkeleton />}>
        <Reviews productId={id} />
      </Suspense>
    </>
  )
}

認証付きダッシュボード

// proxy.ts
export function proxy(request: NextRequest) {
  const session = request.cookies.get('session')
  if (!session && request.nextUrl.pathname.startsWith('/dashboard')) {
    return NextResponse.redirect(new URL('/login', request.url))
  }
}

詳細な設計図については references/nextjs16-advanced-patterns.md を参照してください。

パフォーマンス

  • Turbopack を有効にしたままにする(必要な場合のみ --webpack で無効化)
  • Promise.all でフェッチを並列化
  • ストリーミング境界に <Suspense> を使用
  • 大規模リポジトリではファイルシステムキャッシュを有効化

セキュリティ

  • server-only パッケージと React Taint API を使用
  • 認証は proxy.ts に維持
  • サーバーアクションで入力を検証
  • 環境変数は NEXT_PUBLIC_ プレフィックスでゲート
  • キャッシュスコープの前に cookies/headers を抽出

デプロイ

  • Vercel: ゼロ設定
  • Docker/Node: output: 'standalone'
  • ビルド時間を監視(2~5 倍の高速化を想定)
  • CDN に合わせてキャッシュライフサイクルを設定

参照ファイル

  • references/nextjs16-reference.md - インストール/設定/チェックリスト
  • references/nextjs16-migration-playbook.md - コードモッドを使用した移行ガイド
  • references/nextjs16-advanced-patterns.md - ストリーミング、キャッシュ、認証パターン
  • references/NEXTJS_16_COMPLETE_GUIDE.md - 完全なドキュメント
  • scripts/bootstrap-nextjs16.ps1 - 自動セットアップスクリプト
  • assets/app-router-starter/ - リファレンス実装

リソース

バージョン: 1.1.0 | 更新日: 2025-12-27

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

関連スキル