What problem does it solve?
This Skill helps developers design and optimize HealthKit queries to retrieve accurate results efficiently, reducing debugging time and data discrepancies.
Core Features & Use Cases
- Guided query construction for HKSampleQuery and HKStatisticsCollectionQuery with correct predicates, anchor dates, and interval handling.
- Edge-case handling and debugging for time zones, DST, midnight boundaries, and data overlap vs start-date semantics.
- Performance and reliability patterns for background delivery, authorization checks, error handling, and safe fallbacks in widgets and app contexts.
- Use cases include implementing new HealthKit features, diagnosing "data is off" issues, and optimizing long-running time-series queries on large datasets.
Quick Start
Design an hourly active energy query between two dates by selecting the appropriate HKQuery type, applying a strictStartDate predicate, and executing the query to fetch samples or statistics.