healthkit

Read, write, and query Apple Health data via HealthKit.

Updated May 10, 2026
One-click install
npx skills add https://github.com/FelixRauch/medat-figuren --skill healthkit-felixrauch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: healthkit
Source: https://github.com/FelixRauch/medat-figuren/tree/main/.agents/skills/healthkit
Command: npx skills add https://github.com/FelixRauch/medat-figuren --skill healthkit-felixrauch

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

HealthKit integration lets mobile apps securely read and write Apple Health data needed for personalized health features, while handling authorization and device availability.

Core Features & Use Cases

  • Read Health metrics via queries: Fetch recent samples and compute aggregated statistics such as daily step counts and time-series chart data.
  • Write new Health samples: Save app-generated metrics using HKQuantitySample for metrics your app creates.
  • Enable background updates and workouts: Register background delivery for updates and manage live workout tracking with HKWorkoutSession and HKLiveWorkoutBuilder.
  • Use correct types and units: Apply appropriate HKQuantityTypeIdentifier values, HKCategoryType identifiers, and HKUnit conversions to ensure accurate results.

Quick Start

Use the healthkit skill to integrate HealthKit reads, statistics, background delivery, and workout session recording in your Swift (SwiftUI/iOS) app by following the setup and authorization steps first.

Frequently Asked Questions about healthkit

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

FAQPage Schema
How do I authorize HealthKit data access in a SwiftUI iOS app?

To authorize HealthKit data access in a SwiftUI app, configure the HKHealthStore capability, add Info.plist usage descriptions, perform isHealthDataAvailable checks, and request only necessary read/share types using async/await query descriptors.

How do I query daily step counts and time-series chart data from HealthKit?

Query daily step counts and time-series chart data from HealthKit using aggregated statistics queries and interval-based statistics collection queries to compute totals and summaries for your app's visualizations.

Can I track live workouts and record health metrics using HealthKit in iOS?

You can track live workouts and record health metrics in iOS using HKWorkoutSession and HKLiveWorkoutBuilder, alongside saving app-generated metrics with HKQuantitySample and appropriate HKUnit conversions.

Does HealthKit support background delivery for health data updates?

HealthKit supports background delivery for health data updates by registering background delivery handlers and implementing observer handling to trigger updates when underlying health data changes.

How do I handle HealthKit authorization denial in an iOS app?

Handle HealthKit authorization denial in an iOS app by safely checking authorization states within your async/await query descriptors to ensure your app gracefully manages restricted access to requested health data.

What's the best way to read and write Apple Health data for an iOS app?

The best way to read and write Apple Health data for an iOS app is using HealthKit's scoped sample queries and HKQuantitySample, applying correct HKQuantityTypeIdentifier values and HKUnit conversions to ensure accurate results.