watchOS Apps Skill
Design before you code — watchOS requires more planning than coding. Keep interactions brief: a few taps, then wrist down.
Architecture
| Layer |
Technology |
Purpose |
| Main app |
SwiftUI + WatchKit |
Navigation, direct interaction |
| Complications |
WidgetKit |
Watch face data + app launch |
| Smart Stack |
WidgetKit |
Swipe-up widget feed |
| Notifications |
UserNotifications |
Alerts + actions |
| Voice |
App Intents / SiriKit |
Siri + Shortcuts |
| Health |
HealthKit |
Sensors, workouts |
| Background |
WKExtensionDelegate |
Refresh, network, BLE |
1. App Lifecycle
- Independent app: no iOS companion required
@main + App protocol; WKApplicationDelegateAdaptor for delegate
- Navigation (watchOS 10):
NavigationStack, TabView(.verticalPage)
- Background:
WKExtensionDelegate.handle(_:) + WKBackgroundTask
2. Complications (WidgetKit)
- Families:
.accessoryCircular, .accessoryRectangular, .accessoryInline, .accessoryCorner
- Pattern:
TimelineProvider -> TimelineEntry -> SwiftUI View
- Reload:
WidgetCenter.shared.reloadTimelines(ofKind:)
- Smart Stack:
widgetRelevances(_:) API
- Migration: replace
CLKComplicationDataSource with WidgetKit timeline
3. Always On Display
TimelineView(.periodic(...)) for live updates
.isLuminanceReduced env value to adapt UI
- Reduce animations/brightness in AOD state
4. Notifications
- Short-look: auto-generated (non-customizable)
- Long-look:
WKUserNotificationHostingController; customize sash colors
- Action buttons:
UNNotificationCategory + UNNotificationAction
- Interactive: controls in content area without launching app
- Text input suggestions: override
suggestionsForResponseToAction(withIdentifier:for:inputLanguage:)
- Foreground actions run where tapped; background actions run on notification's target device
5. Gestures
- Double Tap (Series 9+, Ultra 2):
.handGestureShortcut(.primaryAction) — one per scene
- Priority: primary action > scroll view > vertical tabs
- Action Button (Ultra): AppIntent via
ActionButtonArticle
6. App Intents & Siri
AppIntents: preferred for Siri, Shortcuts, Action button, Spotlight
SiriKit: domain-based interactions only (messaging, media)
- Conform to
AppIntent, implement perform(), use @Parameter
7. HealthKit
- Auth:
HKHealthStore().requestAuthorization(toShare:read:)
- Workouts:
HKWorkoutSession + HKLiveWorkoutBuilder
- Queries:
HKSampleQuery, HKStatisticsQuery, HKAnchoredObjectQuery
- Extended Runtime Session needed for sustained workout tracking
8. Background & Runtime
- Background App Refresh: system-scheduled, limited budget
WKExtendedRuntimeSession: workouts, mindfulness, location tracking
- Background
URLSession: survives app close; prefer small payloads
- Complete tasks with
setTaskCompletedWithSnapshot(_:)
9. Networking
- Foreground:
URLSession.shared or ephemeral
- Background:
URLSessionConfiguration.backgroundSessionConfiguration("id") + delegate
10. Auth, Sizes, A11y, Testing
- Auth: Sign in with Apple or PassKit (no password entry)
- Sizes: 40/41/44/45/49mm — use
.containerRelativeFrame(), avoid fixed pixels
- Accessibility:
accessibilityLabel/hint/value, .accessibilityElement(children:.combine)
- Testing: add
watchOS Unit/UI Testing Bundle target, @testable import
watchOS 10 Changes
- Vertical
TabView navigation is standard (no NavigationSplitView)
- Smart Stack replaces Dock for widgets
- WidgetKit powers Lock Screen complications AND Smart Stack
Common Patterns
// Double tap
Button("Action") { go() }.handGestureShortcut(.primaryAction)
// WidgetKit complication
struct W: Widget {
var body: some WidgetConfiguration {
StaticConfiguration(kind: "id", provider: P()) { e in V(entry: e) }
.supportedFamilies([.accessoryCircular, .accessoryRectangular])
}
}
// Extended runtime
let s = WKExtendedRuntimeSession(); s.delegate = self; s.start()
// Background URLSession
let cfg = URLSessionConfiguration.backgroundSessionConfiguration("com.app.bg")
URLSession(configuration: cfg, delegate: self, delegateQueue: nil)
.downloadTask(with: url).resume()
// Always On
@Environment(\.isLuminanceReduced) var dim
Reference
For full API docs, notification forwarding details, ClockKit migration, HealthKit patterns:
read references/watchos-reference.md bundled with this skill.
1---2name: apple-watch-os3description: Expert guidance for building watchOS apps with SwiftUI, WidgetKit complications, notifications, Siri/App Intents, HealthKit, and WatchKit runtime management. Use this skill whenever the user asks about Apple Watch development, watchOS features, complications, watch faces, Smart Stack, Always On, double-tap, Action button (Ultra), background sessions, Extended Runtime Sessions, independent watch apps, or watchOS-specific APIs. Trigger for ClockKit to WidgetKit migration, watchOS UI patterns, multiple watch sizes, and accessibility. Also use for SwiftUI questions in a watchOS context.4---56# watchOS Apps Skill78Design before you code — watchOS requires more planning than coding. Keep interactions brief: a few taps, then wrist down.910## Architecture1112| Layer | Technology | Purpose |13|-------|-----------|---------|14| Main app | SwiftUI + WatchKit | Navigation, direct interaction |15| Complications | WidgetKit | Watch face data + app launch |16| Smart Stack | WidgetKit | Swipe-up widget feed |17| Notifications | UserNotifications | Alerts + actions |18| Voice | App Intents / SiriKit | Siri + Shortcuts |19| Health | HealthKit | Sensors, workouts |20| Background | WKExtensionDelegate | Refresh, network, BLE |2122## 1. App Lifecycle23- Independent app: no iOS companion required24- `@main` + `App` protocol; `WKApplicationDelegateAdaptor` for delegate25- Navigation (watchOS 10): `NavigationStack`, `TabView(.verticalPage)`26- Background: `WKExtensionDelegate.handle(_:)` + `WKBackgroundTask`2728## 2. Complications (WidgetKit)29- Families: `.accessoryCircular`, `.accessoryRectangular`, `.accessoryInline`, `.accessoryCorner`30- Pattern: `TimelineProvider` -> `TimelineEntry` -> SwiftUI View31- Reload: `WidgetCenter.shared.reloadTimelines(ofKind:)`32- Smart Stack: `widgetRelevances(_:)` API33- Migration: replace `CLKComplicationDataSource` with WidgetKit timeline3435## 3. Always On Display36- `TimelineView(.periodic(...))` for live updates37- `.isLuminanceReduced` env value to adapt UI38- Reduce animations/brightness in AOD state3940## 4. Notifications41- Short-look: auto-generated (non-customizable)42- Long-look: `WKUserNotificationHostingController`; customize sash colors43- Action buttons: `UNNotificationCategory` + `UNNotificationAction`44- Interactive: controls in content area without launching app45- Text input suggestions: override `suggestionsForResponseToAction(withIdentifier:for:inputLanguage:)`46- Foreground actions run where tapped; background actions run on notification's target device4748## 5. Gestures49- Double Tap (Series 9+, Ultra 2): `.handGestureShortcut(.primaryAction)` — one per scene50- Priority: primary action > scroll view > vertical tabs51- Action Button (Ultra): AppIntent via `ActionButtonArticle`5253## 6. App Intents & Siri54- `AppIntents`: preferred for Siri, Shortcuts, Action button, Spotlight55- `SiriKit`: domain-based interactions only (messaging, media)56- Conform to `AppIntent`, implement `perform()`, use `@Parameter`5758## 7. HealthKit59- Auth: `HKHealthStore().requestAuthorization(toShare:read:)`60- Workouts: `HKWorkoutSession` + `HKLiveWorkoutBuilder`61- Queries: `HKSampleQuery`, `HKStatisticsQuery`, `HKAnchoredObjectQuery`62- Extended Runtime Session needed for sustained workout tracking6364## 8. Background & Runtime65- Background App Refresh: system-scheduled, limited budget66- `WKExtendedRuntimeSession`: workouts, mindfulness, location tracking67- Background `URLSession`: survives app close; prefer small payloads68- Complete tasks with `setTaskCompletedWithSnapshot(_:)`6970## 9. Networking71- Foreground: `URLSession.shared` or ephemeral72- Background: `URLSessionConfiguration.backgroundSessionConfiguration("id")` + delegate7374## 10. Auth, Sizes, A11y, Testing75- Auth: Sign in with Apple or PassKit (no password entry)76- Sizes: 40/41/44/45/49mm — use `.containerRelativeFrame()`, avoid fixed pixels77- Accessibility: `accessibilityLabel/hint/value`, `.accessibilityElement(children:.combine)`78- Testing: add `watchOS Unit/UI Testing Bundle` target, `@testable import`7980## watchOS 10 Changes81- Vertical `TabView` navigation is standard (no `NavigationSplitView`)82- Smart Stack replaces Dock for widgets83- WidgetKit powers Lock Screen complications AND Smart Stack8485## Common Patterns8687```swift88// Double tap89Button("Action") { go() }.handGestureShortcut(.primaryAction)9091// WidgetKit complication92struct W: Widget {93 var body: some WidgetConfiguration {94 StaticConfiguration(kind: "id", provider: P()) { e in V(entry: e) }95 .supportedFamilies([.accessoryCircular, .accessoryRectangular])96 }97}9899// Extended runtime100let s = WKExtendedRuntimeSession(); s.delegate = self; s.start()101102// Background URLSession103let cfg = URLSessionConfiguration.backgroundSessionConfiguration("com.app.bg")104URLSession(configuration: cfg, delegate: self, delegateQueue: nil)105 .downloadTask(with: url).resume()106107// Always On108@Environment(\.isLuminanceReduced) var dim109```110111## Reference112For full API docs, notification forwarding details, ClockKit migration, HealthKit patterns:113read `references/watchos-reference.md` bundled with this skill.