Communitygithub.com

xzedm/clipplic-landing

Vercel Engineering による React および Next.js のパフォーマンス最適化ガイドライン。React コンポーネントや Next.js ページの作成、レビュー、リファクタリング時に最適なパフォーマンスパターンを適用するために使用します。

clipplic-landing とは?

このスキルは、Vercel が管理する React および Next.js アプリケーション向けの包括的なパフォーマンス最適化ガイドです。70 のルールが 8 つのカテゴリに分類され、優先度に応じて自動リファクタリングやコード生成を支援します。主なカテゴリには「ウォーターフォールの解消」「バンドルサイズの最適化」「サーバーサイドパフォーマンス」「クライアントサイドデータフェッチ」「再レンダリング最適化」「レンダリングパフォーマンス」「JavaScript パフォーマンス」「高度なパターン」が含まれます。Claude Code や Cursor などの AI エージェントと統合して使用でき、React コンポーネントや Next.js のページ作成、データフェッチ、コードレビュー、バンドル最適化のタスクで自動的にトリガーされます。各ルールは詳細な説明とコード例を含む個別のファイルで提供され、開発者が即座に実践可能なベストプラクティスを提供します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/xzedm/clipplic-landing/tree/HEAD/.agents/skills/vercel-react-best-practices

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

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

ドキュメント

Vercel React ベストプラクティス

React および Next.js アプリケーション向けの包括的なパフォーマンス最適化ガイド。Vercel が管理しています。8 カテゴリにまたがる 70 のルールが優先度順に整理されており、自動リファクタリングやコード生成を支援します。

適用タイミング

以下のケースでこれらのガイドラインを参照してください:

  • 新しい React コンポーネントや Next.js ページを作成するとき
  • データフェッチ(クライアントサイド / サーバーサイド)を実装するとき
  • コードをパフォーマンスの観点でレビューするとき
  • 既存の React / Next.js コードをリファクタリングするとき
  • バンドルサイズや読み込み時間を最適化するとき

優先順位別ルールカテゴリ

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

クイックリファレンス

1. ウォーターフォールの解消(重大)

  • async-cheap-condition-before-await - await する前に安価な同期条件をチェックする
  • async-defer-await - await を実際に使用する分岐に移動する
  • async-parallel - 独立した処理には Promise.all() を使用する
  • async-dependencies - 部分的な依存関係には better-all を使用する
  • async-api-routes - API ルートではプロミスを早期に開始し、遅れて await する
  • async-suspense-boundaries - Suspense を使用してコンテンツをストリーミングする

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

  • bundle-barrel-imports - バレルファイルを避け、直接インポートする
  • bundle-analyzable-paths - 静的に解析可能なインポートパスとファイルシステムパスを優先し、広範なバンドルやトレースを避ける
  • bundle-dynamic-imports - 重いコンポーネントには next/dynamic を使用する
  • bundle-defer-third-party - アナリティクス/ログはハイドレーション後に読み込む
  • bundle-conditional - 機能が有効な場合のみモジュールを読み込む
  • bundle-preload - ホバー/フォーカス時にプリロードして体感速度を向上させる

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

  • server-auth-actions - サーバーアクションを API ルートと同様に認証する
  • server-cache-react - React.cache() を使用してリクエストごとの重複排除を行う
  • server-cache-lru - LRU キャッシュを使用してリクエスト間キャッシュを行う
  • server-dedup-props - RSC プロパティの重複シリアライズを避ける
  • server-hoist-static-io - 静的な I/O(フォント、ロゴ)をモジュールレベルに引き上げる
  • server-no-shared-module-state - RSC/SSR でモジュールレベルの可変リクエスト状態を避ける
  • server-serialization - クライアントコンポーネントに渡すデータを最小化する
  • server-parallel-fetching - フェッチを並列化するようにコンポーネントを再構成する
  • server-parallel-nested-fetching - ネストされたフェッチを Promise.all 内でアイテムごとに連鎖させる
  • server-after-nonblocking - 非ブロッキング処理には after() を使用する

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

  • client-swr-dedup - SWR を使用して自動リクエスト重複排除を行う
  • client-event-listeners - グローバルイベントリスナーを重複排除する
  • client-passive-event-listeners - スクロールにはパッシブリスナーを使用する
  • client-localstorage-schema - localStorage データにバージョン管理と最小化を適用する

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

  • rerender-defer-reads - コールバックでしか使わない state にサブスクライブしない
  • rerender-memo - 重い処理をメモ化されたコンポーネントに抽出する
  • rerender-memo-with-default-value - デフォルトの非プリミティブプロップを引き上げる
  • rerender-dependencies - エフェクトではプリミティブな依存関係を使用する
  • rerender-derived-state - 生の値ではなく、派生した真偽値にサブスクライブする
  • rerender-derived-state-no-effect - エフェクトではなくレンダリング中に state を導出する
  • rerender-functional-setstate - 安定したコールバックには関数型 setState を使用する
  • rerender-lazy-state-init - 重い値には関数を useState に渡す
  • rerender-simple-expression-in-memo - 単純なプリミティブには memo を避ける
  • rerender-split-combined-hooks - 独立した依存関係を持つフックを分割する
  • rerender-move-effect-to-event - インタラクションロジックをイベントハンドラに移す
  • rerender-transitions - 緊急でない更新には startTransition を使用する
  • rerender-use-deferred-value - 重いレンダリングを遅延させ、入力の応答性を維持する
  • rerender-use-ref-transient-values - 頻繁に変わる一時的な値には ref を使用する
  • rerender-no-inline-components - コンポーネントの中にコンポーネントを定義しない

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

  • rendering-animate-svg-wrapper - SVG 要素ではなく div ラッパーをアニメーションさせる
  • rendering-content-visibility - 長いリストには content-visibility を使用する
  • rendering-hoist-jsx - 静的な JSX をコンポーネントの外に抽出する
  • rendering-svg-precision - SVG 座標の精度を下げる
  • rendering-hydration-no-flicker - クライアントのみのデータにはインラインスクリプトを使用する
  • rendering-hydration-suppress-warning - 予想される不一致を抑制する
  • rendering-activity - 表示/非表示には Activity コンポーネントを使用する
  • rendering-conditional-render - 条件分岐には && ではなく三項演算子を使用する
  • rendering-usetransition-loading - ローディング状態には useTransition を優先する
  • rendering-resource-hints - プリロードに React DOM のリソースヒントを使用する
  • rendering-script-defer-async - script タグには defer または async を使用する

7. JavaScript パフォーマンス(低-中)

  • 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 - 関数から早期に return する
  • js-hoist-regexp - RegExp の生成をループの外に引き上げる
  • js-min-max-loop - 最小値/最大値を求めるには sort ではなくループを使用する
  • js-set-map-lookups - O(1) 検索には Set / Map を使用する
  • js-tosorted-immutable - 不変性のために toSorted() を使用する
  • js-flatmap-filter - flatMap でマップとフィルタを 1 パスで行う
  • js-request-idle-callback - 重要でない処理をブラウザのアイドル時間に延期する

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

  • advanced-effect-event-deps - useEffectEvent の結果をエフェクトの依存関係に入れない
  • advanced-event-handler-refs - イベントハンドラを ref に保存する
  • advanced-init-once - アプリ読み込みごとに 1 回だけ初期化する
  • advanced-use-latest - 安定したコールバック ref には useLatest を使用する

使い方

個別のルールファイルで詳細な説明とコード例を確認してください:

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

各ルールファイルには以下が含まれます:

  • そのルールが重要な理由の簡単な説明
  • 間違ったコード例とその説明
  • 正しいコード例とその説明
  • 追加のコンテキストと参考情報

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

すべてのルールを展開した完全ガイドはこちら:AGENTS.md

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

xzedm/clipplic-landing

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.

xzedm/clipplic-landing

Material Design 3 and Android platform guidelines. Use when building Android apps with Jetpack Compose or XML layouts, implementing Material You, navigation, or accessibility. Triggers on tasks involving Android UI, Compose components, dynamic color, or Material Design compliance.

xzedm/clipplic-landing

Apple's approach to interface design and fluid, physical motion, translated for the web. Use when building or reviewing gesture-driven UI, spring animations, drag/swipe/sheet interactions, momentum and interruptible transitions, translucent materials and depth, typography (optical sizing, tracking, leading), reduced-motion, or the design foundations (feedback, spatial consistency, restraint) behind Apple-style interfaces.

xzedm/clipplic-landing

Design iOS apps following Apple's Human Interface Guidelines. Generate native components, validate designs, and ensure accessibility compliance for iPhone, iPad, and Apple Watch.

xzedm/clipplic-landing

Redesign mobile app UI to feel unmistakably Apple-like, iOS-forward, and native. Use this skill when building iOS apps, applying Apple Human Interface Guidelines, or creating native-feeling mobile interfaces with SF Pro typography, translucency, and system-like components.

xzedm/clipplic-landing

Accessibility engineering for product interfaces, from focus states and keyboard support to ARIA, forms, and screen readers. Use when building or reviewing UI components, modals, menus, forms, custom widgets, or when the user says "make this accessible" or reports keyboard or screen-reader issues. Triggers on accessibility, a11y, WCAG, aria, focus ring, focus-visible, focus trap, keyboard navigation, tab order, tabindex, screen reader, sr-only, aria-live, alt text, hit area, touch target, prefers-reduced-motion, autoplay, toast duration, skip link, semantic HTML, aria-label, form errors, disabled buttons, "not keyboard accessible".

xzedm/clipplic-landing

OKLCH color space and color usage for web projects. Convert hex/rgb/hsl to oklch, generate palettes, check contrast, handle gamut boundaries, theme with Tailwind v4, and apply color with meaning. Triggers on oklch, color conversion, palette generation, contrast ratio, gamut, display p3, design tokens, semantic color tokens, hue drift, chroma, dark mode colors, accent color, color meaning, light and dark appearance, increased contrast.

xzedm/clipplic-landing

Layout structure for web interfaces, from grouping and alignment to reading order, progressive disclosure, and adaptive breakpoints. Use when structuring a page or component, spacing or aligning controls, deciding what collapses at small sizes, handling RTL layout direction, or reviewing frontend code for layout. Triggers on layout, spacing, alignment, grouping, negative space, whitespace, visual hierarchy, reading order, progressive disclosure, breakpoints, responsive layout, container queries, safe area, full-bleed, edge-to-edge, layout margins, RTL layout, logical properties.

xzedm/clipplic-landing

Web typography from choosing fonts to spacing, wrapping and accessibility. Use when picking or pairing typefaces, configuring variable fonts or OpenType features, setting up a type scale, checking heading hierarchy, styling text in components, truncating text, styling underlines, selection, placeholders or carets, or reviewing frontend code for typography. Triggers on typography, fonts, font formats, woff2, variable fonts, font-weight, opentype, font-feature-settings, letter-spacing, line-height, type scale, heading hierarchy, heading levels, tabular numbers, text-wrap, truncation, line clamp, underlines, text-decoration, text selection, iOS input zoom, scaled input text, font smoothing, text contrast, measure, line length, text-box, smart punctuation, drop cap.

xzedm/clipplic-landing

Design engineering principles for making interfaces feel polished. Use when building UI components, reviewing frontend code, implementing animations, hover states, shadows, borders, micro-interactions, enter/exit animations, choosing or reviewing icons, or any visual detail work. Triggers on UI polish, design details, "make it feel better", "feels off", stagger animations, border radius, optical alignment, image outlines, box shadows, icons, icon stroke weight, icon states, motion restraint.

xzedm/clipplic-landing

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

xzedm/clipplic-landing

Generate developer handoff specs from a design. Use when a design is ready for engineering and needs a spec sheet covering layout, design tokens, component props, interaction states, responsive breakpoints, edge cases, and animation details.

xzedm/clipplic-landing

This skill encodes Emil Kowalski's philosophy on UI polish, component design, animation decisions, and the invisible details that make software feel great.

xzedm/clipplic-landing

Extract design primitives from a public website and generate starter token files for your project.

xzedm/clipplic-landing

Use this skill alongside figma-use when the task involves translating an application page, view, or multi-section layout into Figma. Triggers: 'write to Figma', 'create in Figma from code', 'push page to Figma', 'take this app/page and build it in Figma', 'create a screen', 'build a landing page in Figma', 'update the Figma screen to match code', 'convert this modal/dialog/drawer/panel to Figma'. This is the preferred workflow skill whenever the user wants to build or update a full page, modal, dialog, drawer, sidebar, panel, or any composed multi-section view in Figma from code or a description. Discovers design system components, variables, and styles from Code Connect files, existing screens, and library search, then imports them and assembles views incrementally section-by-section using design system tokens instead of hardcoded values.

xzedm/clipplic-landing

**MANDATORY prerequisite**: you MUST invoke this skill BEFORE every `use_figma` tool call. NEVER call `use_figma` directly without loading this skill first. Skipping it causes common, hard-to-debug failures. Trigger whenever the user wants to perform a write action or a unique read action that requires JavaScript execution in the Figma file context, e.g. create/edit/delete nodes, set up variables or tokens, build components and variants, modify auto-layout or fills, bind variables to properties, or inspect file structure programmatically.

xzedm/clipplic-landing

Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.

xzedm/clipplic-landing

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications.

xzedm/clipplic-landing

Elite UX/UI & Advanced GSAP Motion Engineer. Enforces Python-driven true randomization for layout variance, strict AIDA page structure, wide editorial typography (bans 6-line wraps), gapless bento grids, strict GSAP ScrollTriggers (pinning, stacking, scrubbing), inline micro-images, and massive section spacing.

xzedm/clipplic-landing

Fast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)

関連スキル