en un clic
react-component-design
Design the structure of the react components
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Menu
Design the structure of the react components
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Basé sur la classification professionnelle SOC
Use when creating pages under src/app/(site)/(authorized)/admin/. Covers list/detail/edit/create page patterns with DataTable/DataView/DataForm, repositories under src/repositories/, request schemas under src/requests/admin/, and AdminPageHeader breadcrumbs.
Use when modifying Better Auth + Prisma authentication: src/libraries/auth.ts, src/libraries/auth-client.ts, src/proxy.ts, src/services/auth_service.ts, auth-related actions.ts, or prisma/schema.prisma auth models (User/Session/Account/Verification). Covers session helpers, URL/secret env resolution, DB TLS, and PUBLIC_PATHS.
Use when creating or modifying files under src/repositories/, src/models/, or src/requests/. Covers BaseRepository inheritance (Prisma/API/Local/Airtable/Dify), Zod schema placement, and separation between repository and schema files.
Use when changing this template's mail delivery backend, reviewing email env setup, switching between `ses` and `smtp`, or adding a new provider such as Resend, SendGrid, Postmark, or Mailgun. Covers EMAIL_PROVIDER routing, EMAIL_FROM priority, dynamic import for Node-only SDKs, and test coverage for both email.test.ts and Better Auth callback smoke.
Use when adding or changing translations in messages/ja.json or messages/en.json, using getTranslations/useTranslations, or updating next-intl configuration under src/i18n/. Covers message key hierarchy, Server/Client Component APIs, dynamic and rich-text patterns, and JSON duplicate-key pitfalls.
Use when adding or modifying pages under src/app, or components under src/components (atoms/molecules/organisms) in this Next.js App Router project. Covers Server/Client Component boundary, Atomic Design placement, Server Actions in actions.ts, URL-based state management, sidebar active-state, and shadcn-only atoms rule.
| name | react-component-design |
| description | Design the structure of the react components |
このドキュメントは、本プロジェクトにおける React を使用したページおよびコンポーネントの作成方法に関するルールとベストプラクティスをまとめたものです。
any 型の使用は原則禁止です。frontend/src/routes ディレクトリ以下に配置します。frontend/src/components)全てのUIコンポーネントは frontend/src/components ディレクトリ以下に配置します。
コンポーネントにビジネスロジックを配置することは禁止である。全て、ページから注入して処理をする。
コンポーネントはAtomic Designの考え方に基づき、atoms, molecules, organisms のいずれかのサブディレクトリに分類します。
Button, Input, Icon)。Shadcn/UIから提供されるコンポーネントが主にここに該当します。原則として、このディレクトリにカスタムコンポーネントを新規作成することは避け、Shadcn/UIのものをそのまま利用するか、ラッパーを作成する場合は molecules 以上に配置します。SearchInput (Input atom + Button atom), UserAvatarMenu)。AppHeader, RecordList, ProductCardGrid)。各コンポーネントのファイル構成: molecules および organisms に属するコンポーネントは、以下の構造を取ります。
PascalCase としたディレクトリを作成します。index.tsx を作成し、コンポーネントのメインロジックを記述します。frontend/src/components/
├── molecules/
│ └── PetFilter/
│ └── index.tsx // PetFilterコンポーネント本体
└── organisms/
└── AppHeader/
└── index.tsx // AppHeaderコンポーネント本体
atoms のコンポーネント: Shadcn/UIから提供されるものは、通常 frontend/src/components/ui に配置されることが多いですが、本プロジェクトでは既存の frontend/src/components/atoms をShadcn/UIコンポーネントの格納場所として扱います。これらは直接編集せず、拡張する場合は molecules 以上でラップします。
frontend/src/types/index.ts に集約します。index.tsx) 内に記述します。tailwind.config.js で定義されているものを利用します。CamelCaseディレクトリ/index.tsx の形式で作成することにより、将来的にStorybookの*.stories.tsx ファイルを各コンポーネントディレクトリ内に配置しやすくなります。
src/components/molecules/PetFilter/PetFilter.stories.tsxこのガイドラインに従って、一貫性があり、メンテナンスしやすく、パフォーマンスの高いアプリケーションを構築してください。