返回顶部
h

healthkit-code-review

Reviews HealthKit code for authorization patterns, query usage, background delivery, and data type handling. Use when reviewing code with import HealthKit, HKHealthStore, HKSampleQuery, HKObserverQuery, or HKQuantityType.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.2.0
安全检测
已通过
108
下载量
0
收藏
概述
安装方式
版本历史

healthkit-code-review

# HealthKit Code Review ## Quick Reference | Issue Type | Reference | |------------|-----------| | HKHealthStore, permissions, status checks, privacy | [references/authorization.md](references/authorization.md) | | HKQuery types, predicates, anchored queries, statistics | [references/queries.md](references/queries.md) | | Background delivery, observer queries, completion handlers | [references/background.md](references/background.md) | | HKQuantityType, HKCategoryType, workouts, units | [references/data-types.md](references/data-types.md) | ## Review Checklist - [ ] `HKHealthStore.isHealthDataAvailable()` called before any HealthKit operations - [ ] Authorization requested only for needed data types (minimal permissions) - [ ] `requestAuthorization` completion handler not misinterpreted as permission granted - [ ] No attempt to determine read permission status (privacy by design) - [ ] Query results dispatched to main thread for UI updates - [ ] `HKObjectQueryNoLimit` used only with bounded predicates - [ ] `HKStatisticsQuery` used for aggregations instead of manual summing - [ ] Observer query `completionHandler()` always called (use `defer`) - [ ] Background delivery registered in `application(_:didFinishLaunchingWithOptions:)` - [ ] Background delivery entitlement added (iOS 15+) - [ ] Correct units used for quantity types (e.g., `count/min` for heart rate) - [ ] Long-running queries stored as properties and stopped in `deinit` ## When to Load References - Reviewing authorization/permissions flow -> authorization.md - Reviewing HKSampleQuery, HKAnchoredObjectQuery, or predicates -> queries.md - Reviewing HKObserverQuery or `enableBackgroundDelivery` -> background.md - Reviewing HKQuantityType, HKCategoryType, or HKWorkout -> data-types.md ## Review Questions 1. Is `isHealthDataAvailable()` checked before creating HKHealthStore? 2. Does the code gracefully handle denied permissions (empty results)? 3. Are observer query completion handlers called in all code paths? 4. Is work in background handlers minimal (~15 second limit)? 5. Are HKQueryAnchors persisted per sample type (not shared)?

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 healthkit-code-review-1776111543 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 healthkit-code-review-1776111543 技能

通过命令行安装

skillhub install healthkit-code-review-1776111543

下载 Zip 包

⬇ 下载 healthkit-code-review v1.2.0

文件大小: 10.34 KB | 发布时间: 2026-4-14 10:05

v1.2.0 最新 2026-4-14 10:05
- Added a structured quick reference table for HealthKit authorization, query patterns, background delivery, and data type usage.
- Introduced a detailed review checklist covering key HealthKit best practices and common pitfalls.
- Provided clear guidance on when to consult specific documentation references.
- Included targeted review questions to help ensure correct and privacy-compliant HealthKit code.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部