axiom-health
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHealthKit and WorkoutKit
HealthKit and WorkoutKit
You MUST use this skill for ANY HealthKit or WorkoutKit development including authorization, data queries, background delivery, workout sessions, planned workouts, wellbeing APIs (State of Mind), Medications, and Health Records.
任何涉及HealthKit或WorkoutKit的开发工作都必须使用本技能,包括授权、数据查询、后台推送、健身会话、计划健身活动、健康状态API(State of Mind)、药物管理以及健康记录等内容。
Quick Reference
快速参考
| Symptom / Task | Reference |
|---|---|
HealthKit framework model, | See |
Capability setup, | See |
| See |
Anchored queries, observer queries, | See |
| See |
| WorkoutKit custom/planned workouts, scheduling, swimming workouts, previewing | See |
| State of Mind, Medications API, symptom logging, wellbeing APIs | See |
| Health Records (FHIR), Mobility Health App, motion-based health | See |
| 场景/任务 | 参考文档 |
|---|---|
HealthKit框架模型、 | 查看 |
功能配置、 | 查看 |
| 查看 |
锚定查询、观察者查询、 | 查看 |
| 查看 |
| WorkoutKit自定义/计划健身活动、日程安排、游泳健身活动、预览功能 | 查看 |
| State of Mind、药物API、症状记录、健康状态API | 查看 |
| 健康记录(FHIR)、移动健康应用、基于运动的健康功能 | 查看 |
Cross-Suite Routes
跨套件指引
These topics overlap with HealthKit/WorkoutKit but live in separate suites:
以下主题与HealthKit/WorkoutKit相关,但属于其他独立套件:
watchOS presentation
watchOS 展示相关
- Watch-specific workout presentation (Always On, Smart Stack), complication surfaces → See axiom-watchos
- Workout app structure on Apple Watch → See axiom-watchos ()
skills/platform-basics.md
- Apple Watch专属健身活动展示(常亮显示、智能堆叠)、复杂功能界面 → 查看 axiom-watchos
- Apple Watch上的健身应用结构 → 查看 axiom-watchos()
skills/platform-basics.md
Concurrency
并发编程
- Swift 6 concurrency, actors, Sendable → See axiom-concurrency
- HealthKit queries bridging to Swift Concurrency → is the canonical example
skills/queries.md
- Swift 6并发、actor、Sendable → 查看 axiom-concurrency
- HealthKit查询与Swift并发的适配 → 是标准示例
skills/queries.md
SwiftUI
SwiftUI
- Charts rendering for health data → See axiom-swiftui
- view models for health data → See axiom-swiftui
@Observable
- 健康数据图表渲染 → 查看 axiom-swiftui
- 健康数据的视图模型 → 查看 axiom-swiftui
@Observable
Data and sync
数据与同步
- General cross-platform sync patterns (CloudKit, GRDB) → See axiom-data
- HealthKit anchored/observer queries as a generalizable sync mechanism →
skills/sync-and-background.md
- 通用跨平台同步模式(CloudKit、GRDB)→ 查看 axiom-data
- HealthKit锚定/观察者查询作为通用同步机制 →
skills/sync-and-background.md
Security and privacy
安全与隐私
- Keychain storage, encryption, data-protection entitlements → See axiom-security
- Keychain存储、加密、数据保护权限 → 查看 axiom-security
Conflict Resolution
冲突解决
axiom-health vs axiom-watchos: For workout apps on Apple Watch:
- Use axiom-health for lifecycle,
HKWorkoutSession, recovery APIs, multi-device mirroring — these are HealthKit concepts, not watch conceptsHKLiveWorkoutBuilder - Use axiom-watchos for watch-specific presentation: Always On display, Smart Stack placement, watchOS background mode coordination
- Both apply for a watch-native workout app — start with axiom-health for session lifecycle, then axiom-watchos for presentation
axiom-health vs axiom-concurrency: For HealthKit query patterns:
- Use axiom-health for which query type to choose and HealthKit-specific gotchas
- Use axiom-concurrency for general Swift 6 actor isolation rules that apply to query callbacks
axiom-health vs axiom-data: For change-tracked data synchronization:
- Use axiom-health for ,
HKAnchoredObjectQuery,HKObserverQueryHKDeletedObject - Use axiom-data for application-level data sync across devices (CloudKit, GRDB, SwiftData)
axiom-health vs axiom-watchos:针对Apple Watch上的健身应用:
- 使用axiom-health处理生命周期、
HKWorkoutSession、恢复API、多设备镜像 —— 这些属于HealthKit概念,而非watch专属概念HKLiveWorkoutBuilder - 使用axiom-watchos处理watch专属展示:常亮显示、智能堆叠布局、watchOS后台模式协同
- 两者均适用于watch原生健身应用 —— 先使用axiom-health处理会话生命周期,再使用axiom-watchos处理展示逻辑
axiom-health vs axiom-concurrency:针对HealthKit查询模式:
- 使用axiom-health选择查询类型以及了解HealthKit专属注意事项
- 使用axiom-concurrency处理适用于查询回调的通用Swift 6 actor隔离规则
axiom-health vs axiom-data:针对变更追踪的数据同步:
- 使用axiom-health处理、
HKAnchoredObjectQuery、HKObserverQueryHKDeletedObject - 使用axiom-data处理跨设备的应用级数据同步(CloudKit、GRDB、SwiftData)
Decision Tree
决策树
dot
digraph health {
start [label="HealthKit / workout task" shape=ellipse];
what [label="What area?" shape=diamond];
start -> what;
what -> "skills/fundamentals.md" [label="framework basics, data types"];
what -> "skills/authorization-and-privacy.md" [label="permissions, purpose strings, privacy"];
what -> "skills/queries.md" [label="reading data, rollups, writes"];
what -> "skills/sync-and-background.md" [label="change tracking, background delivery"];
what -> "skills/workouts.md" [label="HKWorkoutSession, live workouts"];
what -> "skills/workoutkit.md" [label="planned/custom workouts"];
what -> "skills/wellbeing-and-medications.md" [label="State of Mind, Medications"];
what -> "skills/clinical-and-mobility.md" [label="Health Records, Mobility"];
what -> "axiom-watchos" [label="watch-specific presentation"];
what -> "axiom-concurrency" [label="general actor isolation rules"];
what -> "axiom-swiftui" [label="Charts, data visualization"];
}dot
digraph health {
start [label="HealthKit / workout task" shape=ellipse];
what [label="What area?" shape=diamond];
start -> what;
what -> "skills/fundamentals.md" [label="framework basics, data types"];
what -> "skills/authorization-and-privacy.md" [label="permissions, purpose strings, privacy"];
what -> "skills/queries.md" [label="reading data, rollups, writes"];
what -> "skills/sync-and-background.md" [label="change tracking, background delivery"];
what -> "skills/workouts.md" [label="HKWorkoutSession, live workouts"];
what -> "skills/workoutkit.md" [label="planned/custom workouts"];
what -> "skills/wellbeing-and-medications.md" [label="State of Mind, Medications"];
what -> "skills/clinical-and-mobility.md" [label="Health Records, Mobility"];
what -> "axiom-watchos" [label="watch-specific presentation"];
what -> "axiom-concurrency" [label="general actor isolation rules"];
what -> "axiom-swiftui" [label="Charts, data visualization"];
}Resources
资源
WWDC: 2019-218, 2020-10182, 2020-10184, 2020-10664, 2021-10009, 2021-10287, 2022-10005, 2023-10016, 2023-10023, 2024-10084, 2024-10109, 2025-321, 2025-322
Docs: /healthkit, /healthkit/about-the-healthkit-framework, /healthkit/authorizing-access-to-health-data, /healthkit/protecting-user-privacy, /healthkit/reading-data-from-healthkit, /healthkit/running-queries-with-swift-concurrency, /healthkit/executing-anchored-object-queries, /healthkit/executing-observer-queries, /healthkit/hkworkoutsession, /healthkit/hklivewobuilder, /workoutkit, /healthkit/accessing-health-records
Skills: axiom-watchos, axiom-concurrency, axiom-swiftui, axiom-data, axiom-security
WWDC: 2019-218, 2020-10182, 2020-10184, 2020-10664, 2021-10009, 2021-10287, 2022-10005, 2023-10016, 2023-10023, 2024-10084, 2024-10109, 2025-321, 2025-322
文档: /healthkit, /healthkit/about-the-healthkit-framework, /healthkit/authorizing-access-to-health-data, /healthkit/protecting-user-privacy, /healthkit/reading-data-from-healthkit, /healthkit/running-queries-with-swift-concurrency, /healthkit/executing-anchored-object-queries, /healthkit/executing-observer-queries, /healthkit/hkworkoutsession, /healthkit/hklivewobuilder, /workoutkit, /healthkit/accessing-health-records
技能: axiom-watchos, axiom-concurrency, axiom-swiftui, axiom-data, axiom-security