apple-watch-os
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+Appprotocol;WKApplicationDelegateAdaptorfor 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
CLKComplicationDataSourcewith WidgetKit timeline
3. Always On Display
TimelineView(.periodic(...))for live updates.isLuminanceReducedenv 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, SpotlightSiriKit: domain-based interactions only (messaging, media)- Conform to
AppIntent, implementperform(), 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.sharedor 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 Bundletarget,@testable import
watchOS 10 Changes
- Vertical
TabViewnavigation is standard (noNavigationSplitView) - 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.
More from eyadkelleh/carplay_claude_skill
carplay
CarPlay framework for iOS in-car applications — audio, communication, navigation, parking, EV charging, quick food ordering, fueling, driving task, public safety, and voice-based conversational apps. Includes widgets, live activities, CarPlay Ultra, and instrument cluster support.
21sirikit
Integrate Siri voice interactions, Shortcuts, and intelligent suggestions into iOS/watchOS apps using Apple's SiriKit framework. Use when implementing Intents extensions, custom intents, Siri Shortcuts, voice phrase handling, intent resolution/confirmation/handling, IntentsUI for custom Siri interfaces, donating shortcuts, or App Intents migration. Covers system intent domains (messaging, payments, ride booking, workouts, media) and custom intent definition.
1swiftui
SwiftUI framework for building user interfaces
1mapkit
Help developers integrate Apple MapKit into iOS/macOS apps. Use this skill when users ask to add a map to their app, display maps, show user location on a map, add markers/pins/annotations, implement map clustering, get directions/routing between locations, search for places/points of interest, implement MapKit features, work with MKMapView, SwiftUI Map, MKAnnotation, MKOverlay, MKDirections, MKLocalSearch, or any MapKit-related development task.
1apple-appclip
>
1widgetkit
Build iOS/macOS/watchOS/visionOS widgets, Live Activities, watch complications, and controls using Apple's WidgetKit framework. Use when creating widget extensions, timeline providers, configurable widgets, Lock Screen widgets, Smart Stack widgets, Live Activities with ActivityKit, interactive widgets with buttons/toggles, or watch complications. Covers all widget families (systemSmall/Medium/Large/ExtraLarge, accessoryCircular/Rectangular/Inline/Corner) and rendering modes.
1