← 返回 Skills 市场
anderskev

Healthkit Code Review

作者 Kevin Anderson · GitHub ↗ · v1.2.1 · MIT-0
cross-platform ✓ 安全检测通过
170
总下载
0
收藏
1
当前安装
2
版本数
在 OpenClaw 中安装
/install healthkit-code-review
功能描述
Reviews HealthKit code for authorization patterns, query usage, background delivery, and data type handling. Use when reviewing code with import HealthKit, H...
使用说明 (SKILL.md)

HealthKit Code Review

Quick Reference

Issue Type Reference
HKHealthStore, permissions, status checks, privacy references/authorization.md
HKQuery types, predicates, anchored queries, statistics references/queries.md
Background delivery, observer queries, completion handlers 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)
  • 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 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).

  1. ScopePass: Name the file path(s) and types/symbols using HealthKit, HKHealthStore, or HK* APIs (or state clearly that the diff touches none).
  2. Availability and storePass: Cite the call site of isHealthDataAvailable() before HealthKit use, or document why omission is acceptable for the scoped code; cite where HKHealthStore is created or injected.
  3. Authorization semanticsPass: For each requestAuthorization / getRequestStatusForAuthorization, cite handler branches per references/authorization.md (e.g. success does not prove read access); do not infer read permission from authorizationStatus alone.
  4. Queries and limitsPass: For each query, cite predicate + limit (HKObjectQueryNoLimit only with a bounded predicate); for totals/aggregates, cite HKStatisticsQuery / collection vs manual summing per references/queries.md.
  5. Observers and backgroundPass: If HKObserverQuery or enableBackgroundDelivery appears, cite where the observer is started/stopped and where background delivery is registered; cite entitlements/Info.plist or flag missing config per references/background.md. If absent, Pass: one line “no observer/background in scope.”
  6. Threading and lifecyclePass: Cite main-queue (or documented pattern) for UI updates from query callbacks; cite retention/stop()/deinit for long-running queries per checklist above.

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)?
安全使用建议
This skill appears coherent and low-risk: it is a checklist plus HealthKit reference docs and asks only to read the codebase under review. Before installing, ensure you trust the agent's repository read permissions (it will need to see source files to cite call sites). Also be careful not to feed or paste any real user health data or production secrets into the review prompts — the skill evaluates code, but any sample data you include could contain sensitive health information. Finally, if you want to be extra cautious, run the review on a copy of the code (with secrets/redacted data) rather than on live production files.
能力评估
Purpose & Capability
Name/description, SKILL.md checklist, and the four reference docs all focus on HealthKit review (authorization, queries, background, data types). The skill requests no binaries, env vars, config paths, or installs — which is appropriate for a static code-review helper.
Instruction Scope
Runtime instructions explicitly direct the agent to inspect code (file paths, call sites, handlers) and follow a specific gated review process. The instructions do not ask the agent to read unrelated system files, access environment variables, or transmit findings externally — they stay within the stated review scope. Note: because it asks the agent to cite file paths and call sites, the agent will need read access to the repository under review.
Install Mechanism
No install specification and no code files that execute — this is instruction-only, so nothing will be downloaded or written to disk by an install step.
Credentials
The skill declares no required environment variables, credentials, or config paths. There are no extraneous secret requests that would be disproportionate to a code-review task.
Persistence & Privilege
Flags: always=false (not forced), user-invocable=true, disable-model-invocation=false (agent may invoke autonomously, which is the platform default). The skill does not request persistent system presence or modify other skills' configs.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install healthkit-code-review
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /healthkit-code-review 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.2.1
- Refined review workflow by adding "Review gates": a step-by-step sequence of pass conditions reviewers should follow when examining HealthKit code. - Clarified that each review step must be completed before proceeding to the next, and that findings in later steps depend on earlier pass conditions. - Each review gate includes specific requirements and citation guidance for proper code referencing. - No changes to the review checklist, quick reference, or core content outside the new "Review gates" section.
v1.2.0
- 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.
元数据
Slug healthkit-code-review
版本 1.2.1
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 2
常见问题

Healthkit Code Review 是什么?

Reviews HealthKit code for authorization patterns, query usage, background delivery, and data type handling. Use when reviewing code with import HealthKit, H... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 170 次。

如何安装 Healthkit Code Review?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install healthkit-code-review」即可一键安装,无需额外配置。

Healthkit Code Review 是免费的吗?

是的,Healthkit Code Review 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Healthkit Code Review 支持哪些平台?

Healthkit Code Review 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Healthkit Code Review?

由 Kevin Anderson(@anderskev)开发并维护,当前版本 v1.2.1。

💬 留言讨论