healthkit-code-review
БесплатноБез исполняемых скриптовНе проверенReviews HealthKit code for authorization patterns, query usage, query descriptors, background delivery, and data type handling. Use when reviewing code with…
от existential-birds★ 92 звезды на GitHubОб этом скилле
HealthKit Code Review
Quick Reference
| Issue Type | Reference |
|---|---|
| HKHealthStore, permissions, status checks, privacy | references/authorization.md |
| Query descriptors, HKQuery types, predicates, anchored queries, statistics | references/queries.md |
| Background delivery, observer queries, SwiftUI/watchOS app lifecycle | references/background.md |
| HKQuantityType, HKCategoryType, workouts, units | references/data-types.md |
Review Checklist
-
HKHealthStore.isHealthDataAvailable()called before any HealthKit operations - Authorization requested only for needed data types (minimal permissions)
-
requestAuthorizationcompletion/return not misinterpreted as read permission granted - No attempt to determine read permission status (privacy by design)
- UI updates isolated on
@MainActor(or dispatched to main actor from legacy query callbacks) -
HKObjectQueryNoLimit/ unbounded descriptors used only with bounded predicates -
HKStatisticsQueryDescriptor/HKStatisticsQueryused for aggregations instead of manual summing - Observer query
completionHandler()always called (usedefer) - Background delivery registered every launch (
App.init()/application(_:didFinishLaunchingWithOptions:)/WKApplicationDelegate.applicationDidFinishLaunching()) - Background delivery entitlement (
com.apple.developer.healthkit.background-delivery) added (iOS 15+) - Correct units used for quantity types (e.g.,
count/minfor heart rate) - Long-running queries /
results(for:)Tasks stored and cancelled/stop()ped on teardown
When to Load References
- Reviewing authorization/permissions flow -> authorization.md
- Reviewing
HKSampleQueryDescriptor,HKAnchoredObjectQueryDescriptor,HKSampleQuery, or predicates -> queries.md - Reviewing
HKObserverQueryorenableBackgroundDelivery-> background.md - Reviewing
HKQuantityType,HKCategoryType, orHKWorkoutBuilder-> data-types.md
Review gates
Run in order. Do not state a finding in a later step until the pass condition for the current step is satisfied (each pass condition is answerable from the codebase under review).
- Scope — Pass: Name the file path(s) and types/symbols using
HealthKit,HKHealthStore, orHK*APIs (or state clearly that the diff touches none). - Availability and store — Pass: Cite the call site of
isHealthDataAvailable()before HealthKit use, or document why omission is acceptable for the scoped code; cite whereHKHealthStoreis created or injected. - Authorization semantics — Pass: For each
requestAuthorization/statusForAuthorizationRequest/getRequestStatusForAuthorization, cite handler branches per references/authorization.md (e.g., success does not prove read access); do not infer read permission fromauthorizationStatusalone. - Queries and limits — Pass: For each query or descriptor, cite predicate + limit (
HKObjectQueryNoLimitonly with a bounded predicate); for totals/aggregates, citeHKStatisticsQueryDescriptor/HKStatisticsQueryvs manual summing per references/queries.md. - Observers and background — Pass: If
HKObserverQueryorenableBackgroundDeliveryappears, cite where the observer is started/stopped and where background delivery is registered on launch; cite entitlements/Info.plistor flag missing config per references/background.md. If absent, Pass: one line “no observer/background in scope.” - Threading, lifecycle, and protocol — Pass: Cite
@MainActorisolation (or main-queue dispatch) for UI updates; cite retention/stop()/Task.cancel()for long-running queries; satisfyreview-verification-protocol(../review-verification-protocol/SKILL.md if installed).
Review Questions
- Is
isHealthDataAvailable()checked before creating or usingHKHealthStore? - Does the code gracefully handle denied read permissions (empty results)?
- Are observer query completion handlers called in all code paths?
- Is work in background handlers minimal (~15 second limit)?
- Are
HKQueryAnchors persisted separately per sample type?
Установить healthkit-code-review в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл healthkit-code-review?
Reviews HealthKit code for authorization patterns, query usage, query descriptors, background delivery, and data type handling. Use when reviewing code with import HealthKit, HKHealthStore, HKSampleQuery, HKSampleQueryDescriptor, HKObserverQuery, or HKQuantityType.
Как установить скилл healthkit-code-review?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл healthkit-code-review запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic