docs/superpowers/specs/2026-10-16-learning-games-design.md
208 lines · 10607 bytes
17 symbols in this file
Learning games, Today routine, and profilesIntentGoalsNon-goalsAnti-goalsConstraintsDecided by the userThe parts, in build order1. Foundation2. Question games (all 12 categories)3. Ordering and quantity games4. Richer cards5. Today routine6. Mascot7. Adaptive review and parent screenCalls made without the userLeft to the builder
1# Learning games, Today routine, and profiles
2
3## Intent
4
5DayByDay is an offline iOS/iPadOS app for ages 4–5. Today every category is a
6grid of cards that speak one word when tapped. Children lose interest because
7nothing asks them anything, nothing reacts to what they do, and nothing changes
8between visits. This work turns each topic into something the child plays:
9questions with feedback, ordering games for the topics that are about sequence,
10richer cards, a daily routine with a sticker calendar, a mascot, and a review
11loop that favors what the child gets wrong.
12
13## Goals
14
15- Every topic (the 11 grid categories; Today moves to the banner) has a "Find it!" question game.
16- Days, months, seasons and numbers teach order and quantity, not just names.
17- Each card does more than say its label (sound, fact, or an interaction).
18- A short daily routine on Today that children want to repeat, with a visible
19 record (sticker calendar).
20- Separate profiles for siblings on one device.
21- Question selection adapts to each child's misses; parents can see progress.
22
23## Non-goals
24
25- Camera, microphone, speech recognition, or parent-recorded voice. Deferred to
26 a later round.
27- iCloud sync or any network use. Profiles and progress stay on the device.
28- Localization beyond en-US.
29- New categories.
30
31## Anti-goals
32
33These would make the work a failure even if it functions:
34
35- Streak loss, guilt messaging, timers, loot boxes, or any mechanic designed to
36 extend sessions. Rounds end with a clear "You did it!".
37- Punishing wrong answers: no buzzer, no red X, no lost points.
38- Anything that requires reading to use. Every prompt is spoken; every choice is
39 a picture, color, or symbol.
40- Ads, accounts, analytics, network calls.
41- Third-party assets with unclear licenses.
42
43## Constraints
44
45- SwiftUI. The app target's effective deployment target is iOS 17.5 (the
46 project-level setting is 26.2; the README says iOS 26). Use only APIs
47 available on 17.5, or raise the target in a separate, stated change.
48- Some sources live at the repo root and are added to the target individually;
49 `DayByDay/` is a file-system-synchronized group. New files go under
50 `DayByDay/` so they are picked up automatically.
51- Speech uses the existing `SpeechSynthesizer` (AVSpeechSynthesizer, best en-US
52 voice, rate 0.4). It triggers a haptic on every `speak()`.
53- Large tap targets; works in portrait and landscape on iPhone and iPad.
54- All art and sound is made in code: SwiftUI shapes and SF Symbols for visuals,
55 sounds synthesized at runtime (e.g. AVAudioEngine tone/noise generation). No
56 bundled image or audio files beyond the existing app icon, except generated
57 speech clips (`DayByDay/Voice/`, rendered with ElevenLabs under a commercial
58 license; see 2026-10-16-better-voice.md) and the Baloo 2 heading font
59 (`DayByDay/Fonts/`, SIL Open Font License).
60- Every MR that adds or changes art or sound gets a review by a separate
61 reviewer agent focused on art and sound quality, before the MR is opened.
62- Repo is on gitbay. One MR per part below, branched from `main`, never pushed
63 to `main` directly.
64
65## Decided by the user
66
67- All seven parts below are in scope (camera, microphone, and parent voice
68 excluded).
69- All art and sound is generated in code, with an art/sound reviewer agent.
70- Profiles per sibling.
71- Data stays on device; no sync.
72- Navigation option C: home shows the mascot and today's routine on top, then
73 the topic grid. Tapping a topic opens a hub with large activity buttons:
74 "Look and listen" (the existing cards), "Find it!", and that topic's special
75 game. Same hub layout for every topic.
76- Each part's MR is merged once its tests and the art/sound review pass; no
77 wait for a human review between parts.
78- Item sets in existing categories may be revised (added, removed, swapped)
79 where it makes the games work, e.g. Animals gains animals with recognizable
80 sounds (cow, duck, sheep, pig) in place of ones without (ant, lizard).
81
82## The parts, in build order
83
84### 1. Foundation
85
86- **Profiles.** SwiftData model on device. A profile has a display name, an
87 avatar (an animal drawn from SF Symbols / shapes), a color, an optional
88 birthday (month and day), and per-day pictures (step 5). At launch, if more
89 than one profile exists, show a picker of large avatar tiles; tapping one
90 speaks "Hi, <name>!". With exactly one profile, skip the picker. On first
91 launch, create one profile through a short parent-facing setup (behind the
92 parent gate). No cap on profile count.
93- **Parent gate.** Press-and-hold for about 2 seconds, then answer a simple sum
94 shown as text. Protects profile management and, later, the progress screen.
95- **Answer log.** Every answer a child gives is recorded: profile, category,
96 item identifier, correct or not, timestamp. All later progress features read
97 from this log.
98- **Celebration.** One reusable overlay for correct answers: confetti
99 animation, a generated cheerful sound, a spoken praise phrase chosen from a
100 varied list, and the existing haptic. Wrong answers get a soft generated sound
101 and a spoken correction ("That's Thursday! Try again.").
102- **Question engine.** A shared model: a spoken prompt, a set of choices, which
103 choice is correct, and a way to render a choice. Each category exposes its
104 items through a common protocol. The engine picks questions (uniformly at
105 random in this step) and runs a round of about 5 questions ending with a
106 "You did it!" screen.
107- **Sound engine.** Runtime-synthesized sound effects shared by everything that
108 follows.
109- **Home and hubs (option C).** Restructure `ContentView`: a Today banner with
110 the mascot placeholder at the top, then the topic grid. Each topic opens a
111 hub with "Look and listen", "Find it!", and a slot for the topic's special
112 game (hidden until that game exists). Today itself is reached via the banner,
113 not a grid tile.
114- **Tests.** Add a unit test target. Cover the question engine, answer logging,
115 and profile CRUD.
116
117### 2. Question games (all 12 categories)
118
119- **Find it!** "Can you find <item>?" with 3–4 choices on screen (number grows
120 with correct answers in a round).
121- **Odd one out.** Where items have a natural grouping (food: fruit vs
122 vegetable; animals: pets vs wild or land vs water; shapes: round vs pointy;
123 weather: hot vs cold). Only for categories where the grouping is unambiguous.
124- **Listen and pick.** A generated sound or a spoken clue, child picks the
125 card. Animals (animal sound), weather (rain, wind, thunder), letters (letter
126 sound), numbers (that many beeps).
127
128### 3. Ordering and quantity games
129
130- **Week train.** Seven train cars, shuffled; the child drags them into order.
131 Also "What comes after Monday?" as a single-question variant.
132- **Year wheel.** Months around a wheel with seasons as colored sections. Child
133 spins it and is asked to find a month or a season; or places a month in its
134 season.
135- **Yesterday / today / tomorrow.** Three slots, child drags day cards in.
136- **Counting.** Tap objects to count them aloud; show the numeral beside the
137 dots. "Which pile has more?" comparison.
138
139### 4. Richer cards
140
141Inside "Look and listen", tapping a card does more than say its name:
142
143- Animals: generated animal sound plus one short fact.
144- Letters: letter name, letter sound, and an example word ("B… buh… ball").
145- Colors: a mixing activity (red + yellow → orange) as the Colors special game.
146- Shapes and letters: finger tracing with a path check.
147- Weather: dress a character for the weather (special game); shake the device
148 on the weather screen to make it rain (Core Motion).
149- Food: build a plate, or sort into fruit and vegetable bins (special game).
150- Body: "Touch your nose!" movement prompts the child acts out; the app waits,
151 then cheers.
152
153### 5. Today routine
154
155- A short spoken script the child taps through: "Today is Friday. Yesterday was
156 Thursday. Tomorrow is Saturday. It's October. It's Fall." Then the child
157 picks today's weather from picture choices.
158- Finishing the routine places a sticker on that day in a month calendar page.
159 One sticker per day per profile. Past months are browsable.
160- Personal lines when they apply: the child's name in the greeting, "Your
161 birthday is in May!" in the birthday month, "Today is your birthday!" on the
162 day.
163- Day pictures: a parent assigns a symbol to a weekday for a child (swim,
164 grandma, school). It appears on that day's card and in the routine ("Today is
165 swim day!").
166
167### 6. Mascot
168
169A single character drawn in SwiftUI shapes, with a few states: idle, asking,
170cheering, puzzled (on wrong answers), waving. It hosts the Today banner, asks
171questions in games, and appears in the celebration overlay. Replace the
172placeholder from step 1.
173
174### 7. Adaptive review and parent screen
175
176- The question engine weights items by recent misses per profile, so missed
177 items come up more often until answered correctly a few times.
178- Parent screen (behind the gate): per child, per category, which items are
179 known and which are still being missed, in plain terms ("Knows all the days.
180 Still mixing up June, July, August.").
181
182## Calls made without the user
183
184- **Switching profiles.** The home screen shows the current child's avatar in
185 a corner; tapping it (no gate) opens the profile picker. The picker also
186 appears when the app returns to the foreground after 10 or more minutes in
187 the background. Answers and stickers always go to the profile shown in that
188 corner.
189- **Art/sound review.** A rejection for a clear defect (clipping, harsh or
190 startling sound, unrecognizable drawing, poor contrast) blocks the MR until
191 fixed. Taste-level comments are advisory; after two rounds, remaining
192 disagreements are noted in the MR description for the user.
193- **Week order and wording.** Weeks start on Sunday, matching `DayOfWeek`. The
194 season is "Fall", matching the existing code.
195- **Weather in the routine.** Any weather choice is accepted; it is
196 self-report, not a quiz.
197
198## Left to the builder
199
200- Exact SwiftData schema, protocol names, and file layout.
201- Confetti and mascot visual design, sound synthesis approach, praise phrase
202 list, and animal facts, subject to the art/sound review.
203- Exact number of choices and round length (start around 3–4 choices and 5
204 questions).
205- Which categories get odd-one-out and listen-and-pick, within the rules above.
206- How "known" is defined for the adaptive weighting and the parent screen.
207- Whether existing per-category card views are refactored onto a shared
208 card component, as long as each change stays within the step that needs it.