Communitygithub.com

ComeOnOliver/skillshub

傳統路由、getServerSideProps 慣例以及嚴格的架構限制。適用於使用 Pages Router 並搭配 getServerSideProps、getStaticProps 或 _app 的 Next.js 專案。(觸發條件:pages/**/*.tsx、pages/**/*.ts、Pages Router、getServerSideProps、getStaticProps、_app、useRouter)

skillshub 是什麼?

此技能專門處理使用 Next.js 傳統 Pages Router (pages/ 目錄) 的專案。它強制遵循 P0 (關鍵) 優先級,明確禁止使用 App Router 功能,確保開發者遵循正確的架構。技能提供清晰的實作指南,涵蓋路由架構(包括動態路由)、資料擷取模式(SSR 為 getServerSideProps,SSG 為 getStaticProps)、邏輯隔離(禁止從伺服器端鉤子中 fetch 自己的 API 端點)、客戶端路由(使用 useRouter() 或 <Link>)以及 API 路由的標準化回應。對於已升級至 Next.js 15 或正在升級的專案,此技能特別重要,因為它確保 getServerSideProps 的回傳值與預期的 PageProps 相符。此外,它也規範了樣式處理,建議使用 CSS Modules 或 Tailwind CSS。此技能廣泛支援 Claude Code、Cursor 與 Codex 等 AI Agent 平台,有助於在這些環境中維持程式碼一致性與最佳實務。

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

在你喜歡的 AI 中提問

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

說明文件

Next.js Pages Router (傳統版本)

優先級:P0 (關鍵)

[!IMPORTANT] 此專案使用 Next.js Pages Router (pages/ 目錄)。請勿使用 App Router 功能。

實作指南

  • 路由架構:使用 pages/ 目錄。在 _app.tsx 中處理全域狀態/版面,在 _document.tsx 中處理自訂 HTML 屬性。使用方括號 [id].tsx 或捕獲所有路由 [...slug].tsx 定義動態路由。
  • 資料擷取 (SSR/SSG):針對每次請求使用 getServerSideProps,或在建置時使用 getStaticProps 搭配 getStaticPaths 處理動態路由。將這些匯出為獨立的 async 函式。
  • 邏輯隔離:絕不從伺服器端鉤子中 fetch 自己的 /api 端點。應直接匯入服務層或資料庫邏輯。
  • 客戶端鉤子:使用 next/router 中的 useRouter() 進行導航與存取查詢參數。使用 router.push() 或 <Link> 進行客戶端路由。
  • APIs:在 pages/api/ 中實作 API 路由,用於伺服器專用邏輯或 Webhook。使用適當的 HTTP 狀態碼來標準化回應。
  • Next.js 15+ 相容性:留意 Next.js 15 升級;確保所有 getServerSideProps 回傳的物件符合預期的 PageProps。
  • 樣式:透過 CSS Modules (*.module.css) 或 Tailwind CSS 標準化樣式。除非在 _app.tsx 中匯入,否則避免使用全域 CSS。

參考資料

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

相關技能