/duology-recipes:recipe-shopfrom duology-recipes
Creates a complete SwiftUI shop for iPhone Duo (Apple's foldable) using StoreKit 2. Generates a product grid that reflows from 2 to 4 columns across the fold, list-detail layout, basket, paywall, and UI tests. Use for new shop/catalog/IAP apps from scratch.
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: a shop that sells sound packs for one iPhone Duo. Closed, the packs sit two per row under a Plus card and a new pack; a pack opens on its own screen. Open, the grid spans the window, four per row, two on each side of the fold. Pick a pack and it opens beside the grid. The basket and the Plus subscription screen split on the fold too: the packs or what Plus gives on one side, the price and the button on the other.
The packs are a placeholder. The value is the frame: a grid that never puts a tile in the fold, list-detail that survives opening and closing the phone, StoreKit 2 code that buys, restores and handles Ask to Buy, checkout rules you can test on the Mac in seconds, and UI tests that buy, fail and wait for approval on the Duo simulator.
Labels: measured means we ran it on the iPhone Duo simulator (iOS 27.1). Unverified means we could not check it. Everything else links to Apple. Full source list: reference/sources.md.
Use a different skill when:
duo-patterns (feed reflow, list-detail) and duo-design-system (the grid);Store./duo-new recipe-shop runs steps 1 to 4, then installs and launches the app with no StoreKit session, so every price reads "–". Run steps 5 and 6 yourself. 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 or StoreKit (folders in the template), and not an Apple module name such as SwiftUI or Foundation;com.example.soundshop;Run the script from this skill's folder (in the plugin: ${CLAUDE_PLUGIN_ROOT}/skills/recipe-shop/scripts/new-project.sh):
"${CLAUDE_PLUGIN_ROOT}/skills/recipe-shop/scripts/new-project.sh" \
SoundShop com.example.soundshop ~/Developer/SoundShop
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/SoundShop && Tools/run-model-tests.sh. Among them: every product in the catalog matches StoreKit/Shop.storekit.
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 -quiet -project SoundShop.xcodeproj -scheme SoundShop \
-destination "platform=iOS Simulator,id=<UDID>" \
-derivedDataPath build/DerivedData build
Run the UI tests: DESTINATION="id=<UDID>" Tools/run-ui-tests.sh. With no setting it uses the simulator named iPhone Duo. They open a StoreKit test session on StoreKit/Shop.storekit, and the simulator keeps it for this app afterwards, purchases included: after the subscribe test, the shop shows Plus as on. Run -only-testing:<AppName>UITests/<AppName>UITests/testPricesComeFromTheStoreKitConfiguration to leave a clean state.
Launch on a pack and screenshot the display in use. Use the UDID, not booted. The tests installed the app.
DEV=/Applications/Xcode-27.1.app/Contents/Developer
DEVELOPER_DIR=$DEV xcrun simctl launch --terminate-running-process <UDID> com.example.soundshop -select pack.harbor
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
Measured: launched with simctl before any test session, StoreKit returned no products and every price read "–"; after one, prices showed. Only the display in use has content. Look at the PNG before you report. In Xcode, Product > Run uses the scheme's StoreKit configuration directly.
Tell the user what passed, and that poses change only in Device Hub (duo-pose-matrix can press its buttons).
Set DEVELOPER_DIR for every xcrun and xcodebuild call when the Mac has more than one Xcode. Never run xcode-select for this.
| Path | What it holds |
|---|---|
<App>/Model/Catalog.swift, SampleCatalog.swift | Packs, tracks, categories and the two Plus plans, with StoreKit product IDs. |
<App>/Model/Cart.swift | The basket: add once, toggle, remove packs the person already has, exact Decimal totals, "Plus costs less". |
<App>/Model/CheckoutRun.swift | Checkout, one purchase at a time: cancel or error stops it, pending moves on, resume carries on. |
<App>/Model/Ownership.swift, PlanMath.swift | What the person owns (packs, Plus) from entitlements; the yearly saving. |
<App>/Model/DuoColumns.swift | DuoFold, DuoColumns, PaneFrames: the grid and pane math from duo-design-system. Foundation only. |
<App>/Store/Store.swift | The only StoreKit code: products, purchases, Transaction.updates, entitlements, restore. |
<App>/Shop/ | The grid, the Plus card, the new pack card, the price slot. |
<App>/Detail/PackDetail.swift | One pack: price, basket button, sounds. |
<App>/Basket/BasketScreen.swift | Basket and checkout. |
<App>/Plus/PlusScreen.swift | The paywall: benefits, plans, subscribe, terms, restore, manage. |
<App>/Shared/ | Tokens, FoldPanes, ActionPanes (two panes, or one column with a pinned button), pack artwork. |
StoreKit/Shop.storekit | The local StoreKit configuration: 12 non-consumables, two subscriptions in one group, a free week on the yearly plan. |
<App>UITests/ | Eleven UI tests, pose-agnostic, with a StoreKit test session. |
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, a privacy manifest that declares nothing collected, and a scheme with parallel testing off and the StoreKit configuration on Run.
Architecture and test details: references/architecture.md. StoreKit, testing and going live: references/storekit.md.
| Pose | Width class | Shop | Basket and Plus |
|---|---|---|---|
| Closed (outer display) | compact | 4 columns: packs span 2 (2 per row), cards span 4. A pack is pushed. | One column; Buy or Subscribe pinned at the bottom. |
| Open, flat, held wide | regular | 8 columns, the gutter between the halves centred on the fold line: 4 packs per row, one card per side. A picked pack opens in the trailing pane; the grid keeps 2 per row in the leading pane. | Two panes: packs or benefits leading; total or plans, the button and the terms trailing. |
| Partly folded like a book | regular | The same columns; only the gap at the fold grows, to the fold's frame. With a pack open, the grid's pane ends at 455.7 pt and the pack's starts at 495.7 pt (measured; flat: 467.7 and 483.7). | Same panes; the fold is the gap between them. |
| Open, held tall, or set on a table like a laptop | regular | The fold runs across, between rows; 8 equal columns (unverified on this recipe). | Two equal panes (unverified). |
The pack, the basket, a checkout in progress and the store live in ShopModel and Store, above the stack. Measured: closed on a pack, then opened, then closed: the pack moved to the trailing pane and back to its own screen.
| Technique | Where | Why |
|---|---|---|
| Even columns, the fold as the middle gutter | ShopColumn in Shop/ShopScreen.swift: DuoColumns grouped by tokens.span(2) for packs, span(4) for cards | Apple asks for an even column count whenever a division region exists, active or not, and for the gap at the hinge to widen while the outer margins stay (HIG). duo-patterns calls this feed reflow. |
| Tiles line up across the fold | Fixed art height and line counts in PackTile | The halves differ in width next to the vertical bar, so an aspect-ratio image made the two halves' rows different heights (measured). |
| Grid alone or beside a pack | ShopScreen: PaneFrames only when a pack is picked and the width is regular | Open with nothing picked, the grid spans the fold; with a pack, it moves to the leading pane. |
| Text stays on one side | The "All packs" header is capped at the first card's width | A heading or button across the fold is hard to read and to tap. |
| Two-pane paywall and checkout | Shared/ActionPanes.swift | Regular: FoldPanes with the button in the trailing pane. Compact: one scroll view with .safeAreaInset(edge: .bottom) holding the button. |
| Unfolding on a pushed pack | RootView waits 600 ms before switching to two panes | Measured: popped during the unfold animation, the shop came back with the closed phone's insets and no margins (x −2 pt, right inset 42 pt instead of 84 pt) and stayed so; popped after it, it matched a fresh launch. Same as recipe-finance-dashboard. |
| Buy from the right display | @Environment(\.purchase) (PurchaseAction) in the basket and paywall | Apple's SwiftUI purchase action carries the view's scene, so StoreKit's confirmation shows next to it, on whichever display the app is on. |
| Purchases that arrive later | Store.start() listens to Transaction.updates at launch | Ask to Buy approvals, other devices, renewals and unfinished transactions arrive there. |
| Width class, never the device | RootView | Same rule as every Duology skill. |
Change the catalog and the rules first, in Model/ and StoreKit/Shop.storekit, and test them on the Mac.
SampleCatalog.swift and Shop.storekit together, with the same IDs you will create in App Store Connect. Tools/run-model-tests.sh fails when an ID, a price, a name, a period or a trial differs.PackArt with images. Keep a fixed height in the grid tile.model.store.buy(id, with: purchase) from PackDetail instead of the basket button. Keep the basket for several packs.Cart and the screens; replace Store with Apple Pay or your provider, and drop Ownership.Keep these, whatever the app:
displayPrice, priceFormatStyle, subscription), never typed in a view.AppStore.sync() asks the person to sign in (doc)..includeInactive, a fixed tile height, and buttons inside one pane.On the Mac: Tools/run-model-tests.sh builds Model/*.swift with the test program using swiftc -swift-version 6 -default-isolation MainActor. Measured: 67 checks pass in a few seconds, including the catalog against Shop.storekit; removing nonisolated from any of the 13 model types stops the build.
On the simulator: Tools/run-ui-tests.sh. Eleven tests: prices from StoreKit, even columns, list-detail, the basket total and removal, a full checkout, a failed purchase that stops checkout until resumed, Ask to Buy, both plans, subscribing, and a layout check per pose. Measured: all eleven pass closed and open, and testLayoutInThisPose passes partly folded (iPhone Duo simulator, iOS 27.1, 20 Oct 2026).
The scheme's StoreKit configuration reaches the app only when Xcode runs it. Measured: under xcodebuild test, prices stayed unavailable, even with the file also set on the test action. So the tests open an SKTestSession on StoreKit/Shop.storekit themselves, found through #filePath, clear past purchases and turn off the confirmation sheets. Details and the Duo UI test notes: references/storekit.md.
scripts/new-project.sh; no __APP_NAME__ or __BUNDLE_ID__ left.Tools/run-model-tests.sh prints 0 failed, including the StoreKit file checks.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 closed and open.references/architecture.md (opens in a new tab)references/storekit.md (opens in a new tab)scripts/new-project.sh (opens in a new tab)template/README.md (opens in a new tab)template/StoreKit/Shop.storekit (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/RootView.swift (opens in a new tab)template/__APP_NAME__/App/ShopModel.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__/Basket/BasketScreen.swift (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
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