/duology-recipes:recipe-kids-learningfrom duology-recipes
Generates a complete SwiftUI early-learning app for iPhone Duo (Apple's foldable) with counting, letters, and shapes activities. Includes adaptive layouts for folded/book/tabletop modes, parental gate, privacy manifest, VoiceOver, and UI tests.
Ships in duology-recipes. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
This recipe makes a new Xcode project: an early-learning app for children aged about 3 to 8 on iPhone Duo. Three activities (counting, first letters, shapes) ask one question at a time. Each question has a picture, a line of text and a big speaker button that reads it aloud for children who can't read yet. The answers are big buttons; a wrong one is set aside with a kind word, a right one earns a star. Nothing is timed and nothing is taken away. Closed, the picture sits above the answers. Open, the question takes the left page and the answers the right, like a picture book. Set the phone on a table half folded and the picture sits above the fold with the answers below it, on the half that rests on the table.
A Grown-ups button opens a parental gate. Behind it are Reset Progress, the speech setting, what the app does with data, and the privacy policy link. The app has no networking, no ads, no analytics, no purchases and no tracking, and its privacy manifest says so.
The questions are sample content. The value is the frame: a gate that follows App Review's rules, progress that no fold can lose, layouts read from the fold and never from the device, privacy checks that fail the build's tests if networking appears, and UI tests that pass on the Duo simulator.
Labels: measured means we ran it on the iPhone Duo simulator (iOS 27.1, 25 October 2026). Unverified means we could not check it. Everything else links to Apple. "Book" and "tabletop" are Duology's words for Apple's "partially folded, like a book" and "seated on a table like a laptop"; no API reports them. Full source list: reference/sources.md.
Use a different skill when:
duo-postures (tabletop and book layouts), duo-continuity (state through a fold) and duo-accessibility;recipe-two-player-game and duo-shared-screen;recipe-shop, and in a Kids Category app put every purchase behind a parental gate like this one (guideline 1.3)./duo-new recipe-kids-learning runs steps 1 to 5. Run every step yourself when there is no command.
Get three values from the user, or propose them:
AppName: letters and digits, starting with a letter (it becomes a Swift type, <AppName>App). Not Tools, and not an Apple module name such as SwiftUI or AVFoundation;com.example.littlesteps;Run the script from this skill's folder (in the plugin: ${CLAUDE_PLUGIN_ROOT}/skills/recipe-kids-learning/scripts/new-project.sh):
"${CLAUDE_PLUGIN_ROOT}/skills/recipe-kids-learning/scripts/new-project.sh" \
LittleSteps com.example.littlesteps ~/Developer/LittleSteps
It copies template/, replaces __APP_NAME__ and __BUNDLE_ID__ in file contents and paths, checks none are left, and prints the next steps. It refuses a folder that exists and is not empty (exit 73), and bad or clashing names (exit 65), before it creates anything.
Test the rules on the Mac. Expect 0 failed:
cd ~/Developer/LittleSteps && Tools/run-model-tests.sh
Build for the Duo simulator (find its UDID with xcrun simctl list devices available | grep "iPhone Duo"):
DEVELOPER_DIR=/Applications/Xcode-27.1.app/Contents/Developer \
xcodebuild -project LittleSteps.xcodeproj -scheme LittleSteps \
-destination "platform=iOS Simulator,id=<UDID>" \
-derivedDataPath build/DerivedData build
Install, launch straight into an activity, and screenshot the display in use. Use the UDID, not booted. -uiTesting mutes the speech, which otherwise plays through the Mac's speakers.
DEV=/Applications/Xcode-27.1.app/Contents/Developer
DEVELOPER_DIR=$DEV xcrun simctl install <UDID> build/DerivedData/Build/Products/Debug-iphonesimulator/LittleSteps.app
DEVELOPER_DIR=$DEV xcrun simctl launch --terminate-running-process <UDID> com.example.littlesteps -uiTesting -open counting
DEVELOPER_DIR=$DEV xcrun simctl io <UDID> screenshot --display=primary build/outer.png # closed
DEVELOPER_DIR=$DEV xcrun simctl io <UDID> screenshot --display=primary-1 build/inner.png # open
Only the display in use has content. Look at the PNG before you report.
Run the UI tests: DESTINATION="id=<UDID>" Tools/run-ui-tests.sh. A UI test brings the app to the front; tell the user first if they share the simulator.
Tell the user what passed, what they must set in App Store Connect (section 5), and that poses change only in Device Hub.
Set DEVELOPER_DIR for every xcrun and xcodebuild call when the Mac has more than one Xcode. Never run xcode-select.
| Path | What it holds |
|---|---|
<App>/Model/ | Activities and the sample questions, progress, the parental gate, the two-pane layout, the answer grid, fold geometry, app facts (privacy policy address, speech language). Foundation and CoreGraphics only, every type nonisolated and Sendable. |
<App>/Learn/ | HomeScreen (welcome and activity cards), LessonScreen (question pane and answers pane), BigButton (tiles, the press style, the tile grid). |
<App>/Grownups/ | GateScreen (the gate in a sheet) and GrownupsScreen (the area behind it). The only file that opens a link. |
<App>/Shared/ | PaneSplit (the two-pane Layout), onFoldChange (from recipe-reader), ArtView, Speaker, test markers. |
<App>/App/ | App entry, RootView (the stack and the sheet), LearningStore, launch switches. |
<App>/PrivacyInfo.xcprivacy | No tracking, no domains, no data collected; UserDefaults with reason CA92.1. |
<App>UITests/ | Nine UI tests, pose-agnostic. |
Tools/ | run-model-tests.sh, ModelTests/main.swift, run-ui-tests.sh. |
Project settings match the other recipes: iOS 26.0 deployment, Swift 6, SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor, approachable concurrency, file-system synchronized groups, iPhone and iPad, public.app-category.education, and a scheme with parallel testing off.
Architecture, state ownership, the gate and test details: references/architecture.md. App Review's kids rules, the privacy manifest and what the owner sets: references/kids-rules.md.
| Pose | Lesson (inside the navigation stack) | Question pane | Answers pane | Home |
|---|---|---|---|---|
| Closed (outer display) | 382 × 562 pt (measured) | top half, 382 × 273 pt | below it: three answers in one row, 106 × 220 pt each; Next 350 × 88 pt (measured) | welcome above, three cards of 350 × 104 pt (measured) |
| Closed, held sideways | wider than tall | left half | right half | the same split |
| Open, flat, held wide | 867 × 553 pt, fold's frame at x 455.5 to 495.5 (measured) | left page, 455.5 pt wide | right page, 371.5 pt: three answers in one column, 339 × 163 pt (measured) | welcome left, cards right (measured) |
| Book | the same pages; only the fold turns active (measured) | the same | the same | the same |
| Tabletop | 669 × 835 pt, fold's frame at y 373.5 to 413.5 (measured) | above the fold, 373.5 pt high | below it, 421.5 pt: three answers in a row, 201 × 220 pt (measured) | welcome above, cards below (measured) |
| Open, held tall, flat | as tabletop; the fold is inactive | the same | the same | the same |
Measured on 25 October 2026. Closed: all nine UI tests, the frames above, and the largest accessibility text size. Open (flat, held wide), book and tabletop: each pose set with duo-pose, then testLessonLayoutInThisPose and testHomeAndGateInThisPose, which fail if a button lands on the fold or under 88 pt and attach the real frames; both passed in each pose, every frame matched the table, and every answer sat wholly on one side of the fold. The read-aloud button measured 88 × 88 pt and the gate's keys 125 × 64 pt in every pose. The closed phone held sideways and the open phone held tall are unverified: their rows come from the Mac tests (LessonLayout, AnswerGrid).
| Technique | Where | Why |
|---|---|---|
| Progress survives every fold | Progress in LearningStore, @State in RootView | State above a layout switch survives it (duo-continuity). Saved to UserDefaults on every change, so it survives quitting too. Measured here: a relaunch. Progress through a real fold: unverified for this app (the pose tests set each pose from a fresh launch). |
| One layout in every pose | PaneSplit placing LessonLayout's two rectangles | No if on the pose around the panes, so neither is rebuilt (Layout). |
| The pages meet at the fold, not the middle | LessonLayout, fed by onFoldChange | reservedRegions(kind:options:layoutDirectionBehavior:) with .division and .includeInactive, read on the PaneSplit itself. Flat and folded give the same panes, so folding moves nothing. |
| Tabletop: look above, touch below | LessonLayout mode foldTopBottom | Apple's optional per-pose layout: what people watch in the top region, what they touch in the stable bottom one, with the same controls (talk 111466). For a small child, the bottom half resting on the table doesn't wobble under a tap. |
| No button on the fold | Answers, Next and Play Again live only in the second pane; the fold's frame is the gap | Nothing interactive in an active fold (talk 111466). The UI tests compare every button with a marker element at the fold's frame. |
| Big buttons | AnswerGrid, 88 pt minimum | Our choice: twice the 44 pt Apple asks for, for small fingers. Tidy grids only: one row, one column, or two by two. |
| No size feedback | .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity) on every measured pane | Measured: without minWidth: 0 the closed phone's answers stayed 434 pt wide in a 382 pt screen. |
| Width and fold, never the device | LessonLayout(size:fold:) | Same rule as every Duology skill; duo-lint --strict finds nothing. |
| Spoken prompts | Speaker (AVSpeechSynthesizer), .task(id: question?.id) | A new question is read aloud; a fold keeps the ID, so it never repeats. VoiceOver users get announcements instead (AccessibilityNotification.Announcement). |
| VoiceOver | Each pane a container (accessibilityElement(children: .contain)); things to count read one by one | A child using VoiceOver can count the stars by swiping (duo-accessibility). |
| Sheets survive folds | .sheet on RootView | The gate and a half-typed answer stay through a fold (duo-continuity). |
Read references/kids-rules.md before you submit. In short, in our words:
NSPrivacyTracking false, no tracking domains, no collected data types, NSPrivacyAccessedAPICategoryUserDefaults with CA92.1 (defaults only the app reads and writes), the same file as recipe-reader. A Mac test fails if networking or tracking APIs appear in the app's sources, or if the manifest and the sources disagree.Only the app's owner can do these, in App Store Connect:
https://example.com/privacy in AppFacts.swift with the same page.Change the content first, then the look.
Your questions: edit Model/SampleActivities.swift. Keep question IDs stable once children have stars for them. Tools/run-model-tests.sh checks every activity: 2 to 4 answers, the right one among them, unique IDs, every SF Symbol present, and the sample's own sense checks (the counting answer equals the things shown). A new activity:
import Foundation
// requires: Activity, Question, Answer (Model/Activity.swift), SampleActivities
extension SampleActivities {
/// Add it to `all` to show its card on the home screen.
static let animals = Activity(
id: "animals", title: "Animals", symbol: "pawprint.fill", tint: .blue,
questions: [
Question(
id: "animals.fly", text: "Which one can fly?", spoken: "Which animal can fly in the sky?",
art: .symbol("cloud.fill", .blue), artLabel: "The sky",
answers: [
Answer(id: "fish", label: "Fish", art: .symbol("fish.fill", .orange)),
Answer(id: "bird", label: "Bird", art: .symbol("bird.fill", .blue)),
Answer(id: "tortoise", label: "Tortoise", art: .symbol("tortoise.fill", .green)),
],
correct: "bird"),
])
}
Another language: translate the content, set AppFacts.speechLanguage (a BCP 47 code such as fr-FR), and translate the spoken prompts in AppFacts.
Looks: BigTile, ArtView, the home cards. Keep AnswerGrid.minimumTarget at 88 pt or more.
Add a model rule: write it in Model/, keep it nonisolated and Sendable, add a check in Tools/ModelTests/main.swift and a line to its off-main-actor check.
Keep these, whatever the app:
PaneSplit for every pose; panes from the fold's frame, never from half the width.Tools/ModelTests/main.swift, and update the manifest, the grown-ups text and the App Store Connect answers together if that ever changes.On the Mac: Tools/run-model-tests.sh builds Model/*.swift with the test program using swiftc -swift-version 6 -default-isolation MainActor, like the app target. It checks the sample content and its SF Symbols, progress (stars once, no penalty, save and load, an old file format), the gate (seeds, ranges, digits, attempts, a new question every time), the layouts at screen sizes measured on the Duo simulator (closed for this app; open and tabletop for recipe-reader's reader), the answer grid, the privacy scan of the app's sources and manifest, and that every model type works off the main actor. Measured: 164 checks pass in a few seconds, in the template and in a freshly generated project.
On the simulator: Tools/run-ui-tests.sh. The tests start from launch switches (-open, -question, -gateSeed, -resetState), find elements by identifier, and read the lesson.state, home.state, gate.state and grownups.state markers. They never depend on the pose. Measured: all nine passed on the closed Duo simulator, about 160 s. The first runs found three problems, now fixed and described in references/architecture.md: the answers pane growing to fit its buttons, taps lost when other apps on the shared simulator took the foreground, and a frame read while a pressed button was still shrunk. Open, book and tabletop are unverified (section 3).
Tools/run-ui-tests.sh -only-testing:LittleStepsUITests/LittleStepsUITests/testLessonLayoutInThisPose
Set the pose in Device Hub (or with duo-pose), then run that test and testHomeAndGateInThisPose once per pose. To check each pose by hand, or with duo-pose-matrix (needs the user's Accessibility permission):
duo-pose-matrix com.example.littlesteps --case "lesson=-uiTesting -resetState -open counting"
scripts/new-project.sh; no __APP_NAME__ or __BUNDLE_ID__ left.Tools/run-model-tests.sh prints 0 failed, privacy checks included.xcodebuild … build succeeds for the iPhone Duo simulator with no warnings from your code.python3 duo-lint.py --strict <project> reports no findings.Tools/run-ui-tests.sh passes.AppFacts.swift is yours, and the grown-ups text is still true.references/architecture.md (opens in a new tab)references/kids-rules.md (opens in a new tab)scripts/new-project.sh (opens in a new tab)template/README.md (opens in a new tab)template/Tools/ModelTests/main.swift (opens in a new tab)template/Tools/run-model-tests.sh (opens in a new tab)template/Tools/run-ui-tests.sh (opens in a new tab)template/__APP_NAME__.xcodeproj/project.pbxproj (opens in a new tab)template/__APP_NAME__.xcodeproj/project.xcworkspace/contents.xcworkspacedata (opens in a new tab)template/__APP_NAME__.xcodeproj/xcshareddata/xcschemes/__APP_NAME__.xcscheme (opens in a new tab)template/__APP_NAME__/App/LaunchOptions.swift (opens in a new tab)template/__APP_NAME__/App/LearningStore.swift (opens in a new tab)template/__APP_NAME__/App/RootView.swift (opens in a new tab)template/__APP_NAME__/App/__APP_NAME__App.swift (opens in a new tab)template/__APP_NAME__/Assets.xcassets/AccentColor.colorset/Contents.json (opens in a new tab)template/__APP_NAME__/Assets.xcassets/AppIcon.appiconset/AppIcon.png (opens in a new tab)template/__APP_NAME__/Assets.xcassets/AppIcon.appiconset/Contents.json (opens in a new tab)template/__APP_NAME__/Assets.xcassets/Contents.json (opens in a new tab)template/__APP_NAME__/Grownups/GateScreen.swift (opens in a new tab)template/__APP_NAME__/Grownups/GrownupsScreen.swift (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
swiftui, iphone-duo, kids-app, early-learning, foldable, xcode-project
npx claudepluginhub kimeur/duology --plugin duology-recipes8 skills in this plugin
/recipe-camera-studioCreates a complete SwiftUI camera studio for iPhone Duo, Apple's foldable: photos and videos with the rear camera and a self-timer, and, while the phone is open, the person being filmed sees themselves on the outer display (CameraCaptureAccessory) with the countdown or the recording time. Closed or open and flat, the controls float along the bottom or trailing edge, off the fold; folded like a book, the preview takes the left page and the controls the right; in tabletop the preview sits above the fold and the controls below it. Use when someone wants to start a new camera, photo booth, self-portrait or filming app from scratch, or runs /duo-new recipe-camera-studio. Covers AVFoundation capture on an actor (photo and movie outputs, rotation coordinators, a second mirrored preview layer), a stand-in camera that makes the simulator usable (it has no camera), an in-app gallery with ShareLink and no file dates, usage strings, a privacy manifest with Mac checks, and UI tests on the iPhone Duo simulator./recipe-finance-dashboardCreates a complete SwiftUI personal finance dashboard for iPhone Duo, Apple's foldable: balance and recent spending in one column on the closed outer display; balance, a Swift Charts spending chart and the transaction list side by side on the open inner display; an even 8-column grid with the fold as its middle gutter (DuoColumns and PaneFrames from duo-design-system); and list-detail for a transaction that survives fold and unfold. Use when someone wants to start a new finance, budgeting, banking, expenses or any dashboard app from scratch (a new Xcode project), or runs /duo-new recipe-finance-dashboard. For an existing app, use duo-design-system (grid) and duo-patterns (list-detail) instead. Covers FoldPanes reading the .division reserved region with includeInactive, one NavigationStack whose path comes from the selection, a delayed pop on unfold that keeps the margins right, money as whole cents, a Foundation-only model tested on the Mac, and UI tests that pass in any pose on the iPhone Duo simulator.Other plugins' skills for the same job