おみくじ機能 Phase 1(バックエンド + 文言105個 + 簡易UI)#149
Merged
Merged
Conversation
8時間に1回引けるITエンジニアあるある系おみくじ。結果(レア度と文言)は 必ずサーバーが決定し、フロントの物理演出は結果に合わせる方針(公平性のため)。 本コミットは Phase 1(結果表示までの簡易UI)。物理演出は Phase 2 で追加する。 バックエンド(app/functions-go): - omikuji.go: omikujiGo(HTTP)。7段階レア度の重み付き抽選 → tier内の文言を抽選。 8時間クールダウン(last_omikuji)、引いた結果は omikuji_result に保存し クールダウン中も再表示。peek=true で抽選せず状態のみ取得。クールダウン秒数は 環境変数 OMIKUJI_COOLDOWN_SECONDS(本番28800/dev60)。認証は sanpaiGo と同型。 - omikuji_data.go: おみくじ105個(各レア度15個)。IT自虐ネタ。大凶は本気で痛い系。 - omikuji_test.go / omikuji_integration_test.go: 抽選分布・データ健全性(各tier15個以上・ ID一意・全tier網羅)・クールダウン・peek/draw/保存の統合(Firestoreエミュレータ)。 フロント(web): - pages/omikuji.vue: 状態取得(peek)→「引く」→結果表示。クールダウン中は残り時間+前回結果。 既存のmatter.js実験プレースホルダを置き換え。 - components/OmikujiResult.vue: レア度別配色の結果カード。 - components/CommonHeader.vue: ログイン時ナビに「おみくじ」を追加。 デプロイ: - dev/prod 両ワークフローに omikujiGo を追加(POSTのためHosting rewriteなし=直叩き)。 docs/backend.md: 設計と仕様を記載。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DwkB6Hj2JggoKcy7FoxNcU
Contributor
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
kojira
pushed a commit
that referenced
this pull request
Jul 10, 2026
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DwkB6Hj2JggoKcy7FoxNcU
kojira
pushed a commit
that referenced
this pull request
Jul 10, 2026
#148 参拝ローディングの文言と鳥居の位置依存を解消 #149 おみくじ Phase 1(omikujiGo バックエンド + 文言105個 + 結果UI) #150 演出 v1 + 結果カード刷新 + トップに「おみくじを引く」導線 #151 演出 v2(鈴の緒スイング・狐スプライト・操作制限) #152 装置 v3(回転バー必通過 + ドミノ階段リレー) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DwkB6Hj2JggoKcy7FoxNcU
15 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
8時間に1回引ける、ITエンジニアあるある系の「おみくじ」機能。段階リリースの Phase 1(バックエンド + 文言 + 結果表示までの簡易UI)。物理演出(Plinko/ピタゴラ誘導)は Phase 2 で追加予定。
設計上の要点:抽選はサーバーが決定
物理演出でボールが落ちた場所で結果を決めると、8時間制限もレア度もクライアント任せ=改ざん可能になる。そのため レア度(tier)と具体的な文言はすべて
omikujiGoが決定し、フロントの物理演出は「サーバーが決めた tier のビンへ着地させる」見た目担当に徹する設計。おみくじはフレーバー(占い)のみで、ポイント等のゲーム報酬は無し。変更内容
バックエンド(
app/functions-go)omikuji.go:omikujiGo(HTTP)。7段階レア度(超吉/大吉/中吉/小吉/末吉/凶/大凶)の重み付き抽選 → tier 内の文言を抽選。8時間クールダウン(last_omikuji)、引いた結果はomikuji_resultに保存しクールダウン中も再表示。peek=trueで抽選せず状態のみ取得。クールダウン秒数は環境変数OMIKUJI_COOLDOWN_SECONDS(本番28800/dev60)。認証はsanpaiGoと同型。omikuji_data.go: おみくじ105個(各レア度15個)。IT自虐ネタ。omikuji_test.go/omikuji_integration_test.go: 抽選分布・データ健全性(各tier15個以上・ID一意・全tier網羅)・クールダウン・peek/draw/保存の統合テスト(Firestoreエミュレータ)。フロント(
web)pages/omikuji.vue: 状態取得(peek)→「引く」→結果表示。クールダウン中は残り時間 + 前回結果。既存の matter.js 実験プレースホルダを置き換え。components/OmikujiResult.vue: レア度別配色の結果カード。components/CommonHeader.vue: ログイン時ナビに「おみくじ」を追加。デプロイ
omikujiGoを追加(POST のため Hosting rewrite なし=関数を直叩き)。docs/backend.md: 設計と仕様を記載。
検証
go build ./... && go vet ./...: passyarn generateがゲートになる。次
Phase 2 で matter.js(既に依存にある
matter-js)による Plinko/ピタゴラ誘導演出を追加する。🤖 Generated with Claude Code
Generated by Claude Code