| name | onboarding-generator |
| description | Generates value-moment-first onboarding flows for iOS/macOS apps โ the default architecture races a new user to the first felt experience of the app's promised outcome, branching on whether they can experience it right now or need to plan for later. The classic paged welcome-carousel tour is an explicit fallback for genuinely explain-first apps. Use when user wants to add onboarding, welcome screens, first-launch experience, or improve activation/trial conversion. |
| allowed-tools | ["Read","Write","Edit","Glob","Grep","Bash","AskUserQuestion"] |
| last_verified | "2026-07-23T00:00:00.000Z" |
| review_by | "2027-06-22T00:00:00.000Z" |
| os_version | iOS 27 / macOS 27 |
Onboarding Generator
Generate onboarding whose job is to get a new user to the value moment โ the first time they experience (never just read about) the outcome the app promises โ as fast as their situation allows.
Default architecture: value-moment-first, branching on readiness. The user answers one question ("can you do this right now?"), and the path is either the shortest possible route to the value moment, or a captured plan to reach it later. Fallback architecture: the classic paged welcome carousel โ generate it only when Step 0 below confirms the app is genuinely explain-first.
Read onboarding-patterns.md for the full philosophy, the nine implementation lessons (each with a code sketch), and a worked case study.
When This Skill Activates
Use this skill when the user:
- Asks to "add onboarding" or "create onboarding"
- Mentions "welcome screens" or "first launch"
- Wants to "show intro on first launch"
- Asks about "onboarding flow" or "tutorial screens"
- Wants to improve "activation," "time-to-value," or "trial conversion"
- Asks "why do users churn right after signup/purchase" (post-purchase first-run is half of this skill)
Before Anything Else: What Is The Value Moment?
This is the question that decides every downstream choice โ ask it before any configuration question. If the requester can't answer it, help them find it: it's the first specific instant a user feels the outcome, not a feature list. "Sees a demo of X" is not a value moment; "actually did X and saw the result" is.
Onboarding that ends before the user felt the value moment didn't finish โ it just stopped.
Pre-Generation Checks
1. Project Context Detection
2. Conflict Detection
Glob: **/*Onboarding*.swift, **/*Welcome*.swift
Grep: "hasCompletedOnboarding" or "isFirstLaunch" or "onboardingCompleted"
If found, ask the user:
- Replace existing onboarding?
- Keep existing, add the value-moment flow as a new post-purchase/post-launch stage?
3. Overlap Check โ generators/quick-win-session
If the project already has a quick-win-session installation, don't generate a second guided-first-action system. Ask whether the existing quick-win session already is the ready-now path (often it is โ fold this flow's branch question and later-path in around it) or whether the two should stay separate stages.
Configuration Questions
Ask user via AskUserQuestion:
-
What's the value moment? (free text) โ the first specific instant the user experiences the app's promise. Push back on feature descriptions ("a calendar sync feature") until you get an outcome ("saw their two calendars merged into one").
-
Free-first or paywalled-first?
- Free-first (no launch paywall) โ this flow is the whole onboarding
- Paywalled-first โ personalize โ paywall happens before this flow starts; this flow begins at first-run-after-purchase (the half that decides trial conversion and renewals)
-
What's the ready-now action? โ the shortest real path to the value moment when the user can experience it immediately. Must name an existing feature/screen to reuse, never a new one built just for onboarding.
-
What does "later" capture? โ the concrete implementation intention (a specific when, e.g. "Tuesday 6pm," never "someday"), and what happens with it: a local reminder, a home-surface chip, both?
-
Architecture override โ is this genuinely explain-first? Default is no (value-moment-first). Only say yes if Step 0's test below is met. This is the one question that routes to the carousel fallback instead.
Generation Process
Step 0: Confirm The Architecture (do this before writing any file)
Run this test:
Would skipping straight to the value moment leave the user unable to understand what they're looking at, in a way no amount of contextual UI (tooltips, empty-state copy, a single explainer inline) could fix โ because the domain itself requires orientation (e.g., a professional tool with domain-specific jargon, a multi-role enterprise workflow)?
- No (the overwhelming default) โ generate the value-moment-first flow (Steps 1โ5).
- Yes โ generate the carousel fallback (Step 6). "We have a lot to say" is not a yes โ trim the copy instead.
Step 1: Create Core Files (Value-Moment Default)
Read templates/value-moment/ for production Swift code, then generate:
OnboardingPhase.swift โ the phase/branch state model (one enum case per screen; every case maps to exactly one decision)
OnboardingStore.swift โ @Observable coordinator (plain object, not a View โ see onboarding-patterns.md Lesson 1's testability point). Owns phase transitions, the branch, the captured "when," and calls into instrumentation. No navigation/routing types inside it โ the app's existing router/state owns side effects, this store owns only business state.
OnboardingRootView.swift โ the phase switch. No NavigationStack of its own (this view is a root, never a pushed destination โ see the global SwiftUI-patterns rule against nesting nav containers).
OnboardingBranchView.swift โ screen 1: value-moment framing + the ready-now/later fork. This is the only screen every user sees.
OnboardingReadyNowBridgeView.swift โ the ready-now hand-off into the real feature, with resume-callback wiring (Lesson 3 + Lesson 4)
OnboardingIntentionView.swift โ later path: capture the concrete "when" via chips, resolved through a pure, injectable-clock function (Lesson 7)
OnboardingReminderView.swift + OnboardingReminderService.swift โ later path: the contextual local-notification permission ask (Lesson 6)
OnboardingInstrumentation.swift โ value-moment reach-rate markers (Lesson 8)
Step 2: Wire The Root Swap (Lesson 1 โ required)
Onboarding replaces the app's root view; it is never a .fullScreenCover/.sheet over the real content. Show the requester this shape and adapt it to their app's actual root:
struct ContentView: View {
@State private var onboardingStore = OnboardingStore()
private var showOnboarding: Bool {
if appState.onboardingCompleted { return false }
return onboardingStore.phase != .completed && onboardingStore.phase != .awaitingHandoffReturn
}
var body: some View {
Group {
if showOnboarding {
OnboardingRootView(store: onboardingStore)
} else {
RealAppRootView()
}
}
.onChange(of: onboardingStore.phase) { _, newPhase in
guard newPhase == .completed else { return }
appState.onboardingCompleted = true
}
}
}
Step 3: Wire Resume Mechanics (Lesson 4 โ required whenever the ready-now action hands off into an existing multi-screen flow)
Arm a one-shot completion callback before the hand-off, plus a wander-off safety net that completes onboarding silently if the user backs out without resolving:
func beginReadyNowHandoff() {
store.beginHandoff()
router.presetPathIntoRealFeature(...)
router.onRealFeatureFinished = { outcome in
store.handoffReturned(valueMomentReached: outcome.reachedValueMoment)
}
}
.onChange(of: router.path) { _, newPath in
guard store.phase == .awaitingHandoffReturn, newPath.isEmpty else { return }
store.abandonToHome()
}
Step 4: Suppress Onboarding In Existing UI Tests (Lesson 5 โ required step, not optional)
Adding this flow will break the first screen of every existing UI test that assumes it lands on the app's real home screen. Before finishing generation:
- Find the project's UI-test launch-argument gate (
ProcessInfo.processInfo.arguments), usually in a UITestSupport-style file.
- Add an onboarding-suppression default: existing test launches pre-set the durable completed flag unless a new, dedicated argument opts back in.
static var showOnboardingOverride: Bool {
ProcessInfo.processInfo.arguments.contains("-uiTestShowOnboarding")
}
appState.onboardingCompleted = !UITestSupport.showOnboardingOverride
- Tell the requester explicitly which existing test target this touches and that a dedicated onboarding UI test should pass
-uiTestShowOnboarding to exercise the real flow.
Step 5: Close The Loop On The "Later" Branch (Lesson 9)
After the plan lands, surface it on the app's home surface โ a small chip/badge carrying the planned date/action that reopens the flow when tapped โ and prune it once the date passes:
if let plannedAt = appState.plannedIntentionDate {
PlannedIntentionChip(date: plannedAt) { }
}
func prunePlannedIntentionIfExpired(now: Date = .now) {
guard let plannedIntentionDate, plannedIntentionDate <= now else { return }
self.plannedIntentionDate = nil
}
Step 6: Carousel Fallback (only if Step 0 said yes)
Read templates/carousel-fallback/ and the "Carousel Fallback" section of onboarding-patterns.md. Generate:
OnboardingView.swift โ main paged/stepped container
OnboardingPageView.swift โ individual page template
OnboardingPage.swift โ page data model
OnboardingStorage.swift โ persistence
OnboardingModifier.swift โ view modifier for integration
Ask the same navigation-style/skip/presentation configuration questions as before (paged vs stepped, 2โ5 screens, skip option, full-screen cover vs inline). Even here: still apply the root-swap and UI-test-suppression steps above โ the presentation mechanics change, the anti-flash and anti-broken-test requirements don't.
Step 7: Determine File Location
Check project structure:
- If
Sources/ exists โ Sources/Onboarding/
- If
App/ exists โ App/Onboarding/
- Otherwise โ
Onboarding/
The Audit Checklist
Run this before calling generation done โ on a fresh flow, and again any time onboarding is later touched. If any answer is "no," the flow needs work before it ships:
- Can a ready-now user reach the value moment in under two minutes?
- Is there any screen that purely explains a feature, rather than letting the user experience it or make a path-changing decision?
- Does the flow actually branch on readiness โ or does every user see the same steps regardless of their answer to the ready-now/later question?
- For later-users, is a concrete plan captured โ a specific when โ never a vague "someday" with no follow-up?
- Is the notification permission request attached to a reason the user just created (their own chosen date/task), never asked cold at first launch?
- Do you know your value-moment reach rate? Is the value moment defined as a tracked event at all โ reach rate, time-to-reach, and per-screen drop-off โ or is the only number you have "% who tapped through onboarding"?
Output Format
After generation, provide:
Files Created โ Value-Moment Default
Onboarding/
โโโ OnboardingPhase.swift # Phase/branch state model
โโโ OnboardingStore.swift # @Observable coordinator (business state only)
โโโ OnboardingRootView.swift # Phase switch โ the root-swap target
โโโ OnboardingBranchView.swift # Screen 1: value-moment framing + fork
โโโ OnboardingReadyNowBridgeView.swift # Ready-now hand-off + resume wiring
โโโ OnboardingIntentionView.swift # Later: concrete "when" capture
โโโ OnboardingReminderView.swift # Later: contextual permission ask
โโโ OnboardingReminderService.swift # Local-notification seam (protocol + live impl)
โโโ OnboardingInstrumentation.swift # Value-moment reach-rate markers
Files Created โ Carousel Fallback
Onboarding/
โโโ OnboardingView.swift # Main container
โโโ OnboardingPageView.swift # Page template
โโโ OnboardingPage.swift # Data model
โโโ OnboardingStorage.swift # @AppStorage persistence
โโโ OnboardingModifier.swift # .onboarding() modifier
Integration Steps
Root swap (both architectures):
@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
Value-moment: define the app's own phases and hand-offs in OnboardingPhase.swift/OnboardingStore.swift โ the template ships a two-phase (ready-now / later) skeleton; add or remove phases to match the actual value moment, keeping one decision per phase.
Carousel fallback: add pages as before โ
static let pages: [OnboardingPage] = [
OnboardingPage(title: "Welcome", description: "...", imageName: "hand.wave", accentColor: .blue),
]
Testing Instructions
Value-moment flow:
- Delete app from simulator/device (resets
UserDefaults)
- Fresh launch โ answer "ready now" โ confirm the value moment is reached in the fewest possible taps, using the real feature (not a replica)
- Fresh launch โ answer "later" โ confirm a concrete date/time is captured, the permission prompt appears only after tapping the reminder CTA, and denial still saves the plan
- Force-quit mid-flow (after screen 1, before completion) โ relaunch โ confirm the phase-first gate resumes onboarding rather than flashing real content
- During the ready-now hand-off, back out without resolving the destination screen โ confirm onboarding completes silently (no re-interrupt, no trap)
- Let the "later" date pass โ revisit the home surface โ confirm the planned-intention chip is pruned
- Run the project's existing UI test suite โ confirm no regressions from onboarding intercepting their first screen (Step 4)
Carousel fallback: unchanged from the classic flow โ delete app, confirm it shows once, confirm it doesn't reappear after completion.
Debug/Testing Reset
Button("Reset Onboarding") {
UserDefaults.standard.removeObject(forKey: "hasCompletedOnboarding")
OnboardingInstrumentation.resetForTesting(defaults: .standard)
}
Instrumentation: Reach Rate Is The North Star
Track value-moment reach rate โ percentage of new users who reach the value moment in their first session, time-to-reach, and per-screen drop-off โ not flow completion. A user who reached the value moment and closed the app is a win; a user who tapped through every screen and never felt it is not.
This works even in apps with no analytics SDK: local-only markers (UserDefaults timestamps for startedAt/branch/valueMomentAt/completedAt) plus os.Logger, every write idempotent (first stamp wins) so re-entrant paths never overwrite a real timestamp with a later, less meaningful one. See onboarding-patterns.md Lesson 8 for the full pattern; wire into a real analytics provider (e.g. an installed generators/analytics-setup output) when one exists.
References
- onboarding-patterns.md โ the full philosophy, all nine implementation lessons with code sketches, the carousel fallback's design patterns, and a worked case study
- templates/value-moment/ โ default architecture templates
- templates/carousel-fallback/ โ classic paged/stepped tour templates, for explain-first apps only
- Related:
generators/quick-win-session โ guided first-action UI; check for overlap before generating both (see Pre-Generation Check 3)
- Related:
generators/permission-priming โ deeper priming patterns if the reminder step needs more than a single contextual ask
- Related:
generators/paywall-generator โ the pre-purchase half of the flow for paywalled-first apps
- Related:
generators/push-notifications โ remote push infrastructure, distinct from this skill's local-only reminder (no server involved)