Communitygithub.com

ComeOnOliver/skillshub

使用官方指南和 codemod 進行 Next.js 版本遷移。在需要使用 codemod 將 Next.js 專案遷移到新主要版本時使用。(觸發條件:package.json、next upgrade、遷移指南、codemod)

skillshub 是什麼?

此技能提供了一套自動化且手動的 Next.js 版本升級流程(例如 v14 → v15),其優先級為 P1(操作級)。它會自動檢查 `package.json` 中的 `next`、`react` 和 `react-dom` 版本,並建議進行增量升級(例如 v13 → v14,再 v14 → v15),同時遵循官方 Next.js 遷移指南。核心功能是使用 `npx @next/codemod@latest` 來自動執行語法遷移,特別針對 v15 的破壞性變更(例如需要對 `params`、`searchParams`、`cookies()` 和 `headers()` 進行 await)。該技能還涵蓋了 React 版本的同步更新(例如 Next.js 15 需要 React 19)、在每個步驟後執行 `next dev` 和 `next build` 進行驗證,以及報告所有 codemod 失敗或需要手動修復的事項。支援的平台包括 Cursor、Claude Code、Codex 和 Windsurf。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/HoangNguyen0403/agent-skills-standard/nextjs-upgrade

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Next.js 升級協定

Next.js 版本升級的自動化及手動遷移步驟(例如 v14 → v15)。

優先級:P1(營運級)

實作指南

  • 升級偵測:永遠檢查 package.json 中 next、react 和 react-dom 的版本。
  • 規劃:針對主要版本跳升(v13 到 v15),執行增量升級(v13 -> v14,然後 v14 -> v15)。遵循官方 Next.js 遷移指南。
  • 自動化 Codemod:使用 npx @next/codemod@latest <transform> <path> 來自動化語法遷移。
  • 重大變更(v15):回應 next-async-request-api 轉換,確保 params、searchParams、cookies() 和 headers() 都已 await。
  • React 一致性:升級 react 與 react-dom 以符合 Next.js 的對等依賴(例如 Next.js 15 需搭配 React 19)。
  • 驗證:在每個增量步驟後執行 next dev 和 next build。檢查主控台錯誤中的水合警告。
  • 回報:將所有 codemod 失敗或需要手動修復的部分回報給團隊。

3. 依賴更新

同步升級 Next.js 與對等依賴:

# 使用 npm
npm install next@latest react@latest react-dom@latest

# 更新型別
npm install --save-dev @types/react@latest @types/react-dom@latest

4. 手動驗證規則

  1. 非同步上下文:驗證所有 cookies()、headers() 以及路由 params 的使用皆已 await。
  2. 元資料:確保 generateMetadata 的型別符合新的非同步 params 簽章。
  3. 快取:在 v15+,fetch 預設為 { cache: 'no-store' }。若需舊版行為,請明確設定 { cache: 'force-cache' }。

5. 測試建置

  • 在 codemod 與套件更新後立即執行 npm run build。
  • 若使用 --turbo,檢查是否有「Hydration failed」或「Turbopack」相容性錯誤。

反模式

  • 勿跳過主要版本:一次只升級一個主要版本(13→14,再 14→15)。
  • 勿手動修復重大變更:永遠先執行 npx @next/codemod@latest 轉換。
  • 勿預設升級後快取行為不變:v15 預設為 no-store;需審查所有 fetch 呼叫。
  • 勿在 Pages Router 中使用非同步頁面函式:export default async function Page() 會導致致命錯誤。

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

相關技能