| name | react-component-conventions |
| description | React component design conventions focusing on Server/Client component boundaries, composition patterns, and data flow. Auto-triggers when writing or modifying React components to ensure correct RSC patterns and optimal component architecture. |
React Component Design Conventions
React コンポーネント設計の規約集。Server Components / Client Components の境界設計、Composition パターン、データフローに関するルールを定義する。
When to Apply
以下の作業時に自動で参照する:
- React コンポーネントの新規作成
- 既存コンポーネントのリファクタリング
"use client" ディレクティブの追加・削除判断
- データ取得パターンの実装
- コンポーネント間のデータフロー設計
Compatibility
React 19+ / RSC対応フレームワーク
Rule Categories
| Category | Prefix |
|---|
| Server/Client 境界 | boundary- |
| データ取得 | fetching- |
| Composition パターン | composition- |
| Suspense/ErrorBoundary | suspense- |
| Hooks 設計 | hooks- |
| パフォーマンス | perf- |
| コーディング規約 | style- |
Quick Reference
Server/Client 境界
データ取得
Composition パターン
Suspense / ErrorBoundary
Hooks 設計
パフォーマンス
コーディング規約
How to Use
個別ルールの詳細は rules/ ディレクトリ内のファイルを参照。上記 Quick Reference のリンクから各ルールにアクセスできる。
各ルールファイルには以下が含まれる:
- ルールの説明と根拠
- Bad: 間違ったコード例
- Good: 正しいコード例
- 判断に迷うケースのガイダンス