Communitygithub.com

ComeOnOliver/skillshub

Anthony Fu 在 JavaScript/TypeScript 專案中慣用的工具與規範。適用於設定新專案、配置 ESLint/Prettier 替代方案、monorepo、函式庫發布,或當使用者提及 Anthony Fu 的偏好時。

skillshub 是什麼?

這個技能封裝了 Anthony Fu 對於 JavaScript/TypeScript 開發的高度個人化且經過實務驗證的偏好設定,包括程式碼風格、工具鏈選擇以及專案結構。它為開發者提供了一套完整的「約定優於配置」的基礎,涵蓋 TypeScript 嚴格模式、以 @antfu/eslint-config 為核心的 ESLint 設定、基於 pnpm catalogs 的依賴管理、以及透過 simple-git-hooks 與 lint-staged 實作的 Git hooks。技能本身不會自動執行安裝,而是作為一份「活文件」,由 AI 助理在設定新專案或回答相關問題時,根據文件中定義的規則與組態範本,動態產生對應的安裝指令與程式碼片段。它支援 Claude Code、Cursor 等主要 AI 編碼工具,並透過多份參考文件深入說明 ESLint 配置、專案初始化、應用程式開發(Vue/Nuxt/UnoCSS)、函式庫開發(tsdown/pure ESM)以及 monorepo 管理(pnpm workspaces/Turborepo)等進階主題。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/antfu/skills/antfu

在你喜歡的 AI 中提問

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

說明文件

編碼慣例

程式碼組織

  • 單一職責:每個原始檔都應有明確、專注的範圍/目的
  • 拆分大型檔案:當檔案變得龐大或處理過多關注點時,將其拆分
  • 型別分離:總是將型別與介面分離到 types.ts 或 types/*.ts 中
  • 常數提取:將常數移到專屬的 constants.ts 檔案

執行環境

  • 偏好同位程式碼:盡可能撰寫無關執行環境的程式碼,使其在 Node、瀏覽器與 Worker 中皆可運作
  • 明確的環境標示:當程式碼是特定環境專用時,在檔案頂部加入註解:
// @env node
// @env browser

TypeScript

  • 明確的回傳型別:盡可能明確宣告回傳型別
  • 避免複雜的行內型別:將複雜型別提取到專屬的 type 或 interface 宣告中

註解

  • 避免不必要的註解:程式碼應能自我解釋
  • 說明「為什麼」而非「怎麼做」:註解應描述推理過程或意圖,而非程式碼在做什麼

測試(Vitest)

  • 測試檔案:foo.ts → foo.test.ts(同一目錄)
  • 使用 describe / it API(非 test)
  • 使用 toMatchSnapshot 處理複雜輸出
  • 使用 toMatchFileSnapshot 搭配明確路徑處理語言專用快照

工具選擇

@antfu/ni 指令

指令說明
ni安裝相依套件
ni <pkg> / ni -D <pkg>新增相依套件 / 開發相依套件
nr <script>執行腳本
nu升級相依套件
nun <pkg>移除相依套件
nci乾淨安裝(pnpm i --frozen-lockfile)
nlx <pkg>執行套件(npx)

TypeScript 設定

{
  "compilerOptions": {
    "target": "ESNext",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true
  }
}

ESLint 設定

// eslint.config.mjs
import antfu from '@antfu/eslint-config'

export default antfu()

完成任務時,請執行 pnpm run lint --fix 來格式化程式碼並修正程式碼風格。

詳細配置選項請參閱:antfu-eslint-config

Git Hooks

{
  "simple-git-hooks": {
    "pre-commit": "pnpm i --frozen-lockfile --ignore-scripts --offline && npx lint-staged"
  },
  "lint-staged": { "*": "eslint --fix" },
  "scripts": {
    "prepare": "npx simple-git-hooks"
  }
}

pnpm Catalogs

在 pnpm-workspace.yaml 中使用具名目錄(catalogs)來管理版本:

目錄用途
prod生產相依套件
inlined建置工具內嵌的相依套件
dev開發工具(linter、bundler、測試)
frontend前端函式庫

避免使用預設目錄。目錄名稱可根據專案需求調整。


參考資料

主題說明參考文件
ESLint 設定框架支援、格式化工具、規則覆寫、VS Code 設定antfu-eslint-config
專案設定.gitignore、GitHub Actions、VS Code 擴充功能setting-up
應用程式開發Vue/Nuxt/UnoCSS 慣例與模式app-development
函式庫開發tsdown 打包、純 ESM 發布library-development
Monorepopnpm workspaces、集中式別名、Turborepomonorepo

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

相關技能