Communitygithub.com

PhuongDeveloper/landingpage

スケーラブルなReactコンポジションパターン。ブール値のプロップが乱立するコンポーネントのリファクタリングや、柔軟なコンポーネントライブラリの構築、再利用可能なAPIの設計に使用します。複合コンポーネント、レンダープロップ、コンテキストプロバイダー、コンポーネントアーキテクチャに関するタスクで発動します。React 19のAPI変更を含みます。

landingpage とは?

このスキルは、Reactアプリケーションにおいてスケーラブルで保守性の高いコンポーネント設計を実現するためのコンポジションパターンを提供します。主な目的は、ブール値のプロップがコードベースに蔓延する「boolean prop proliferation」問題を解決し、複合コンポーネント、コンテキストプロバイダー、レンダープロップなどのパターンを通じて柔軟なAPIを設計することです。開発者やAIエージェントが大規模なコードベースでも容易に作業できるよう、コンポーネントアーキテクチャ、状態管理、実装パターン、React 19の新API(forwardRef廃止と`use()`の導入)という4つの優先カテゴリに分けてルールが整理されています。各ルールは個別のマークダウンファイルとして提供され、不適切なコード例と修正例が含まれるため、実践的な学習と適用が可能です。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/PhuongDeveloper/landingpage/tree/HEAD/.agents/skills/vercel-composition-patterns

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

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

ドキュメント

Reactコンポジションパターン

柔軟で保守性の高いReactコンポーネントを構築するためのコンポジションパターン。ブール値のプロップが乱立するのを避けるために、複合コンポーネント、状態の引き上げ、内部のコンポジションを活用します。これらのパターンにより、コードベースは人間とAIエージェントの両方にとってスケールしやすくなります。

適用するタイミング

以下のガイドラインを参考にしてください:

  • 多くのブール値プロップを持つコンポーネントをリファクタリングする場合
  • 再利用可能なコンポーネントライブラリを構築する場合
  • 柔軟なコンポーネントAPIを設計する場合
  • コンポーネントアーキテクチャをレビューする場合
  • 複合コンポーネントやコンテキストプロバイダーを扱う場合

ルールカテゴリ(優先順位順)

優先度カテゴリインパクトプレフィックス
1コンポーネントアーキテクチャ高architecture-
2状態管理中state-
3実装パターン中patterns-
4React 19 API中react19-

クイックリファレンス

1. コンポーネントアーキテクチャ(高)

  • architecture-avoid-boolean-props - 動作をカスタマイズするためにブール値プロップを追加しないでください。代わりにコンポジションを使用します。
  • architecture-compound-components - 複雑なコンポーネントを共有コンテキストで構成します。

2. 状態管理(中)

  • state-decouple-implementation - プロバイダーのみが状態の管理方法を知っているようにします。
  • state-context-interface - 状態、アクション、メタを含むジェネリックインターフェースを定義し、依存性注入を行います。
  • state-lift-state - 状態をプロバイダーコンポーネントに引き上げ、兄弟間でアクセスできるようにします。

3. 実装パターン(中)

  • patterns-explicit-variants - ブール値モードの代わりに、明示的なバリアントコンポーネントを作成します。
  • patterns-children-over-render-props - renderXプロップの代わりに子要素を使ってコンポジションを行います。

4. React 19 API(中)

⚠️ React 19+ のみ。 React 18以前を使用している場合はこのセクションをスキップしてください。

  • react19-no-forwardref - forwardRefを使用せず、useContext()の代わりにuse()を使用します。

使い方

個別のルールファイルには、詳細な説明とコード例が含まれています:

rules/architecture-avoid-boolean-props.md
rules/state-context-interface.md

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

  • なぜ重要なのかの簡単な説明
  • 不適切なコード例とその説明
  • 正しいコード例とその説明
  • 追加のコンテキストと参照情報

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

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

Individual skills in this repo

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

PhuongDeveloper/landingpage

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".

PhuongDeveloper/landingpage

Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pg_cron, pgmq), vector/semantic search (pgvector), and restoring dumps (pg_restore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.

PhuongDeveloper/landingpage

Use when doing ANY task involving Supabase. Triggers: Supabase products (Database, Auth, Edge Functions, Realtime, Storage, Vectors, Cron, Queues); client libraries and SSR integrations (supabase-js, @supabase/ssr) in Next.js, React, SvelteKit, Astro, Remix; auth issues (login, logout, sessions, JWT, cookies, getSession, getUser, getClaims, RLS); Supabase CLI or MCP server; schema changes, migrations, declarative schemas, security audits, Postgres extensions (pg_graphql, pg_cron, pg_vector); debugging and troubleshooting errors or unexpected behavior on Supabase projects (HTTP errors, Postgres errors, RLS surprises, permission denied, schema cache issues, timeouts, Edge Function crashes, Realtime drops, Storage failures) and reading or querying logs (Logs Explorer, ClickHouse).

PhuongDeveloper/landingpage

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

関連スキル