jpskill.com
🛠️ 開発・MCP コミュニティ 🔴 エンジニア向け 👤 エンジニア・AI開発者

🛠️ React Best Practices

react-best-practices

ReactやNext.jsを使ったウェブサイトやアプリケーションを、

⏱ MCPサーバー実装 1日 → 2時間

📺 まず動画で見る(YouTube)

▶ 【衝撃】最強のAIエージェント「Claude Code」の最新機能・使い方・プログラミングをAIで効率化する超実践術を解説! ↗

※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。

📜 元の英語説明(参考)

Comprehensive performance optimization guide for React and Next.js applications, maintained by Vercel. Use when writing new React components or Next.js pages, implementing data fetching (client or server-side), or reviewing code for performance issues.

🇯🇵 日本人クリエイター向け解説

一言でいうと

ReactやNext.jsを使ったウェブサイトやアプリケーションを、

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o react-best-practices.zip https://jpskill.com/download/3358.zip && unzip -o react-best-practices.zip && rm react-best-practices.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/3358.zip -OutFile "$d\react-best-practices.zip"; Expand-Archive "$d\react-best-practices.zip" -DestinationPath $d -Force; ri "$d\react-best-practices.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して react-best-practices.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → react-best-practices フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-17
同梱ファイル
2

💬 こう話しかけるだけ — サンプルプロンプト

  • React Best Practices を使って、最小構成のサンプルコードを示して
  • React Best Practices の主な使い方と注意点を教えて
  • React Best Practices を既存プロジェクトに組み込む方法を教えて

これをClaude Code に貼るだけで、このSkillが自動発動します。

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Vercel React ベストプラクティス

Vercel が管理する、React および Next.js アプリケーション向けの包括的なパフォーマンス最適化ガイドです。自動リファクタリングとコード生成をガイドするために、影響度によって優先順位付けされた、8 つのカテゴリにわたる 45 のルールが含まれています。

使用する場面

以下の状況でこれらのガイドラインを参照してください。

  • 新しい React コンポーネントまたは Next.js ページを作成する場合
  • データフェッチ(クライアント側またはサーバー側)を実装する場合
  • パフォーマンスの問題がないかコードをレビューする場合
  • 既存の React/Next.js コードをリファクタリングする場合
  • バンドルサイズまたはロード時間を最適化する場合

優先度別のルールカテゴリ

優先度 カテゴリ 影響度 プレフィックス
1 ウォーターフォールの排除 CRITICAL async-
2 バンドルサイズの最適化 CRITICAL bundle-
3 サーバーサイドのパフォーマンス HIGH server-
4 クライアントサイドのデータフェッチ MEDIUM-HIGH client-
5 再レンダリングの最適化 MEDIUM rerender-
6 レンダリングのパフォーマンス MEDIUM rendering-
7 JavaScript のパフォーマンス LOW-MEDIUM js-
8 高度なパターン LOW advanced-

クイックリファレンス

1. ウォーターフォールの排除 (CRITICAL)

  • async-defer-await - await を実際に使用されるブランチに移動する
  • async-parallel - 独立した操作には Promise.all() を使用する
  • async-dependencies - 部分的な依存関係には better-all を使用する
  • async-api-routes - API ルートではプロミスを早期に開始し、遅延して await する
  • async-suspense-boundaries - Suspense を使用してコンテンツをストリーミングする

2. バンドルサイズの最適化 (CRITICAL)

  • bundle-barrel-imports - バレルファイルを避け、直接インポートする
  • bundle-dynamic-imports - 重いコンポーネントには next/dynamic を使用する
  • bundle-defer-third-party - ハイドレーション後にアナリティクス/ロギングをロードする
  • bundle-conditional - 機能がアクティブ化された場合にのみモジュールをロードする
  • bundle-preload - 知覚的な速度のためにホバー/フォーカス時にプリロードする

3. サーバーサイドのパフォーマンス (HIGH)

  • server-cache-react - リクエストごとの重複排除には React.cache() を使用する
  • server-cache-lru - リクエスト間のキャッシュには LRU キャッシュを使用する
  • server-serialization - クライアントコンポーネントに渡されるデータを最小限にする
  • server-parallel-fetching - フェッチを並列化するためにコンポーネントを再構築する
  • server-after-nonblocking - ノンブロッキング操作には after() を使用する

4. クライアントサイドのデータフェッチ (MEDIUM-HIGH)

  • client-swr-dedup - 自動リクエスト重複排除には SWR を使用する
  • client-event-listeners - グローバルイベントリスナーを重複排除する

5. 再レンダリングの最適化 (MEDIUM)

  • rerender-defer-reads - コールバックでのみ使用される状態を購読しない
  • rerender-memo - 高コストな処理をメモ化されたコンポーネントに抽出する
  • rerender-dependencies - エフェクトではプリミティブな依存関係を使用する
  • rerender-derived-state - 生の値ではなく、派生したブール値を購読する
  • rerender-functional-setstate - 安定したコールバックには関数型 setState を使用する
  • rerender-lazy-state-init - 高コストな値には useState に関数を渡す
  • rerender-transitions - 緊急性の低い更新には startTransition を使用する

6. レンダリングのパフォーマンス (MEDIUM)

  • rendering-animate-svg-wrapper - SVG 要素ではなく、div ラッパーをアニメーション化する
  • rendering-content-visibility - 長いリストには content-visibility を使用する
  • rendering-hoist-jsx - 静的な JSX をコンポーネントの外に抽出する
  • rendering-svg-precision - SVG 座標の精度を減らす
  • rendering-hydration-no-flicker - クライアント専用データにはインラインスクリプトを使用する
  • rendering-activity - 表示/非表示には Activity コンポーネントを使用する
  • rendering-conditional-render - 条件式には && ではなく三項演算子を使用する

7. JavaScript のパフォーマンス (LOW-MEDIUM)

  • js-batch-dom-css - クラスまたは cssText を介して CSS 変更をグループ化する
  • js-index-maps - 繰り返し検索のために Map を構築する
  • js-cache-property-access - ループ内でオブジェクトプロパティをキャッシュする
  • js-cache-function-results - モジュールレベルの Map で関数結果をキャッシュする
  • js-cache-storage - localStorage/sessionStorage の読み取りをキャッシュする
  • js-combine-iterations - 複数の filter/map を 1 つのループに結合する
  • js-length-check-first - 高コストな比較の前に配列の長さをチェックする
  • js-early-exit - 関数から早期にリターンする
  • js-hoist-regexp - ループの外で RegExp の作成をホイストする
  • js-min-max-loop - sort の代わりにループで最小/最大を求める
  • js-set-map-lookups - O(1) 検索には Set/Map を使用する
  • js-tosorted-immutable - 不変性には toSorted() を使用する

8. 高度なパターン (LOW)

  • advanced-event-handler-refs - イベントハンドラーを refs に保存する
  • advanced-use-latest - 安定したコールバック refsuseLatest を使用する

使用方法

詳細な説明とコード例については、個々のルールファイルを読んでください。

rules/async-parallel.md
rules/bundle-barrel-imports.md
rules/_sections.md

各ルールファイルには以下が含まれています。

  • なぜそれが重要なのかについての簡単な説明
  • 誤ったコード例とその説明
  • 正しいコード例とその説明
  • 追加のコンテキストと参照

完全なコンパイル済みドキュメント

すべてのルールが展開された完全なガイドについては、AGENTS.md を参照してください。

使用する場面

このスキルは、概要に記載されているワークフローまたはアクションを実行するのに適用できます。

制限事項

  • このスキルは、タスクが上記の範囲と明確に一致する場合にのみ使用してください。
  • 出力を、環境固有の検証、テスト、または専門家によるレビューの代わりとして扱わないでください。
  • 必要な入力、権限、安全境界、または成功基準が不足している場合は、停止して明確化を求めてください。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Vercel React Best Practices

Comprehensive performance optimization guide for React and Next.js applications, maintained by Vercel. Contains 45 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.

When to Use

Reference these guidelines when:

  • Writing new React components or Next.js pages
  • Implementing data fetching (client or server-side)
  • Reviewing code for performance issues
  • Refactoring existing React/Next.js code
  • Optimizing bundle size or load times

Rule Categories by Priority

Priority Category Impact Prefix
1 Eliminating Waterfalls CRITICAL async-
2 Bundle Size Optimization CRITICAL bundle-
3 Server-Side Performance HIGH server-
4 Client-Side Data Fetching MEDIUM-HIGH client-
5 Re-render Optimization MEDIUM rerender-
6 Rendering Performance MEDIUM rendering-
7 JavaScript Performance LOW-MEDIUM js-
8 Advanced Patterns LOW advanced-

Quick Reference

1. Eliminating Waterfalls (CRITICAL)

  • async-defer-await - Move await into branches where actually used
  • async-parallel - Use Promise.all() for independent operations
  • async-dependencies - Use better-all for partial dependencies
  • async-api-routes - Start promises early, await late in API routes
  • async-suspense-boundaries - Use Suspense to stream content

2. Bundle Size Optimization (CRITICAL)

  • bundle-barrel-imports - Import directly, avoid barrel files
  • bundle-dynamic-imports - Use next/dynamic for heavy components
  • bundle-defer-third-party - Load analytics/logging after hydration
  • bundle-conditional - Load modules only when feature is activated
  • bundle-preload - Preload on hover/focus for perceived speed

3. Server-Side Performance (HIGH)

  • server-cache-react - Use React.cache() for per-request deduplication
  • server-cache-lru - Use LRU cache for cross-request caching
  • server-serialization - Minimize data passed to client components
  • server-parallel-fetching - Restructure components to parallelize fetches
  • server-after-nonblocking - Use after() for non-blocking operations

4. Client-Side Data Fetching (MEDIUM-HIGH)

  • client-swr-dedup - Use SWR for automatic request deduplication
  • client-event-listeners - Deduplicate global event listeners

5. Re-render Optimization (MEDIUM)

  • rerender-defer-reads - Don't subscribe to state only used in callbacks
  • rerender-memo - Extract expensive work into memoized components
  • rerender-dependencies - Use primitive dependencies in effects
  • rerender-derived-state - Subscribe to derived booleans, not raw values
  • rerender-functional-setstate - Use functional setState for stable callbacks
  • rerender-lazy-state-init - Pass function to useState for expensive values
  • rerender-transitions - Use startTransition for non-urgent updates

6. Rendering Performance (MEDIUM)

  • rendering-animate-svg-wrapper - Animate div wrapper, not SVG element
  • rendering-content-visibility - Use content-visibility for long lists
  • rendering-hoist-jsx - Extract static JSX outside components
  • rendering-svg-precision - Reduce SVG coordinate precision
  • rendering-hydration-no-flicker - Use inline script for client-only data
  • rendering-activity - Use Activity component for show/hide
  • rendering-conditional-render - Use ternary, not && for conditionals

7. JavaScript Performance (LOW-MEDIUM)

  • js-batch-dom-css - Group CSS changes via classes or cssText
  • js-index-maps - Build Map for repeated lookups
  • js-cache-property-access - Cache object properties in loops
  • js-cache-function-results - Cache function results in module-level Map
  • js-cache-storage - Cache localStorage/sessionStorage reads
  • js-combine-iterations - Combine multiple filter/map into one loop
  • js-length-check-first - Check array length before expensive comparison
  • js-early-exit - Return early from functions
  • js-hoist-regexp - Hoist RegExp creation outside loops
  • js-min-max-loop - Use loop for min/max instead of sort
  • js-set-map-lookups - Use Set/Map for O(1) lookups
  • js-tosorted-immutable - Use toSorted() for immutability

8. Advanced Patterns (LOW)

  • advanced-event-handler-refs - Store event handlers in refs
  • advanced-use-latest - useLatest for stable callback refs

How to Use

Read individual rule files for detailed explanations and code examples:

rules/async-parallel.md
rules/bundle-barrel-imports.md
rules/_sections.md

Each rule file contains:

  • Brief explanation of why it matters
  • Incorrect code example with explanation
  • Correct code example with explanation
  • Additional context and references

Full Compiled Document

For the complete guide with all rules expanded: AGENTS.md

When to Use

This skill is applicable to execute the workflow or actions described in the overview.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。