Quests: a quest book with chests, fed by habits, focus and the game #19

Merged
alex merged 1 commit from feat/quests into docs/quests-design 2026-10-31 22:38:14 +01:00
Owner

Stacked on #18. First slice of the quest book designed there.

Backend

  • New Quests context (5 projects): QuestCatalogue.v1 with First flight (8 quests, the game loop) and Good habits (10 quests, a first goal to 100 perfect days), loot tables for common/rare/epic chests, pity limit 5.
  • QuestBook aggregate: lifetime record, claims, chests, pity. Quests are thresholds over the record, so new quests count past progress. Draws seeded by keeper + chest. Table quests.books (migration 202611021000-create-quests).
  • ACLs from Habits (goals met, best streak, perfect days), Focus (sessions, minutes) and Apiary.
  • Publishes quests.reward_claimed.v1 for every claimed quest and opened chest.
  • Apiary publishes apiary.progressed.v1 and delivers gifts: nectar/pollen to the keeper, supplies and pure-bred bees (origin gift, may exceed the inventory size) to the homestead.

Web

  • Quests hotbar button with a count of rewards waiting; drawer with chapter tabs, a map (frames by weight, lines by unlocks, glowing quests to claim), tasks, rewards, claim, chests with a reveal; a toast when a quest completes.
  • New pixel art: quest scroll, chests in three tiers, flame, star, check.

Checks: lint, typecheck and tests pass for 18 projects; quests and apiary Postgres integration tests pass. Tried in the browser on the Brezo demo account: placing a hive and planting a flower completed quests with toasts, claims delivered nectar and seeds, and a common chest gave pollen. Habit and focus facts for that test were set in the dev database.

🤖 Generated with Claude Code

Stacked on #18. First slice of the quest book designed there. **Backend** - New **Quests** context (5 projects): `QuestCatalogue.v1` with *First flight* (8 quests, the game loop) and *Good habits* (10 quests, a first goal to 100 perfect days), loot tables for common/rare/epic chests, pity limit 5. - `QuestBook` aggregate: lifetime record, claims, chests, pity. Quests are thresholds over the record, so new quests count past progress. Draws seeded by keeper + chest. Table `quests.books` (migration `202611021000-create-quests`). - ACLs from Habits (goals met, best streak, perfect days), Focus (sessions, minutes) and Apiary. - Publishes `quests.reward_claimed.v1` for every claimed quest and opened chest. - **Apiary** publishes `apiary.progressed.v1` and delivers gifts: nectar/pollen to the keeper, supplies and pure-bred bees (origin *gift*, may exceed the inventory size) to the homestead. **Web** - Quests hotbar button with a count of rewards waiting; drawer with chapter tabs, a map (frames by weight, lines by unlocks, glowing quests to claim), tasks, rewards, claim, chests with a reveal; a toast when a quest completes. - New pixel art: quest scroll, chests in three tiers, flame, star, check. **Checks**: lint, typecheck and tests pass for 18 projects; quests and apiary Postgres integration tests pass. Tried in the browser on the Brezo demo account: placing a hive and planting a flower completed quests with toasts, claims delivered nectar and seeds, and a common chest gave pollen. Habit and focus facts for that test were set in the dev database. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A new Quests context keeps a lifetime record from Habits' goals, streaks
and perfect days, Focus's sessions and the game's facts, and checks a
versioned catalogue of quests against it: First flight for the game's
loop and Good habits from a first goal to a hundred perfect days.
Quests are claimed by hand; chests draw from loot tables seeded by
keeper and chest, with a rare draw guaranteed after five without.

Apiary publishes ApiaryProgressedV1 and delivers RewardClaimedV1 into
the stores and the homestead, including gifted bees. The game screen
gets a Quests menu with a map of each chapter, and a toast when a quest
completes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alex merged commit 96bea99645 into docs/quests-design 2026-10-31 22:38:14 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Habitea/App!19
No description provided.