healthkit

Document HealthKit API usage for querying, reading, and writing health data.

Updated Apr 27, 2026
One-click install
npx skills add https://github.com/annurdien/skills --skill healthkit-annurdien
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: healthkit
Source: https://github.com/annurdien/skills/tree/main/healthkit
Command: npx skills add https://github.com/annurdien/skills --skill healthkit-annurdien

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

HealthKit API reference and guidance to query for HKHealthStore, read health data, and manage permissions across HealthKit-enabled apps.

Core Features & Use Cases

  • Centralized API reference for HKHealthStore, HKQuantitySample, HKUnit, and related HealthKit types.
  • Examples and navigable sections to support common tasks like requesting authorization, saving data, querying samples, and handling background updates.
  • Real-world scenario: a developer builds an iOS app that reads heart rate and step counts and stores workouts using HealthKit.

Quick Start

Ask HealthKit for an API reference example, such as how to authorize access and read basic user health data via HKHealthStore.

Frequently Asked Questions about healthkit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I request HealthKit authorization to read user health data?

HealthKit authorization requires configuring your iOS app to request access permissions via HKHealthStore. This allows your application to securely query and read user health data such as step counts and heart rate.

What is the best way to query HealthKit samples like HKQuantitySample?

The best way to query HealthKit samples is by using HKSampleQuery with HKHealthStore. This approach allows you to retrieve specific health data types, such as HKQuantitySample, while applying predicate filters to narrow down results.

How does an iOS app save workout data to HealthKit?

An iOS app saves workouts to HealthKit by writing health records via HKHealthStore. You construct workout objects and save them to the store, enabling secure storage and retrieval of user workout sessions.

Can I use HKHealthStore to manage background updates for health data?

Yes, you can use HKHealthStore to manage background updates for health data. This enables your iOS app to receive notifications and handle new health samples or changes even when running in the background.

What should I use to handle unit conversions when reading HealthKit data?

You should use HKUnit to handle unit conversions when reading HealthKit data. This ensures accurate measurement formatting and conversion for HKQuantitySample objects queried from the HKHealthStore.