docs: ワイヤーフレームを作成し、ドキュメント群を整理する - #56
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 16 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughDocumentation, architecture records, requirements, roadmap, contribution guidance, schema comments, and bottle region validation were updated to reflect revised project policies and scope. ChangesDocumentation and validation alignment
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
🧹 Nitpick comments (1)
src/lib/schemas/bottle.test.ts (1)
30-33: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winCover the removed-region regression cases.
The test still checks only
"月", so it would pass even if 台湾、インド、 or オーストラリア were accidentally re-added toREGIONS. Parameterize this case with the removed values to lock in the narrowed contract.Based on the PR objective that the region allow-list is intentionally restricted to five values.
Proposed test update
- it("固定リストにない産地は通らない", () => { - const result = bottleSchema.safeParse({ name: "山崎", region: "月" }); + it.each(["月", "台湾", "インド", "オーストラリア"])( + "固定リストにない産地 %j は通らない", + (region) => { + const result = bottleSchema.safeParse({ name: "山崎", region }); + expect(result.success).toBe(false); + }, + ); - expect(result.success).toBe(false); - });🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/lib/schemas/bottle.test.ts` around lines 30 - 33, Update the “固定リストにない産地は通らない” test to parameterize the removed region values 台湾、インド、オーストラリア, asserting bottleSchema.safeParse returns success: false for each. Keep the existing invalid-value coverage as appropriate while ensuring the test locks the five-value REGIONS allow-list.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/requirements.md`:
- Around line 9-13: docs/requirements.md
の購入額に関する記述を、MVPスコープの正本として一貫する方針に統一してください。冒頭の「どう解くか」、MVP項目(54–55行付近)、保留表の購入額記述を確認し、購入額をMVPに含めるか延期するか一方に揃えて、実装範囲と完了条件が分岐しない状態にしてください。
In `@docs/roadmap.md`:
- Line 18: Sprint
0の成果物記載から廃止済みの「ユーザーストーリー」を削除し、ADR-0012で正本とされる現在の要件・スコープ整理(docs/requirements.md)を示す表現へ置き換えてください。
- Around line 10-12: docs/roadmap.md
のフェーズ期間概要と期間表の不一致を解消してください。各フェーズ約1週間という記述を「目安」と明記するか、表の6日・7日・11日およびフェーズ3の未定終了日に合わせて概要を更新し、ロードマップ全体で同じ前提を示してください。
In `@prisma/schema.prisma`:
- Around line 35-56:
重複判定契約を3箇所で統一してください。prisma/schema.prismaのBottleモデルに衝突しない正規化済みidentityKeyと@@unique([userId,
identityKey])を追加し、対応するマイグレーションを作成してください。docs/requirements.mdの該当箇所にはユーザー単位の複合一意制約と正規化形式を明記し、docs/data-model.mdの該当箇所にも同じエンコード方式とユーザー単位の一意性を記載してください。対象サイトはprisma/schema.prisma
35-56、docs/requirements.md 56-56、docs/data-model.md 39-43です。
In `@README.md`:
- Around line 45-60:
READMEの技術選定表から作業用の「選んだ理由(選んだ理由が弱い)」という文言を削除または公開向けの説明に置き換え、Playwright/Vitest +
GitHub
Actions行の「?」も具体的な理由へ更新するか不要なら行を削除してください。公開文書として未完了プレースホルダーが残らない状態に整えてください。
In `@src/lib/schemas/bottle.ts`:
- Around line 3-10: Update the comment above REGIONS to describe the current
five-value allow-list only, removing the claim that major New World regions are
included or that additional entries are currently supported. Keep the REGIONS
values unchanged.
---
Nitpick comments:
In `@src/lib/schemas/bottle.test.ts`:
- Around line 30-33: Update the “固定リストにない産地は通らない” test to parameterize the
removed region values 台湾、インド、オーストラリア, asserting bottleSchema.safeParse returns
success: false for each. Keep the existing invalid-value coverage as appropriate
while ensuring the test locks the five-value REGIONS allow-list.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: f61b0267-5eba-40c5-a422-8db3a70b486f
⛔ Files ignored due to path filters (12)
docs/ui-mockups/01-ログイン.pngis excluded by!**/*.pngdocs/ui-mockups/02-コレクション一覧.pngis excluded by!**/*.pngdocs/ui-mockups/03-コレクション(空状態).pngis excluded by!**/*.pngdocs/ui-mockups/04-ボトル詳細.pngis excluded by!**/*.pngdocs/ui-mockups/05-ボトル登録.pngis excluded by!**/*.pngdocs/ui-mockups/06-ボトル編集.pngis excluded by!**/*.pngdocs/ui-mockups/07-ボトル削除.pngis excluded by!**/*.pngdocs/ui-mockups/08-傾向.pngis excluded by!**/*.pngdocs/ui-mockups/09-アカウント.pngis excluded by!**/*.pngdocs/ui-mockups/assets/bottle-amber.svgis excluded by!**/*.svgdocs/ui-mockups/assets/ph-card.svgis excluded by!**/*.svgdocs/ui-mockups/assets/ph-empty.svgis excluded by!**/*.svg
📒 Files selected for processing (12)
.github/pull_request_template.mdCLAUDE.mdCONTRIBUTING.mdREADME.mddocs/adr.mddocs/data-model.mddocs/requirements.mddocs/roadmap.mddocs/user-stories.mdprisma/schema.prismasrc/lib/schemas/bottle.test.tssrc/lib/schemas/bottle.ts
💤 Files with no reviewable changes (1)
- docs/user-stories.md
| /// 所有しているウイスキー 1 種類。行の粒度の定義は docs/data-model.md を参照。 | ||
| model Bottle { | ||
| id String @id @default(cuid()) | ||
| /// 所有者。書き込み時はセッションから設定し、リクエストボディの値は使わない。 | ||
| userId String | ||
| /// User を削除すると、そのユーザーのボトルも削除される。 | ||
| user User @relation(fields: [userId], references: [id], onDelete: Cascade) | ||
| name String // 銘柄名(必須) | ||
| region String? // 国(固定リスト選択式。選択肢は zod 側で管理) | ||
| subRegion String? // 地域(アイラ等・任意) | ||
| age Int? // 年数(null = NAS または未入力) | ||
| caskType String? // 樽 | ||
| /// 銘柄名。唯一の必須項目。 | ||
| name String | ||
| /// 産地。固定リスト選択式(表記ゆれ防止)。選択肢は zod の REGIONS で管理し、追加にマイグレーションは不要。 | ||
| region String? | ||
| /// 地域(アイラ/スペイサイド等)。region が選ばれている前提の任意項目で、地域だけの入力はしない。 | ||
| subRegion String? | ||
| /// 年数。空欄は NAS(年数表記なし)として扱う。未入力と NAS は区別しない。 | ||
| age Int? | ||
| /// 樽(シェリー、バーボン樽 等)。 | ||
| caskType String? | ||
| /// 限定版フラグ。 | ||
| isLimited Boolean @default(false) | ||
| /// 同一物の所持本数(1 以上)。同じ物が増えたら行は増やさず、ここを足す。 | ||
| quantity Int @default(1) | ||
| /// メモ。この種類についての記録であって、1 本ごとの記録ではない。同一性の判定には含めない。 |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
重複判定のDB契約を3箇所で統一してください。
要件は正規化キーによる重複拒否を求めていますが、実スキーマに実体がなく、単純連結やキー単体の一意制約では衝突またはユーザー間の登録拒否が起こり得ます。
prisma/schema.prisma#L35-L56: 衝突しないidentityKeyと@@unique([userId, identityKey])、マイグレーションを追加する。docs/requirements.md#L56-L56: ユーザー単位の複合制約と正規化形式を要件として明記する。docs/data-model.md#L39-L43: 同じエンコード方式とユーザー単位の一意性を文書化する。
As per coding guidelines, schema.prisma が要件と噛み合わない場合は、要件を弱めず構造側の問題として提示してください。
📍 Affects 3 files
prisma/schema.prisma#L35-L56(this comment)docs/requirements.md#L56-L56docs/data-model.md#L39-L43
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@prisma/schema.prisma` around lines 35 - 56,
重複判定契約を3箇所で統一してください。prisma/schema.prismaのBottleモデルに衝突しない正規化済みidentityKeyと@@unique([userId,
identityKey])を追加し、対応するマイグレーションを作成してください。docs/requirements.mdの該当箇所にはユーザー単位の複合一意制約と正規化形式を明記し、docs/data-model.mdの該当箇所にも同じエンコード方式とユーザー単位の一意性を記載してください。対象サイトはprisma/schema.prisma
35-56、docs/requirements.md 56-56、docs/data-model.md 39-43です。
Source: Coding guidelines
There was a problem hiding this comment.
設計の穴として妥当な指摘です。ドキュメントを修正しました(c894dc8)。
2 点とも実装前に踏む地雷でした。
- ユーザー単位でない一意制約 … 字義どおり実装すると、誰かが登録済みのボトルを他の人が登録できなくなり、
requirements.md6 章「読み書きのすべてで自分のuserIdのデータだけ」と矛盾します - 区切り文字の欠落 … 銘柄名「山崎12」+年数なし と 銘柄名「山崎」+12 年 が同じ文字列になります
requirements.md と data-model.md の両方に、userId との複合一意制約と区切り文字を明記しました。
**ただし prisma/schema.prisma への identityKey 列とマイグレーションは、この PR では行いません。**重複ボトルの検知は roadmap.md フェーズ 3 の実装タスクで、本 PR はドキュメント整理(Issue #55)です。実装時に、修正後の仕様どおり @@unique([userId, identityKey]) で入れます。
There was a problem hiding this comment.
@hduehgw0、整理ありがとうございます。ドキュメント PR で DB スキーマとマイグレーションを先行実装しない方針は、Issue #55 のスコープと整合しています。
userId を含む複合一意制約と、曖昧さのない区切り形式を仕様へ明記したことで、フェーズ 3 実装時の契約は明確になりました。DB 制約の実装部分は未対応のままですが、意図的な後続タスクとして扱います。
必要であれば、identityKey、@@unique([userId, identityKey])、対応マイグレーションを受け入れ条件に含む GitHub Issue を後続タスクとして起票できます。
🐇📝
You are interacting with an AI system.
CodeRabbit レビューへの対応
最も価値があったのは重複判定の指摘で、
|
関連 issue
resolve #55
やったこと
概要
MVP のワイヤーフレームを追加し、それを正本にドキュメント群を整理した。あわせて「どのドキュメントが何の正本か」を定め、同じ情報を複数箇所で持たない状態にした。
変更点
docs/ui-mockups/に MVP の UI モック 9 枚と素材 SVG を追加(素材にはメタ情報をコメントで付与)docs/requirements.mdを 7 章構成に再編(目的・ターゲット・用語定義・前提と制約・スコープ・非機能要件・完了基準)schema.prismaの///に寄せ、docs/data-model.mdは判断のコンテクストに絞るdocs/roadmap.mdフェーズ 3 を依存関係の順に並べ替え(重複検知を UI 作業より前に)docs/user-stories.mdを削除し、仕様は機能軸へ、状態は GitHub Issues へ寄せたCLAUDE.md/CONTRIBUTING.md/README.md/ PR テンプレートを現状のコマンド・CI・用語に合わせた受け入れ条件(セルフチェック)
docs/配下にあり、MVP の完了条件として参照できるpnpm lint/format:check/typecheck/testが通る動作確認
pnpm lintが通るpnpm format:checkが通るpnpm typecheckが通るpnpm testが通るIssue 要件外の対応(あれば)
docs/user-stories.mdを削除した。 Issue 本文では「user-stories.mdの構成見直し → 別 Issue」としてスコープ外に置いていたが、整理を進める過程で、構成見直しではなく廃止が妥当だと判断したため本 PR に含めた。理由は 3 つ。
requirements.md「5. スコープ」へ移っており、ドキュメントの更新が止まっていた[x]による進捗管理がCONTRIBUTING.md「状態の源は GitHub。ローカルに状態ファイルは作らない」に反していた削除前に全参照を実測し、書き換えが必要な現在形のドキュメントは 2 ファイル 5 箇所だけであること、閉じた Issue・PR の
US-Nはいずれも文脈で自己説明されていることを確認している。判断は ADR-0012 に記録した。なお
README.mdの技術選定表の整理はスコープ外のままで、事実誤りの修正(Recharts の行削除・壊れた表ヘッダの修復)に留めている。備考
requirements.md、時期 =roadmap.md、構造 =schema.prismaの///、理由 =adr.md、毎セッションの要点 =CLAUDE.md、手順 =CONTRIBUTING.md05-ボトル登録.pngの写真枠は MVP では未実装(写真アップロードは「採用」)。モック 9 枚への完全一致は写真機能の実装後に満たされるSummary by CodeRabbit
変更点
ドキュメント
開発品質