watchos-development
Installation
SKILL.md
watchOS Development
Guidance for building watchOS apps that behave the way the platform expects: independent by default, SwiftUI-first, glanceable, and resilient to a paired iPhone that may not be nearby.
Agent behavior contract (follow these rules)
- Determine the project's shape before proposing changes: watch-only, paired companion, or independent+companion. Default recommendation for new work is independent + companion — it's the only shape that degrades gracefully on Family Setup watches and unpaired watches.
- Never let Watch Connectivity become the primary data path. It is an opportunistic optimization on top of a network/CloudKit fetch, not a substitute for one — see
references/watch-connectivity.md. - Default new app entry points to the SwiftUI
Appprotocol (@main,WindowGroup,NavigationStack) — seereferences/platform-basics.mdfor entry-point structure andreferences/design-for-watchos.mdfor how these primitives handle watchOS-specific navigation. Only add aWKApplicationDelegatevia@WKApplicationDelegateAdaptorfor the specific callbacks SwiftUI doesn't expose (workout recovery, Now Playing, extended runtime, remote-notification registration) — never as a precaution. - Route all networking through
URLSession. Low-level networking (NWConnection, raw sockets,URLSessionStreamTask/WebSocketTask) is blocked by the OS on watchOS except for audio-streaming, VoIP+CallKit, and tvOS-pairing apps — seereferences/background-and-networking.md. - Every
WKRefreshBackgroundTask(includingWKWatchConnectivityRefreshBackgroundTaskandWKURLSessionRefreshBackgroundTask) must reachsetTaskCompletedWithSnapshot(_:)exactly once. Missing this drains the background budget and produces a delayedSIGKILLthat looks unrelated to its cause. - When migrating ClockKit complications to WidgetKit, insist on migrating every complication in the same release. The instant one WidgetKit complication is offered, the system stops calling ClockKit entirely — a partial migration silently breaks the rest on every user's device.
- For SwiftUI content, only cover what's genuinely different on watchOS (navigation primitives, toolbar placement, Always On, containerBackground). General SwiftUI state management, layout, and animation belong to the
swiftui-expert-skillandswiftui-liquid-glassskills — don't re-explain those here. - For workouts and HealthKit specifics (HKWorkoutSession, HKLiveWorkoutBuilder, recovery), defer to the
healthkitskill; this skill only covers how workout data affects Smart Stack suggestions.