Communitygithub.com

Anthony Fu 流 JavaScript/TypeScript プロジェクトツールキット

Anthony Fu が好む JavaScript/TypeScript プロジェクトのツールと規約。新しいプロジェクトのセットアップ、ESLint/Prettier の代替設定、モノレポ、ライブラリ公開、またはユーザーが Anthony Fu の好みに言及した場合に使用します。

TypeScript プロジェクトツールキット とは?

このスキルは、Anthony Fu が推奨する JavaScript/TypeScript プロジェクトのツールとコーディング規約を提供します。新しいプロジェクトの初期設定、ESLint/Prettier 代替設定、モノレポ構成、ライブラリ公開など、幅広いユースケースをカバーします。主に pnpm ベースの環境を想定し、@antfu/ni コマンド群、@antfu/eslint-config ルール、simple-git-hooks による Git フック、pnpm カタログによるバージョン管理などの具体的な設定例を含みます。また、コード整理、TypeScript の型定義、テスト (Vitest) の記法、環境依存コードのマーキングなど、プロジェクト全体で一貫性を保つためのプラクティスも定義されています。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/antfu/skills/antfu

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

コーディング規約

コードの整理

  • 単一責任: 各ソースファイルは明確で焦点を絞った目的/スコープを持つ
  • 大きなファイルの分割: ファイルが大きくなりすぎたり、多くの関心事を扱う場合は分割する
  • 型の分離: 型とインターフェースは常に types.ts または types/*.ts に分離する
  • 定数の抽出: 定数は専用の constants.ts ファイルに移動する

実行環境

  • アイソモーフィックなコードを推奨: 可能な限り Node、ブラウザ、ワーカーで動作するランタイム非依存のコードを記述する
  • ランタイムの明示: コードが環境固有の場合、ファイルの先頭にコメントを追加する:
// @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 フック

{
  "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 カタログ

バージョン管理には、pnpm-workspace.yaml で名前付きカタログを使用:

カタログ目的
prod本番依存関係
inlinedバンドラーにインライン化される依存関係
dev開発ツール (リンター、バンドラー、テスト)
frontendフロントエンドライブラリ

デフォルトカタログは避けてください。カタログ名はプロジェクトのニーズに応じて調整できます。


リファレンス

トピック説明リファレンス
ESLint 設定フレームワークサポート、フォーマッター、ルールオーバーライド、VS Code 設定antfu-eslint-config
プロジェクト設定.gitignore、GitHub Actions、VS Code 拡張機能setting-up
アプリ開発Vue/Nuxt/UnoCSS の規約とパターンapp-development
ライブラリ開発tsdown バンドル、純粋な ESM 公開library-development
モノレポpnpm ワークスペース、集中エイリアス、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

関連スキル