Skip to content

Commit fb9619c

Browse files
yn1323claude
andauthored
Feat/0323 (#274)
* chore: 不要スキルの削除(create-pr, doc-update, resume-plan, save-plan) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: commitスキルの追加(自動コミット分割) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: CLAUDE.mdの説明充実・自動生成ファイルの注意事項追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: 充足度の数値表示がグリッドラインとずれる問題を修正 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: discussスキルの追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: ShiftFormデザインガイド・デザインファイルの追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: ShiftForm DailyViewの消しゴムモード削除・空状態ガイド追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: Claude Code権限設定の更新・discussスキルの改善 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: ShiftForm情報設計プランの追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: undo/redo・toolMode・scrollDragの廃止とPositionToolbar簡素化 情報設計改善プランStep1: selectモード・undo/redo・スクロールドラッグを削除し、 ポジションボタンのみのシンプルなツールバーに変更。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: ポジション間ギャップの休憩ストライプ表示 情報設計改善プランStep2: computeVisualBreaksでポジション間の空き時間を検出し、 ストライプパターンで休憩を可視化。PC・SP両対応。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: ピーク帯設定・充足度アラート・DateTabsバッジの追加 情報設計改善プランStep3-5: ピーク帯定義+最低人員の簡易入力モード、 DailyView/OverviewViewの充足度アラート表示、DateTabsの曜日色分け・⚠️/✅バッジ。 dateStatuses計算をuseDateStatuses hookに共通化。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: StaffEditModalの参照専用モード追加 情報設計改善プランStep7: viewOnly propでShiftFormからの スタッフ名クリック時は参照のみ表示に変更。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: 実装ルールの追加 lint・type-check・test実行後の/simplify実行を必須化。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: ShiftFormのドラッグ操作時にカーソルがcrosshairに変わる挙動を削除 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: ポジションバーのホバーカーソルとPopoverの時間順ソートを追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: ドラッグ操作後の同一ポジション隣接セグメントが統合されない問題を修正 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: SummaryFooterRowのラベルを「出勤数」から「人数」に変更 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: ポジション色バーのホバー時にcursor: pointerが表示されない問題を修正 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: ShiftForm日別ビューのUI改善(二重テキスト削除・ホバー強化・時刻ラベル視認性・タブ強調) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: ShiftFormのUI全体改善(充足度バー未着手グレー化・一覧ビュートーンダウン・ガイドバーアニメーション・ツールバー背景色) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: ShiftFormのビュー切替とポジション選択を統合ツールバーに集約 ビュー切替(日別/一覧)とポジションボタンを1本のツールバーにまとめ、 視覚的な散漫さを解消。日付タブのbold削除・ツールバー高さ固定で レイアウトシフトも防止。一覧ビューのborderRadiusもlgに統一。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: CLAUDE.mdのデザインセクションをdoc/design/構成に更新 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * f * f * chore: v2のConvexバックエンドを削除・スキーマ簡素化 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: v3プロダクト定義書・Convexアーキテクチャ規約の追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: v2の不要コードを一括削除 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: v3に向けたコード簡素化(ShiftForm・テンプレート・ルーティング) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: ダッシュボードページの追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: ShiftFormのドラッグ操作・SP版シフト編集を簡素化 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: v3再構築に向けた旧ドキュメントの一括削除 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs: ARCHITECTURE.md・INDEX.mdを現在のコードベース実態に合わせて更新 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs: プロダクト定義書の追加 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs: プロダクト定義書のファイル名に日付プレフィックスを付与 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs: 情報設計書の追加 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * doc * chore: Chakra UIテーマ設定ファイルの追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: デザイン関連ファイルをdesign/ディレクトリに整理 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: system.penにリユーザブルコンポーネントとインデックスを追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: CLAUDE.mdにペルソナとレイアウトルールを追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: デザインファイルのリネームとダッシュボード画面の追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: デザインインデックスのSP画面ID追加とContentWrapperコンポーネント定義 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: ContentWrapperテンプレートコンポーネントの作成 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: ダッシュボード画面の実装(モックデータ版) 募集セクション・スタッフセクション・作成/追加モーダルを含む レスポンシブ対応(PC: Dialog / SP: BottomSheet) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: BottomSheetにアクションボタン(送信・キャンセル)を追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: ダッシュボード画面のUI改善 募集カードにシフトボード遷移ボタン・日付フォーマット・ステータス表示を改善。 募集フォームのフィールドラベル整理、スタッフ一覧の簡素化、statusをcompletedに変更。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: CLAUDE.mdの実装ルール説明を更新 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: BottomSheetデザインにアクションボタン(送信・キャンセル)を追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: ダッシュボード画面のSPデザインを追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: concurrentlyを導入しdev:allスクリプトを追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: セキュリティ・認証設計書を追加し関連ドキュメントを更新 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: シフトボードのUX設計書とデザインファイルを追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: シフトボードのPC/SPデザインデータを追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: シフトボード画面の実装(モックデータ版) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: 日別ビューの1列目(スタッフ名・ヘッダー)が改行される問題を修正 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: シフトボードの送付済み表示によるレイアウトシフトを修正しToast位置を中央上部に変更 - 送付済み時刻の表示をvisibilityで制御しヘッダー高さを固定 - Toastのplacementをtop-startからtopに変更 - 不要な"use client"ディレクティブを削除 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: CLAUDE.mdにフロントエンド実装ルールを追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: CLAUDE.mdのフロントエンド実装ルールを整理 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: statusLineにコンテキスト使用率と5hセッション使用率を表示 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: スタッフ複数人同時登録フォームの実装 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: RecruitmentCardのSP表示でボタン・テキストが折り返される問題を修正 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: スタッフ登録Route A/B方針をプロダクト定義・情報設計書に追記 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: ダッシュボードのデザインデータ更新(スタッフ複数登録モーダル) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: statusLineにモデル名と5hセッションリセット時刻を追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: 店舗情報と初回セットアップ設計プランを追加 https://claude.ai/code/session_01KiVSbXz2P7GKYqh7z3sYEF * feat: Convexスキーマ定義(ダッシュボード・シフトボード・店舗セットアップ) shops, users, staffs, recruitments, shiftRequests, shiftAssignments, positions, magicLinks, sessions, invites の10テーブルを定義。 フロントエンドの型と整合し、セキュリティ・認証設計書に基づく マジックリンク/セッション管理テーブルも含む。 recruitments.statusを "completed" → "confirmed" に変更(情報設計書の 「確定」操作と一致させるため)。 https://claude.ai/code/session_01LGzthJxycdh7x2D6CCUGQp * convex/CLAUDE.md にセキュリティガイドを追記 Convex がパブリック API である前提での認証ラッパー、IDOR対策、 列挙攻撃対策、データ露出防止、Magic Link セキュリティなどの 実装ルールと チェックリストを追加。 https://claude.ai/code/session_01D84UFMcUxNCsHE2xUaQHkg * feat: 初回セットアップ ステッパーモーダルのデザイン追加(PC/SP) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: designIndex.mdに初回セットアップモーダルのフレームIDを追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: designIndex更新ルールの強調を追記 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: convex-testテスト環境のセットアップ Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: convex/CLAUDE.mdにテストセクションを追記 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: 初回セットアップモーダルの実装(react-hook-form + Zod) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: フォームのルール(react-hook-form + zodResolver)を追記 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: Dialog/BottomSheetにformIdプロップを追加 react-hook-formのバリデーション付きsubmitに対応するため、 formId指定時にsubmitボタンをtype="submit" form={formId}に切り替える Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: CreateRecruitmentFormにreact-hook-form + zodを導入 日付バリデーション付きのフォームロジックを実装(スキーマ・テスト・Stories含む) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: AddStaffFormをreact-hook-form + zodに移行 useStateからuseFieldArrayベースに書き換え、zodでemail検証を実装 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: DashboardContentのフォーム連携をformId方式に変更 Modal経由のsubmitをreact-hook-formのバリデーション経由に統一 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: フォームのSubmitボタンは常にEnabledにするルールを追記 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: AddStaffFormのバリデーション改善(email union型、refineで最低1名必須) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: 日付入力のプレースホルダー表示改善とエラー位置修正 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: DashboardContentからAddStaffFormの状態リフトアップを削除 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: ダッシュボードデザインからWelcomeTextを削除 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: AddStaffFormのバリデーションをZodネイティブに改善 - メール: z.union → optionalEmailヘルパー(superRefine)に変更 - 名前: メール入力時は名前必須のクロスフィールドバリデーション追加 - ルートエラーをフォーム上部に移動、モーダルにmaxH追加で視認性向上 - noValidateでブラウザネイティブバリデーション無効化 - InDialogストーリー追加(モーダル内の実使用状態を再現) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: 名前入力時にメールアドレスを必須にするバリデーション追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: AddStaffFormのエラー表示時のレイアウトシフトを防止 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: Zodバリデーションスキーマをconvex/に移動しフロント・バックエンド共有化 mutation引数のZodスキーマをconvex/{useCase}/schemas.tsに配置し、 src/側からはre-exportでインポートする構成に変更。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: CLAUDE.mdにZodスキーマ共有ルールを追加 convex/側のディレクトリ構成・ファイル配置ルール・スキーマ共有ルールを明文化。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: SetupModalの閉じるボタンが表示されない問題を修正 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: 募集がないときに「新しい募集を作成」ボタンでもSetupモーダルを開くように修正 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: Convex AI filesとスキルの追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: 実装プロンプトとCLAUDE.mdの更新 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: Convex認証ラッパーとダッシュボードAPI実装 - convex-helpersを導入し認証ラッパー(authenticated/manager × query/mutation)を作成 - getDashboardData: 店舗・募集・スタッフを一括取得するquery - getCurrentUser: AuthGuard用のユーザー情報取得query - createShop: 店舗作成mutation(初回セットアップ用) - createRecruitment: 募集作成mutation - addStaffs: スタッフ一括追加mutation - 全関数のユニットテスト(認証・IDOR・正常系・エッジケース) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: ダッシュボードUIをConvexバックエンドに接続 - モックデータをConvex useQueryに差し替え - DashboardContentにuseMutationで3つのmutationを接続 - AuthGuardでConvexからユーザー情報を取得しuserAtomに反映 - 型をConvex準拠に変更(_id, periodStart/End, role削除) - mocks.tsをstoryMocks.tsにリネームしStorybook用に維持 - エラーハンドリングにConvexErrorメッセージ表示を追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: テストヘルパーのリネーム残ファイルを削除 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: SetupModalリファクタの実装計画とCLAUDE.md更新 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: Convex全テーブルクリア用mutationとdifitスクリプト追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: 募集作成フォームの締切日を開始日の前日までに制約 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: SetupModalを店舗情報+管理者登録の強制2ステップに改善 - staffsテーブルにuserId(管理者紐付け)を追加 - setupShopAndOwner mutationで店舗・ユーザー・スタッフを1トランザクション作成 - SetupModalのStep2を募集作成→管理者プロフィール登録に差し替え - shop未登録時に閉じれない強制モーダルとして自動表示 - RecruitmentSectionからonSetupClickと「はじめる」ボタンを削除 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: 締切日max計算のマジックナンバーをDate APIに置換 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: Biomeスキーマバージョンを2.3.10に更新 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: SetupModal Step2のデザインを管理者情報登録フォームに変更 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: 認証済みレイアウトの背景色削除とページ遷移アニメーション追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: SideMenu/BottomMenuをHeaderに置換 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: ステータスラインに7日間レート制限表示を追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: ステータスラインの7日間リセット日時に曜日表示を追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: シフトボードのレイアウトをフルワイド化し固定要素を除去 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: DateCardのスタッフ表示上限を撤廃し全員表示に変更 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: DateCardのstaffCount変数を除去しworkingStaffs.lengthに統一 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * design: system.lib.penにHeader追加しshiftboard全画面にヘッダーを統一 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: ShiftBoardヘッダーの型共通化とTitleTemplate適用 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: シフトボードヘッダー再構成のプランドキュメントを追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * design: シフトボードヘッダーをツールバー構成に再構成 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: viewModeのcontrolled props対応(Write-Through Atomパターン) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: ShiftBoardヘッダーをツールバー構成にコード実装 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: ShiftEditSheet・DateCardのcolorPaletteをtealに統一 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * test: ShiftFormサブコンポーネントのStorybook追加(ビュー単位+SPモーダル) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: ShiftEditSheetに確定ボタン追加とシフト未設定時の時刻セレクト空欄化 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix * refactor: シフト表示からポジション名・色を除去し時間のみの表示に簡素化 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: Toast表示時間2秒・閉じるボタン常時表示・エラー時は自動非表示無効 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: 休憩ポジションのマジックストリングをBREAK_POSITION定数に統一 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: BottomSheetヘッダーの戻るボタン有無で条件分岐を明確化 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: SPDailyViewのopenedFromAddSheetをrefからstateに変更 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: OverviewViewのShiftEditSheetにもStaffAddSheetへの戻るボタンを追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: ShiftEditSheetの不要import・コメント削除とフォーマット修正 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: PC版ShiftPopoverのポジション表示簡素化とShiftDetailPopover削除 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: ShiftEditSheetでスタッフ切り替え時にフォーム値がリセットされない問題を修正 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: ShiftBoardのConvex統合(query/mutation作成とフロント接続) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: ShiftBoardのラベルを「確定」から「送信」に変更 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: ShiftBoard mutationにビジネスロジックバリデーションを追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: showErrorToastをtoaster.tsxに共通化 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: dateUtils統一によるTZずれ修正とshopId誤り修正 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: CLAUDE.mdに日付操作ルールを追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * design: シフトボードのラベルを「確定」から「送信」に変更 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: RootContentWrapper追加とdashboardのレイアウト統一 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * design: スタッフ向けシフト閲覧・リンク再発行画面のモック作成 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: メール通知・マジックリンク認証のバックエンド実装 シフト確定時にResend経由でスタッフへ確定メールを送信し、 ワンタイムマジックリンクでセッションを発行する仕組みを追加。 staffAuth(トークン検証・再発行)、email(送信・テンプレート)モジュールを新設。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: スタッフ向けシフト閲覧・再発行ページの実装 マジックリンクからアクセスするシフト閲覧ページと、 リンク期限切れ時の再発行ページをフロントエンドに追加。 StaffHeader、PeriodBar、FooterInfo等のコンポーネントとStorybookストーリーを含む。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: メール通知・マジックリンク設計書の追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: スタッフ向けシフト閲覧画面にShiftForm(読み取り専用)を統合 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: FullPageSpinnerとStaffLayoutを共通コンポーネントとして抽出 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: lint * fix: del footerInfo * fix: shiftBoardテストのlint警告とUnhandled Rejectionを修正 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: readOnly時にシフト希望情報を非表示にする Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: シフト確定メール再送時の件名・本文をシフト変更通知に変更 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: E2Eテスト規約と方針ドキュメントの追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: CLAUDE.mdのドキュメントセクションにE2E規約の参照を追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: 初回シフト確定シナリオのE2Eテスト実装 POM(DashboardPage, ShiftBoardPage)、認証セットアップ、日付ヘルパー、 Convexシード関数を追加し、初回セットアップからシフト確定・通知までの 9ステップE2Eシナリオを実装。playwright.config.tsのプロジェクト定義を有効化。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: CLAUDE.mdにlint warning修正ルールを追加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: zip * fix * fix: pipeline * fix:disconnect storybook and convex * fix: storybook * fix * fix: StorybookのClerk依存をモック化してChromatic対応 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Revert "fix" This reverts commit 993f0a1. * fix * fix: Playwright CI actionの高速化(不要なセットアップ削除・キャッシュ改善) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: Playwright CIのレポートパスを環境変数化・インデント修正 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: CI設定・E2Eファイルのフォーマット修正 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * f * chore: Playwright CIから不要なフォント・環境変数ステップを削除 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix * f * fix * f * fix * fix * f * fix * feat: CI/CDパイプラインの環境分離とConvexデプロイ追加 本番(main)とdev(develop/preview)でCloudFlare・Convexプロジェクトを分離し、 develop/mainプッシュ時にConvex自動デプロイを追加。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * skill --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 00d3d4d commit fb9619c

File tree

574 files changed

+40943
-36339
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

574 files changed

+40943
-36339
lines changed
Lines changed: 284 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,284 @@
1+
---
2+
name: convex-create-component
3+
description: Designs and builds Convex components with isolated tables, clear boundaries, and app-facing wrappers. Use this skill when creating a new Convex component, extracting reusable backend logic into a component, building a third-party integration that owns its own tables, packaging Convex functionality for reuse, or when the user mentions defineComponent, app.use, ComponentApi, ctx.runQuery/runMutation across component boundaries, or wants to separate concerns into isolated Convex modules.
4+
---
5+
6+
# Convex Create Component
7+
8+
Create reusable Convex components with clear boundaries and a small app-facing API.
9+
10+
## When to Use
11+
12+
- Creating a new Convex component in an existing app
13+
- Extracting reusable backend logic into a component
14+
- Building a third-party integration that should own its own tables and workflows
15+
- Packaging Convex functionality for reuse across multiple apps
16+
17+
## When Not to Use
18+
19+
- One-off business logic that belongs in the main app
20+
- Thin utilities that do not need Convex tables or functions
21+
- App-level orchestration that should stay in `convex/`
22+
- Cases where a normal TypeScript library is enough
23+
24+
## Workflow
25+
26+
1. Ask the user what they are building and what the end goal is. If the repo already makes the answer obvious, say so and confirm before proceeding.
27+
2. Choose the shape using the decision tree below and read the matching reference file.
28+
3. Decide whether a component is justified. Prefer normal app code or a regular library if the feature does not need isolated tables, backend functions, or reusable persistent state.
29+
4. Make a short plan for:
30+
- what tables the component owns
31+
- what public functions it exposes
32+
- what data must be passed in from the app (auth, env vars, parent IDs)
33+
- what stays in the app as wrappers or HTTP mounts
34+
5. Create the component structure with `convex.config.ts`, `schema.ts`, and function files.
35+
6. Implement functions using the component's own `./_generated/server` imports, not the app's generated files.
36+
7. Wire the component into the app with `app.use(...)`. If the app does not already have `convex/convex.config.ts`, create it.
37+
8. Call the component from the app through `components.<name>` using `ctx.runQuery`, `ctx.runMutation`, or `ctx.runAction`.
38+
9. If React clients, HTTP callers, or public APIs need access, create wrapper functions in the app instead of exposing component functions directly.
39+
10. Run `npx convex dev` and fix codegen, type, or boundary issues before finishing.
40+
41+
## Choose the Shape
42+
43+
Ask the user, then pick one path:
44+
45+
| Goal | Shape | Reference |
46+
|------|-------|-----------|
47+
| Component for this app only | Local | `references/local-components.md` |
48+
| Publish or share across apps | Packaged | `references/packaged-components.md` |
49+
| User explicitly needs local + shared library code | Hybrid | `references/hybrid-components.md` |
50+
| Not sure | Default to local | `references/local-components.md` |
51+
52+
Read exactly one reference file before proceeding.
53+
54+
## Default Approach
55+
56+
Unless the user explicitly wants an npm package, default to a local component:
57+
58+
- Put it under `convex/components/<componentName>/`
59+
- Define it with `defineComponent(...)` in its own `convex.config.ts`
60+
- Install it from the app's `convex/convex.config.ts` with `app.use(...)`
61+
- Let `npx convex dev` generate the component's own `_generated/` files
62+
63+
## Component Skeleton
64+
65+
A minimal local component with a table and two functions, plus the app wiring.
66+
67+
```ts
68+
// convex/components/notifications/convex.config.ts
69+
import { defineComponent } from "convex/server";
70+
71+
export default defineComponent("notifications");
72+
```
73+
74+
```ts
75+
// convex/components/notifications/schema.ts
76+
import { defineSchema, defineTable } from "convex/server";
77+
import { v } from "convex/values";
78+
79+
export default defineSchema({
80+
notifications: defineTable({
81+
userId: v.string(),
82+
message: v.string(),
83+
read: v.boolean(),
84+
}).index("by_user", ["userId"]),
85+
});
86+
```
87+
88+
```ts
89+
// convex/components/notifications/lib.ts
90+
import { v } from "convex/values";
91+
import { mutation, query } from "./_generated/server.js";
92+
93+
export const send = mutation({
94+
args: { userId: v.string(), message: v.string() },
95+
returns: v.id("notifications"),
96+
handler: async (ctx, args) => {
97+
return await ctx.db.insert("notifications", {
98+
userId: args.userId,
99+
message: args.message,
100+
read: false,
101+
});
102+
},
103+
});
104+
105+
export const listUnread = query({
106+
args: { userId: v.string() },
107+
returns: v.array(
108+
v.object({
109+
_id: v.id("notifications"),
110+
_creationTime: v.number(),
111+
userId: v.string(),
112+
message: v.string(),
113+
read: v.boolean(),
114+
})
115+
),
116+
handler: async (ctx, args) => {
117+
return await ctx.db
118+
.query("notifications")
119+
.withIndex("by_user", (q) => q.eq("userId", args.userId))
120+
.filter((q) => q.eq(q.field("read"), false))
121+
.collect();
122+
},
123+
});
124+
```
125+
126+
```ts
127+
// convex/convex.config.ts
128+
import { defineApp } from "convex/server";
129+
import notifications from "./components/notifications/convex.config.js";
130+
131+
const app = defineApp();
132+
app.use(notifications);
133+
134+
export default app;
135+
```
136+
137+
```ts
138+
// convex/notifications.ts (app-side wrapper)
139+
import { v } from "convex/values";
140+
import { mutation, query } from "./_generated/server";
141+
import { components } from "./_generated/api";
142+
import { getAuthUserId } from "@convex-dev/auth/server";
143+
144+
export const sendNotification = mutation({
145+
args: { message: v.string() },
146+
returns: v.null(),
147+
handler: async (ctx, args) => {
148+
const userId = await getAuthUserId(ctx);
149+
if (!userId) throw new Error("Not authenticated");
150+
151+
await ctx.runMutation(components.notifications.lib.send, {
152+
userId,
153+
message: args.message,
154+
});
155+
return null;
156+
},
157+
});
158+
159+
export const myUnread = query({
160+
args: {},
161+
handler: async (ctx) => {
162+
const userId = await getAuthUserId(ctx);
163+
if (!userId) throw new Error("Not authenticated");
164+
165+
return await ctx.runQuery(components.notifications.lib.listUnread, {
166+
userId,
167+
});
168+
},
169+
});
170+
```
171+
172+
Note the reference path shape: a function in `convex/components/notifications/lib.ts` is called as `components.notifications.lib.send` from the app.
173+
174+
## Critical Rules
175+
176+
- Keep authentication in the app, because `ctx.auth` is not available inside components.
177+
- Keep environment access in the app, because component functions cannot read `process.env`.
178+
- Pass parent app IDs across the boundary as strings, because `Id` types become plain strings in the app-facing `ComponentApi`.
179+
- Do not use `v.id("parentTable")` for app-owned tables inside component args or schema, because the component has no access to the app's table namespace.
180+
- Import `query`, `mutation`, and `action` from the component's own `./_generated/server`, not the app's generated files.
181+
- Do not expose component functions directly to clients. Create app wrappers when client access is needed, because components are internal and need auth/env wiring the app provides.
182+
- If the component defines HTTP handlers, mount the routes in the app's `convex/http.ts`, because components cannot register their own HTTP routes.
183+
- If the component needs pagination, use `paginator` from `convex-helpers` instead of built-in `.paginate()`, because `.paginate()` does not work across the component boundary.
184+
- Add `args` and `returns` validators to all public component functions, because the component boundary requires explicit type contracts.
185+
186+
## Patterns
187+
188+
### Authentication and environment access
189+
190+
```ts
191+
// Bad: component code cannot rely on app auth or env
192+
const identity = await ctx.auth.getUserIdentity();
193+
const apiKey = process.env.OPENAI_API_KEY;
194+
```
195+
196+
```ts
197+
// Good: the app resolves auth and env, then passes explicit values
198+
const userId = await getAuthUserId(ctx);
199+
if (!userId) throw new Error("Not authenticated");
200+
201+
await ctx.runAction(components.translator.translate, {
202+
userId,
203+
apiKey: process.env.OPENAI_API_KEY,
204+
text: args.text,
205+
});
206+
```
207+
208+
### Client-facing API
209+
210+
```ts
211+
// Bad: assuming a component function is directly callable by clients
212+
export const send = components.notifications.send;
213+
```
214+
215+
```ts
216+
// Good: re-export through an app mutation or query
217+
export const sendNotification = mutation({
218+
args: { message: v.string() },
219+
returns: v.null(),
220+
handler: async (ctx, args) => {
221+
const userId = await getAuthUserId(ctx);
222+
if (!userId) throw new Error("Not authenticated");
223+
224+
await ctx.runMutation(components.notifications.lib.send, {
225+
userId,
226+
message: args.message,
227+
});
228+
return null;
229+
},
230+
});
231+
```
232+
233+
### IDs across the boundary
234+
235+
```ts
236+
// Bad: parent app table IDs are not valid component validators
237+
args: { userId: v.id("users") }
238+
```
239+
240+
```ts
241+
// Good: treat parent-owned IDs as strings at the boundary
242+
args: { userId: v.string() }
243+
```
244+
245+
### Advanced Patterns
246+
247+
For additional patterns including function handles for callbacks, deriving validators from schema, static configuration with a globals table, and class-based client wrappers, see `references/advanced-patterns.md`.
248+
249+
## Validation
250+
251+
Try validation in this order:
252+
253+
1. `npx convex codegen --component-dir convex/components/<name>`
254+
2. `npx convex codegen`
255+
3. `npx convex dev`
256+
257+
Important:
258+
259+
- Fresh repos may fail these commands until `CONVEX_DEPLOYMENT` is configured.
260+
- Until codegen runs, component-local `./_generated/*` imports and app-side `components.<name>...` references will not typecheck.
261+
- If validation blocks on Convex login or deployment setup, stop and ask the user for that exact step instead of guessing.
262+
263+
## Reference Files
264+
265+
Read exactly one of these after the user confirms the goal:
266+
267+
- `references/local-components.md`
268+
- `references/packaged-components.md`
269+
- `references/hybrid-components.md`
270+
271+
Official docs: [Authoring Components](https://docs.convex.dev/components/authoring)
272+
273+
## Checklist
274+
275+
- [ ] Asked the user what they want to build and confirmed the shape
276+
- [ ] Read the matching reference file
277+
- [ ] Confirmed a component is the right abstraction
278+
- [ ] Planned tables, public API, boundaries, and app wrappers
279+
- [ ] Component lives under `convex/components/<name>/` (or package layout if publishing)
280+
- [ ] Component imports from its own `./_generated/server`
281+
- [ ] Auth, env access, and HTTP routes stay in the app
282+
- [ ] Parent app IDs cross the boundary as `v.string()`
283+
- [ ] Public functions have `args` and `returns` validators
284+
- [ ] Ran `npx convex dev` and fixed codegen or type issues
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
interface:
2+
display_name: "Convex Create Component"
3+
short_description: "Design and build reusable Convex components with clear boundaries."
4+
icon_small: "./assets/icon.svg"
5+
icon_large: "./assets/icon.svg"
6+
brand_color: "#14B8A6"
7+
default_prompt: "Help me create a Convex component for this feature. First check that a component is actually justified, then design the tables, API surface, and app-facing wrappers before implementing it."
8+
9+
policy:
10+
allow_implicit_invocation: true
Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)