antfu
antfu氏が持つ、ウェブ開発における独自のこだわりと豊富な経験に基づいた、効率的かつ質の高い開発を実現するための推奨設定やベストプラクティスを活用するSkill。
📜 元の英語説明(参考)
Anthony Fu's {Opinionated} preferences and best practices for web development
🇯🇵 日本人クリエイター向け解説
antfu氏が持つ、ウェブ開発における独自のこだわりと豊富な経験に基づいた、効率的かつ質の高い開発を実現するための推奨設定やベストプラクティスを活用するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o antfu.zip https://jpskill.com/download/17183.zip && unzip -o antfu.zip && rm antfu.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/17183.zip -OutFile "$d\antfu.zip"; Expand-Archive "$d\antfu.zip" -DestinationPath $d -Force; ri "$d\antfu.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
antfu.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
antfuフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 8
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Anthony Fu の好み
このスキルでは、Anthony Fu が好む Web 開発のツール、構成、およびベストプラクティスについて説明します。このスキルは独断的なものです。
簡単なまとめ
| カテゴリ | 好み |
|---|---|
| パッケージマネージャー | pnpm |
| 言語 | TypeScript (strict mode) |
| モジュールシステム | ESM ("type": "module") |
| Linting & Formatting | @antfu/eslint-config (Prettier なし) |
| テスト | Vitest |
| Git Hooks | simple-git-hooks + lint-staged |
| ドキュメント | VitePress (docs/ 内) |
コアスタック
パッケージマネージャー (pnpm)
パッケージマネージャーとして pnpm を使用します。
Monorepo のセットアップには、pnpm workspaces を使用します。
# pnpm-workspace.yaml
packages:
- 'packages/*'
pnpm-workspace.yaml で pnpm の名前付きカタログを使用して、依存関係のバージョンを管理します。
| カタログ | 目的 |
|---|---|
prod |
本番環境の依存関係 |
inlined |
バンドラーによってインライン化される依存関係 |
dev |
開発ツール (linter, bundler, testing, dev-server) |
frontend |
フロントエンドにバンドルされるフロントエンドライブラリ |
カタログ名は上記に限定されず、必要に応じて調整できます。デフォルトのカタログの使用は避けてください。
@antfu/ni
統一されたパッケージマネージャーコマンドには、@antfu/ni を使用します。これは、ロックファイルに基づいてパッケージマネージャー (pnpm/npm/yarn/bun) を自動検出します。
| コマンド | 説明 |
|---|---|
ni |
依存関係をインストール |
ni <pkg> |
依存関係を追加 |
ni -D <pkg> |
開発依存関係を追加 |
nr <script> |
スクリプトを実行 |
nu |
依存関係をアップグレード |
nun <pkg> |
依存関係をアンインストール |
nci |
クリーンインストール (pnpm i --frozen-lockfile のように) |
nlx <pkg> |
パッケージを実行 (npx のように) |
コマンドが見つからない場合は、pnpm i -g @antfu/ni でグローバルにインストールします。
TypeScript (Strict Mode)
常に strict mode を有効にして TypeScript を使用します。
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true
}
}
ESM (ECMAScript Modules)
常に ESM モードで作業します。package.json で "type": "module" を設定します。
コード品質
ESLint (@antfu/eslint-config)
フォーマットと linting の両方に @antfu/eslint-config を使用します。これにより、Prettier は不要になります。
// @ts-check コメントを使用して eslint.config.js を作成します。
// @ts-check
import antfu from '@antfu/eslint-config'
export default antfu()
package.json にスクリプトを追加します。
{
"scripts": {
"lint": "eslint ."
}
}
linting エラーが発生した場合は、nr lint --fix で修正してみてください。lint:fix スクリプトは追加しないでください。
Git Hooks (simple-git-hooks + lint-staged)
コミット前の linting には、simple-git-hooks と lint-staged を使用します。
{
"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"
}
}
ユニットテスト (Vitest)
ユニットテストには Vitest を使用します。
{
"scripts": {
"test": "vitest"
}
}
規約:
- テストファイルをソースファイルの隣に配置します:
foo.ts→foo.test.ts(同じディレクトリ) - 高レベルのテストは、各パッケージの
tests/ディレクトリに配置します describeおよびitAPI (testではない) を使用します- アサーションには
expectAPI を使用します - TypeScript の null アサーションにのみ
assertを使用します - 複雑な出力のアサーションには
toMatchSnapshotを使用します - 言語固有の出力には、明示的なファイルパスと拡張子を指定して
toMatchFileSnapshotを使用します (これらのファイルを linting から除外します)
プロジェクトのセットアップ
公開 (ライブラリプロジェクト)
ライブラリプロジェクトの場合、bumpp によってトリガーされる GitHub Releases を通じて公開します。
{
"scripts": {
"release": "bumpp -r"
}
}
ドキュメント (VitePress)
ドキュメントには VitePress を使用します。docs/ ディレクトリの下にドキュメントを配置します。
docs/
├── .vitepress/
│ └── config.ts
├── index.md
└── guide/
└── getting-started.md
package.json にスクリプトを追加します。
{
"scripts": {
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs"
}
}
参考文献
プロジェクトのセットアップ
| トピック | 説明 | 参考文献 |
|---|---|---|
| @antfu/eslint-config | フォーマットと linting のための ESLint フラット構成 | antfu-eslint-config |
| GitHub Actions | sxzz/workflows を使用した推奨ワークフロー | github-actions |
| .gitignore | JS/TS プロジェクトの推奨 .gitignore | gitignore |
| VS Code Extensions | 開発に推奨される拡張機能 | vscode-extensions |
開発
| トピック | 説明 | 参考文献 |
|---|---|---|
| App Development | Vue/Vite/Nuxt/UnoCSS Web アプリケーションの設定 | app-development |
| Library Development | TypeScript ライブラリのバンドルと公開の設定 | library-development |
| Monorepo | pnpm workspaces, centralized alias, Turborepo | monorepo |
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Anthony Fu's Preferences
This skill covers Anthony Fu's preferred tooling, configurations, and best practices for web development. This skill is opinionated.
Quick Summary
| Category | Preference |
|---|---|
| Package Manager | pnpm |
| Language | TypeScript (strict mode) |
| Module System | ESM ("type": "module") |
| Linting & Formatting | @antfu/eslint-config (no Prettier) |
| Testing | Vitest |
| Git Hooks | simple-git-hooks + lint-staged |
| Documentation | VitePress (in docs/) |
Core Stack
Package Manager (pnpm)
Use pnpm as the package manager.
For monorepo setups, use pnpm workspaces:
# pnpm-workspace.yaml
packages:
- 'packages/*'
Use pnpm named catalogs in pnpm-workspace.yaml to manage dependency versions:
| Catalog | Purpose |
|---|---|
prod |
Production dependencies |
inlined |
Dependencies inlined by bundler |
dev |
Development tools (linter, bundler, testing, dev-server) |
frontend |
Frontend libraries bundled into frontend |
Catalog names are not limited to the above and can be adjusted based on needs. Avoid using default catalog.
@antfu/ni
Use @antfu/ni for unified package manager commands. It auto-detects the package manager (pnpm/npm/yarn/bun) based on lockfile.
| Command | Description |
|---|---|
ni |
Install dependencies |
ni <pkg> |
Add dependency |
ni -D <pkg> |
Add dev dependency |
nr <script> |
Run script |
nu |
Upgrade dependencies |
nun <pkg> |
Uninstall dependency |
nci |
Clean install (like pnpm i --frozen-lockfile) |
nlx <pkg> |
Execute package (like npx) |
Install globally with pnpm i -g @antfu/ni if the commands are not found.
TypeScript (Strict Mode)
Always use TypeScript with strict mode enabled.
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true
}
}
ESM (ECMAScript Modules)
Always work in ESM mode. Set "type": "module" in package.json.
Code Quality
ESLint (@antfu/eslint-config)
Use @antfu/eslint-config for both formatting and linting. This eliminates the need for Prettier.
Create eslint.config.js with // @ts-check comment:
// @ts-check
import antfu from '@antfu/eslint-config'
export default antfu()
Add script to package.json:
{
"scripts": {
"lint": "eslint ."
}
}
When getting linting errors, try to fix them with nr lint --fix. Don't add lint:fix script.
Git Hooks (simple-git-hooks + lint-staged)
Use simple-git-hooks with lint-staged for pre-commit linting:
{
"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"
}
}
Unit Testing (Vitest)
Use Vitest for unit testing.
{
"scripts": {
"test": "vitest"
}
}
Conventions:
- Place test files next to source files:
foo.ts→foo.test.ts(same directory) - High-level tests go in
tests/directory in each package - Use
describeanditAPI (nottest) - Use
expectAPI for assertions - Use
assertonly for TypeScript null assertions - Use
toMatchSnapshotfor complex output assertions - Use
toMatchFileSnapshotwith explicit file path and extension for language-specific output (exclude those files from linting)
Project Setup
Publishing (Library Projects)
For library projects, publish through GitHub Releases triggered by bumpp:
{
"scripts": {
"release": "bumpp -r"
}
}
Documentation (VitePress)
Use VitePress for documentation. Place docs under docs/ directory.
docs/
├── .vitepress/
│ └── config.ts
├── index.md
└── guide/
└── getting-started.md
Add script to package.json:
{
"scripts": {
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs"
}
}
References
Project Setup
| Topic | Description | Reference |
|---|---|---|
| @antfu/eslint-config | ESLint flat config for formatting and linting | antfu-eslint-config |
| GitHub Actions | Preferred workflows using sxzz/workflows | github-actions |
| .gitignore | Preferred .gitignore for JS/TS projects | gitignore |
| VS Code Extensions | Recommended extensions for development | vscode-extensions |
Development
| Topic | Description | Reference |
|---|---|---|
| App Development | Preferences for Vue/Vite/Nuxt/UnoCSS web applications | app-development |
| Library Development | Preferences for bundling and publishing TypeScript libraries | library-development |
| Monorepo | pnpm workspaces, centralized alias, Turborepo | monorepo |
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (5,406 bytes)
- 📎 references/antfu-eslint-config.md (6,077 bytes)
- 📎 references/app-development.md (1,149 bytes)
- 📎 references/github-actions.md (1,168 bytes)
- 📎 references/gitignore.md (311 bytes)
- 📎 references/library-development.md (1,848 bytes)
- 📎 references/monorepo.md (2,514 bytes)
- 📎 references/vscode-extensions.md (872 bytes)