Token导航 LogoToken导航

Agent Skill · 研究检索

nextjs-16-complete-guide(Next.js 16 complete 指南)

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

nextjs-16-complete-guide 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证为 MIT,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 19,181。

总安装 5,727周安装 246GitHub Stars 公开资料未说明下载 2,007核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:nextjs-16-complete-guide(Next.js 16 complete 指南)
来源仓库:https://github.com/fernandofuc/nextjs-claude-setup
仓库路径:skills/nextjs-16-complete-guide
安装命令:
npx skills add https://github.com/fernandofuc/nextjs-claude-setup --skill nextjs-16-complete-guide
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/fernandofuc/nextjs-claude-setup --skill nextjs-16-complete-guide

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于辅助前端页面、组件和样式开发。nextjs-16-complete-guide 属于研究检索类 Skill,可作为该场景下的辅助能力补充。适合生成或审查 React、Next.js 相关代码。需要结合项目现有设计系统和路由方式使用。避免生成孤立片段,涉及页面改动应配合预览检查。

建议先确认构建方式和视觉效果再实施改动。

来源仓库内路径:skills/nextjs-16-complete-guide

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/fernandofuc/nextjs-claude-setup --skill nextjs…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

nextjs-16-complete-guide 怎么安装?

在终端执行 npx skills add https://github.com/fernandofuc/nextjs-claude-setup --skill nextjs-16-comple…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

nextjs-16-complete-guide 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

nextjs-16-complete-guide 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

nextjs-16-complete-guide 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

nextjs-16-complete-guide 用的人多吗?

公开数据是累计安装 5,727 次,近一周安装 246 次,下载 2,007 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

nextjs-16-complete-guide 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
nextjs-16-complete-guide

Next.js 16 complete 指南 · 本页

5,727—操作浏览器MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Next.js 16 Complete Guide

Purpose

Comprehensive reference for Next.js 16's revolutionary features: Cache Components with "use cache", stable Turbopack as default bundler, proxy.ts architecture, DevTools MCP integration, and React Compiler support.

When to Use

  • Starting new Next.js projects (use 16 from day one)
  • Migrating from Next.js 15 to 16
  • Understanding Cache Components and Partial Pre-Rendering (PPR)
  • Configuring Turbopack for optimal performance
  • Migrating middleware.ts to proxy.ts
  • Leveraging AI-assisted debugging with DevTools MCP
  • Setting up React Compiler for automatic memoization

What Changed: Next.js 15 → 16

The Big Picture

Next.js 15 was transition phase - async APIs, experimental Turbopack, changing cache defaults. Next.js 16 is the payoff - everything becomes stable, fast, and production-ready.

Key Differences

FeatureNext.js 15Next.js 16
BundlerWebpack (default), Turbopack (opt-in beta)Turbopack (default, stable)
CachingImplicit, confusing defaultsExplicit with "use cache"
Network Layermiddleware.ts (edge runtime)proxy.ts (Node.js runtime)
DevToolsBasic error messagesMCP integration for AI debugging
React CompilerExperimentalStable, production-ready
PerformanceBaseline2-5× faster builds, 10× faster Fast Refresh

🚀 Core Features (The 20% That Delivers 80%)

1. Cache Components + "use cache"

The Problem in Next.js 15:

  • Implicit caching was "magic" - hard to predict what cached
  • Switching between static/dynamic was unclear
  • Performance optimization felt like guesswork

The Solution in Next.js 16:

// Enable in next.config.ts
const nextConfig = {
  cacheComponents: true,
};

export default nextConfig;

Usage Pattern:

// app/dashboard/page.tsx
import { Suspense } from 'react';

// This component caches its output
async function UserMetrics() {
  'use cache'; // 🎯 Explicit caching

  const metrics = await fetchMetrics(); // Cached result

  return <MetricsCard data={metrics} />;
}

// This stays dynamic
async function LiveBalance() {
  const balance = await fetchBalance(); // Always fresh
  return <BalanceWidget balance={balance} />;
}

export default function Dashboard() {
  return (
    <div>
      <Suspense fallback={<LoadingMetrics />}>
        <UserMetrics /> {/* Cached, instant load */}
      </Suspense>

      <LiveBalance /> {/* Dynamic, real-time */}
    </div>
  );
}

Why This Matters:

  • Instant navigation - Cached parts load immediately
  • Selective freshness - Only dynamic parts fetch on demand
  • Predictable behavior - You control what caches
  • SaaS dashboards - Perfect for panels with mixed static/dynamic content

Cache Granularity:

// Cache entire page
export default async function Page() {
  'use cache';
  return <PageContent />;
}

// Cache individual component
async function ExpensiveWidget() {
  'use cache';
  return <Chart data={await getData()} />;
}

// Cache function result
async function getStats() {
  'use cache';
  return await database.query('...');
}

2. Turbopack: Default Bundler (Stable)

Performance Numbers (Official Vercel Benchmarks):

  • 2-5× faster production builds
  • Up to 10× faster Fast Refresh in development
  • File system caching - Even faster restarts on large projects

No Configuration Needed:

// next.config.ts
// Turbopack is now default - no config required!

Opt-out (if needed):

# Use Webpack instead
next build --webpack

File System Caching (Beta):

// next.config.ts
const nextConfig = {
  experimental: {
    turbopackFileSystemCacheForDev: true, // Faster restarts
  },
};

Why This Matters:

  • Faster feedback loop - See changes instantly (10× faster)
  • Shorter CI/CD times - 2-5× faster production builds
  • Better DX - Less waiting, more shipping
  • Large projects - Scales better than Webpack

What You Notice:

# Before (Webpack)
✓ Compiled in 4.2s

# After (Turbopack)
✓ Compiled in 0.4s  # 10× faster

3. proxy.ts Replaces middleware.ts

The Change:

# Old (Next.js 15)
middleware.ts  # Edge runtime, confusing

# New (Next.js 16)
proxy.ts       # Node.js runtime, explicit

Migration Example:

// OLD: middleware.ts
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';

export function middleware(request: NextRequest) {
  return NextResponse.redirect(new URL('/home', request.url));
}

export const config = {
  matcher: '/about/:path*',
};
// NEW: proxy.ts
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';

export default function proxy(request: NextRequest) {  // Changed function name
  return NextResponse.redirect(new URL('/home', request.url));
}

export const config = {
  matcher: '/about/:path*',
};

Key Changes:

  1. Rename file: middleware.ts → proxy.ts
  2. Rename export: export function middleware → export default function proxy
  3. Runtime: Runs on Node.js (not edge)

Why This Matters:

  • Clearer boundary - "Proxy" = network entry point
  • Predictable runtime - Always Node.js, no edge ambiguity
  • Better debugging - Standard Node.js environment

4. DevTools MCP (AI-Assisted Debugging)

What It Does: Next.js 16 integrates Model Context Protocol (MCP) so AI agents can:

  • Read unified browser + server logs
  • Understand Next.js routing and caching
  • Access error stack traces automatically
  • Provide page-aware debugging context

Why This Matters:

  • AI copilots can debug your Next.js app natively
  • Faster debugging - AI understands framework internals
  • Better DX - Agent sees what you see (and more)

Use Case:

You: "Why is this page not caching?"
AI Agent (with MCP):
  - Reads server logs
  - Sees route configuration
  - Checks cache headers
  - Knows Next.js 16 caching rules
  → "You're missing 'use cache' directive in your component"

Integration: Works automatically with Claude Code, Cursor, and other MCP-compatible tools.


5. React Compiler (Stable)

What It Does: Automatically memoizes components - no more manual useMemo, useCallback, React.memo.

Setup:

npm install babel-plugin-react-compiler@latest
// next.config.ts
const nextConfig = {
  reactCompiler: true,  // Moved from experimental to stable
};

Before (Manual Optimization):

// You had to do this everywhere
const MemoizedComponent = React.memo(function Component({ data }) {
  const processed = useMemo(() => processData(data), [data]);
  const handleClick = useCallback(() => {
    console.log(processed);
  }, [processed]);

  return <div onClick={handleClick}>{processed}</div>;
});

After (React Compiler Does It):

// Just write code, compiler optimizes automatically
function Component({ data }) {
  const processed = processData(data);  // Auto-memoized
  const handleClick = () => {            // Auto-memoized
    console.log(processed);
  };

  return <div onClick={handleClick}>{processed}</div>;
}

Why This Matters:

  • Less boilerplate - Write cleaner code
  • Better performance - Compiler is smarter than manual optimization
  • No bugs - Compiler never forgets dependencies

🔥 Breaking Changes (15 → 16)

Required Changes

1. Node.js Version
# Minimum: Node.js 20.9+
# Next.js 15: Node.js 18 worked
# Next.js 16: Node.js 18 no longer supported
2. Async params & searchParams
// ❌ OLD (Next.js 15)
export default function Page({ params, searchParams }) {
  const id = params.id;  // Synchronous
}

// ✅ NEW (Next.js 16)
export default async function Page({ params, searchParams }) {
  const { id } = await params;  // Must await
  const { query } = await searchParams;
}
3. Async cookies(), headers(), draftMode()
// ❌ OLD
import { cookies } from 'next/headers';

export function MyComponent() {
  const token = cookies().get('token');  // Synchronous
}

// ✅ NEW
import { cookies } from 'next/headers';

export async function MyComponent() {
  const cookieStore = await cookies();  // Must await
  const token = cookieStore.get('token');
}
4. revalidateTag() Now Requires cacheLife Profile
// ❌ OLD
revalidateTag('posts');

// ✅ NEW
revalidateTag('posts', 'max');     // Options: 'max', 'hours', 'days'
5. middleware.ts → proxy.ts
# Required migration
mv middleware.ts proxy.ts

# Update function name
export default function proxy(request) { ... }

Removed Features

  • AMP support - Completely removed
  • next lint command - Removed
  • Node.js 18 - No longer supported
  • TypeScript <5.1 - No longer supported

📦 Migration Guide (Step-by-Step)

1. Pre-Migration Checklist

# Check current versions
node --version    # Should be 20.9+
npm list next     # Current Next.js version
npm list react    # React version

2. Automated Migration

# Upgrade to latest Next.js 16
npm install next@latest react@latest react-dom@latest

# Run codemod (handles most changes automatically)
npx @next/codemod@canary upgrade latest

3. Manual Changes

Update next.config:

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

const nextConfig: NextConfig = {
  // Enable Cache Components
  cacheComponents: true,

  // Enable React Compiler
  reactCompiler: true,

  // Optional: File system caching
  experimental: {
    turbopackFileSystemCacheForDev: true,
  },
};

export default nextConfig;

Rename middleware:

# If you have middleware.ts
git mv middleware.ts proxy.ts

# Update function name in proxy.ts
export default function proxy(request: NextRequest) {
  // Your logic
}

Update async APIs:

// Search codebase for:
// - params.
// - searchParams.
// - cookies()
// - headers()
// - draftMode()

// Add await before each

4. Test Everything

# Development
npm run dev  # Should use Turbopack automatically

# Production build
npm run build  # Should be 2-5× faster

# Run tests
npm test

5. Deploy

# Verify Node.js version in production
# Deploy to Vercel/platform
# Monitor for errors in first 24h

🎯 Best Practices

1. Start New Projects with Next.js 16

npx create-next-app@latest my-app
# Automatically uses Next.js 16, Turbopack, TypeScript, Tailwind

2. Use "use cache" Strategically

// ✅ Good: Cache expensive, infrequent-changing data
async function MonthlyReport() {
  'use cache';
  return await generateReport();
}

// ❌ Bad: Don't cache user-specific real-time data
async function CurrentBalance() {
  'use cache';  // Wrong! This should be fresh
  return await getUserBalance();
}

3. Monitor Build Performance

# Next.js 16 shows detailed timing
npm run build

# Example output:
Route (app)                              Size     First Load JS
┌ ○ /                                   142 B          87.2 kB
├ ○ /_not-found                         142 B          87.2 kB
└ ○ /dashboard                          1.23 kB        88.4 kB

Build time: 14.2s  # Was 57s in Next.js 15 with Webpack

4. Leverage DevTools MCP

  • Use Claude Code / Cursor with MCP support
  • Let AI agent read Next.js internals
  • Ask: "Why is my page slow?" - Agent sees server logs

5. Enable React Compiler for Large Apps

// Only if you have performance issues
reactCompiler: true

📊 When to Upgrade (Decision Matrix)

✅ Upgrade Now If:

  • Starting new project (use 16 from day one)
  • Small/medium codebase (<50 routes)
  • Using Vercel (tested platform)
  • Want 2-5× faster builds
  • Need instant navigation (Cache Components)

⏳ Wait 1-2 Weeks If:

  • Large production app (>100 routes)
  • Heavy middleware.ts usage (needs proxy.ts migration)
  • Custom Webpack config
  • Third-party libs not yet compatible
  • Risk-averse deployment policy

🚫 Don't Upgrade Yet If:

  • Using AMP pages (removed in 16)
  • Stuck on Node.js 18 (can't upgrade)
  • Custom build pipelines (need adapter testing)
  • Experimental features in production

🔗 Resources


💡 Quick Reference

Installation

npm install next@latest react@latest react-dom@latest

Enable Features

// next.config.ts
const nextConfig = {
  cacheComponents: true,           // Cache Components
  reactCompiler: true,             // React Compiler
  experimental: {
    turbopackFileSystemCacheForDev: true,  // Faster dev restarts
  },
};

Migration Checklist

  • Node.js 20.9+ installed
  • npm install next@latest
  • Run npx @next/codemod@canary upgrade latest
  • Rename middleware.ts → proxy.ts
  • Add await to params/searchParams/cookies/headers
  • Update revalidateTag() calls with cacheLife
  • Test build: npm run build
  • Test dev: npm run dev
  • Deploy to staging first

Summary: Next.js 16 delivers on the promises of 15 - everything is faster, more explicit, and production-ready. Turbopack is default, caching is predictable, and AI tooling is native. This is the version to build modern SaaS applications on in 2025.

平台分布

Claude Code

26.52%
按下载量换算532

Antigravity

24.01%
按下载量换算482

Cursor

19.09%
按下载量换算383

Gemini CLI

12.93%
按下载量换算260

OpenCode

8.51%
按下载量换算171

Codex

3.82%
按下载量换算77

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills