Communitygithub.com

ComeOnOliver/skillshub

使用 Feature-Sliced Design (FSD) 构建可扩展的项目结构。适用于使用 Feature-Sliced Design 架构组织 Next.js 项目时。

skillshub 是什么?

该技能指导开发者采用 Feature-Sliced Design (FSD) 架构来构建可扩展的 Next.js 应用程序。FSD 通过业务领域(如用户、产品、购物车)对代码进行分组,而不是按文件类型(如组件、钩子、工具),从而提高了模块化和可维护性。技能强调了严格的层间导入规则(应用 → 部件 → 特性 → 实体 → 共享),并建议保持应用层薄,仅用于路由。它包含一个详细的结构参考、强制性的架构检查清单(如层导入、页面逻辑、RSC 边界和公共 API),以及避免反模式的指导,如跨切片导入和过早创建实体。该技能警告 FSD 可能会引入样板代码,因此建议仅用于预期会显著增长的项目。

兼容平台~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 的新对话。

文档

架构(功能切片设计)

优先级: P2(中等)

采用 功能切片设计 (FSD) 构建可扩展的应用程序。 警告: FSD 会引入样板代码。仅当项目预期会显著增长(例如 20 个以上功能)时使用。对于较小的项目,优先使用简单的模块化结构。

策略

  1. RSC 边界: 严格执行从服务端到客户端传递 props 的序列化规则。参见 RSC 边界与序列化。
  2. 应用层要薄: app/ 目录(App Router)仅用于路由。
    • 规则: page.tsx 只能导入 Widgets/Features。页面中不应直接包含业务逻辑(useEffect、fetch)。
  3. 按切片而非类型分组: 按业务领域(用户、产品、购物车)对代码进行分组,而不是按文件类型(组件、钩子、工具)。
    • 糟糕: src/components/LoginForm.tsx、src/hooks/useLogin.ts
    • 良好: src/features/auth/login/ 包含两者。
  4. 层层级: 代码只能从低于它的层中导入。
    • App -> Widgets -> Features -> Entities -> Shared。
  5. 避免过多的实体: 不要过早地创建 Entities。
    • 规则: 从 Features 或 Pages 开始逻辑。仅当数据/逻辑在多个不同的 feature 中严格复用时,才将其移至 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 边界: 服务端组件是否与客户端组件正确隔离,并使用正确的 'use client' 边界?

  • 公共 API: 对某个切片的所有访问是否都通过顶层 index.ts(公共 API)执行?

  • 跨切片: 同一层内的切片(例如两个 feature)是否直接相互导入?(禁止)

  • Server Actions: 将它们放在 Feature 的 model/ 文件夹中(例如 features/auth/model/actions.ts)。

  • 数据访问层 (DAL): 将逻辑放在 Entity 的 model/ 文件夹中(例如 entities/user/model/dal.ts)。

  • UI 组件: 基础 UI(shadcn)属于 shared/ui。特定于 Feature 的 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

相关技能