Builds HealthKit authorization, sample reads/writes, statistics, background delivery, and workout sessions for Apple Health metrics. Covers HKQuantitySample storage, HKLiveWorkoutBuilder, unit handling, and privacy behavior.
Ships in all-ios-skills. 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.
Access, query, and store health and fitness metrics in Apple Health using HealthKit. Covers authorization, quantity samples, statistics collection queries, background delivery, and workout sessions. Targets Swift 6.4 / iOS 26+.
Enable HealthKit in Signing & Capabilities. If your app observes updates in the background, enable the Background Delivery checkbox.
Declare usage descriptions in Info.plist:
NSHealthShareUsageDescription: Required for reading health data.NSHealthUpdateUsageDescription: Required for writing health data.NSHealthClinicalHealthRecordsShareUsageDescription: Required if accessing clinical records.[!IMPORTANT] Request only the exact types needed for the immediate feature. App Review strictly rejects apps requesting unneeded health permissions.
Always guard initialization with HKHealthStore.isHealthDataAvailable(). HealthKit is supported on iPhone, Apple Watch, iPad (iPadOS 17+), and Vision Pro, but unavailable on iPadOS 16 or earlier and managed devices with restrictions.
guard HKHealthStore.isHealthDataAvailable() else { return }
let healthStore = HKHealthStore() // Single thread-safe shared store
| Query Type | Best Used For | Execution |
|---|---|---|
HKSampleQueryDescriptor | Raw individual samples with sorting and limits | One-shot async |
HKStatisticsQueryDescriptor | Single aggregate metric (sum, average, min/max) over a date range | One-shot async |
HKStatisticsCollectionQueryDescriptor | Time-series aggregations (daily step charts, hourly heart rate) | One-shot or continuous |
HKAnchoredObjectQueryDescriptor | Incremental synchronization with anchor tokens | One-shot or streaming |
HKObserverQuery | Background delivery triggers when health data changes | Background notification |
Always specify compatible HKUnits matching the quantity type. For cumulative metrics (steps, active energy), set start and end dates encompassing the measurement interval; for discrete metrics (heart rate), use identical start and end dates.
enableBackgroundDelivery, read Background Delivery.HKWorkoutSession and HKLiveWorkoutBuilder, read Live Workout Sessions.HKCategoryTypeIdentifierMenopausalState (menopause, perimenopause, none) and HKCategoryTypeIdentifierBleedingAfterMenopause (unspecified, light, medium, heavy). Both are read/write, fall under Reproductive Health, and use standard category authorization.Sources: https://sosumi.ai/documentation/ios-ipados-release-notes/ios-ipados-27-release-notes
HKHealthStore.isHealthDataAvailable().NSHealthShareUsageDescription or NSHealthUpdateUsageDescription, causing immediate crash on launch.HKHealthStore instances instead of sharing a single instance across the app..meter() instead of .count()).HKHealthStore.isHealthDataAvailable() checked before accessing storeHKQuantityType dimensionenableBackgroundDelivery(for:frequency:)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/all-ios-skills:healthkitfrom all-ios-skills
npx claudepluginhub thienqo/ios-skills --plugin all-ios-skills95 skills in this plugin
/accessorysetupkitDiscover and configure Bluetooth and Wi-Fi accessories using AccessorySetupKit. Use when presenting a privacy-preserving accessory picker, defining discovery descriptors for BLE or Wi-Fi devices, handling accessory session events, migrating from CoreBluetooth permission-based scanning, or setting up accessories without requiring broad Bluetooth permissions./activitykitBuild or review Live Activities and Dynamic Island experiences with ActivityKit, including lifecycle, layouts, push updates, and scheduled delivery. Use for time-sensitive Lock Screen or Dynamic Island state; route ordinary widgets to widgetkit./adattributionkitMeasure ad effectiveness with privacy-preserving attribution using AdAttributionKit. Use when registering ad impressions, handling attribution postbacks, updating conversion values, implementing re-engagement attribution, configuring publisher or advertiser apps, or replacing SKAdNetwork with AdAttributionKit for ad measurement.Other plugins' skills for the same job