Communitygithub.com

ComeOnOliver/skillshub

可擴展的專案結構,採用 Feature-Sliced Design (FSD)。當需要使用 Feature-Sliced Design 架構建構 Next.js 專案時使用。(觸發條件:src/features/**、src/entities/**、src/widgets/**、FSD、Feature Sliced Design、slices、segments)

skillshub 是什麼?

此技能強制在 Next.js 專案中採用 **Feature-Sliced Design (FSD)** 架構,以實現可擴展性和長期可維護性。它定義了嚴格的層級依賴規則(App → Widgets → Features → Entities → Shared),防止循環引用和橫向導入。技能提供了一套完整的目錄結構參考、RSC 邊界序列化規則,以及一個強制性的架構檢查清單,確保遵循最佳實踐。它支援透過 `src/features/`、`src/entities/` 和 `src/widgets/` 路徑自動觸發,並包含反模式清單,以幫助開發者避免常見陷阱。此技能最適合預計將成長至 20 個以上功能的專案,因為它會引入一定程度的樣板程式碼。

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

在你喜歡的 AI 中提問

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

說明文件

架構(Feature-Sliced Design)

優先級:P2(中等)

對可擴展的應用程式採用 Feature-Sliced Design (FSD)。 警告:FSD 會引入樣板程式碼。僅在預期專案會顯著成長(例如,20 個以上功能)時使用。對於較小的專案,建議使用簡單的基於模組的結構。

策略

  1. RSC 邊界:對從 Server 傳遞到 Client 的 props 強制執行嚴格的序列化規則。請參閱 RSC 邊界與序列化。
  2. App 層應保持輕薄:app/ 目錄(App Router)僅用於路由。
    • 規則:page.tsx 應僅導入 Widgets/Features。頁面中不得包含業務邏輯(useEffect、fetch)。
  3. 按切片而非類型分組:按業務領域(User、Product、Cart)對程式碼進行分組,而非按檔案類型(Components、Hooks、Utils)。
    • 錯誤:src/components/LoginForm.tsx、src/hooks/useLogin.ts
    • 正確:src/features/auth/login/ 包含兩者。
  4. 層級依賴規則:程式碼只能從 更低的層級 進行導入。
    • App -> Widgets -> Features -> Entities -> Shared。
  5. 避免過多的 Entity:不要預先建立 Entity。
    • 規則:在 Features 或 Pages 中開始邏輯。僅在資料/邏輯嚴格跨多個不同功能被重複使用時,才將其移至 Entities。
    • 規則:簡單的 CRUD 屬於 shared/api,而非 entities。
  6. 使用標準區段:在切片內部使用標準的區段名稱。
    • ui(元件)、model(狀態/動作)、api(資料擷取)、lib(輔助程式)、config(常數)。
    • 避免:將 components、hooks、services 用作區段名稱。

結構參考

有關具體的目錄佈局和層級定義,請參閱參考文件。

架構檢查清單(強制性)

  • 層級導入:是否有任何層級從其上方的層級導入?(App > Widgets > Features > Entities > Shared)

  • 頁面邏輯:page.tsx 是否保持輕薄,僅包含 Widgets/Features 且不含任何 useEffect/fetch?

  • RSC 邊界:Server 元件是否透過適當的 'use client' 邊界與 Client 元件隔離?

  • 公共 API:對切片的存取是否全部透過頂層的 index.ts(公共 API)進行?

  • 跨切片:同一個層級內的切片(例如,兩個 features)是否會直接互相導入?(禁止)

  • Server Actions:將它們放置在 Feature 的 model/ 資料夾中(例如,features/auth/model/actions.ts)。

  • 資料存取層 (DAL):將邏輯放置在 Entity 的 model/ 資料夾中(例如,entities/user/model/dal.ts)。

  • UI 元件:基礎 UI (shadcn) 屬於 shared/ui。特定功能的 UI 屬於 features/*/ui。

反模式

  • 禁止跨切片導入:同一層級內的切片不得直接互相導入。
  • 禁止在 page.tsx 中撰寫業務邏輯:頁面僅導入 Widgets/Features;禁止任何 useEffect/fetch。
  • 禁止按檔案類型分組的資料夾:按領域分組(features/auth/),而非按類型(components/、hooks/)。
  • 禁止預先建立 Entity:從 Features 開始;僅在嚴格重複使用時才移至 Entities。

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

相關技能