← 返回 Skills 市场
ppopen

Health Data

作者 pp · GitHub ↗ · v1.0.0
cross-platform ✓ 安全检测通过
285
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install health-data
功能描述
Analyze Apple Health exports (export.zip or the exported folder) using xmlstarlet/jq to summarize activity, steps, sleep, and source counts. Trigger this ski...
使用说明 (SKILL.md)

Purpose

The health-data skill provides deterministic helpers to read and summarize Apple Health backup exports. The bundled health-data.sh script understands the zipped export Apple Health lets you download and can also work against the unzipped folder with export.xml. Use this skill when you need to inspect record types, compute totals (steps, distance, sleep), or extract JSON for further analysis without sending the sensitive XML off-box.

Safety

  • Apple Health exports contain PII/PHI (biometric, sleep, location, heart-rate, etc.). Never publish the raw XML, upload the zip, or paste any values into third-party services without explicit consent and legal review.
  • The script only reads data locally and cleans up its temporary extraction. Keep the exported zip/folder on disk-free space you control and delete it when the analysis is done.
  • Running summary or export-json now emits a runtime PHI warning banner to stderr; treat every derived artifact as PHI/PII unless you have an explicit legal/research justification.
  • The export-json command streams records instead of slurping them, warns on stderr after emitting 100,000 records without --limit, and supports --out \x3Cfile> so you can save the JSON to a file created with 600 permissions instead of dumping to stdout.
  • Request explicit confirmation before writing any derived health reports if the values are later shared with others (medical, legal, or employment contexts).

Quick start

# List which HealthKit record types appear most often
health-data/health-data.sh list-types ~/Downloads/export.zip

# Summarize range, totals, and common sources
health-data/health-data.sh summary ~/Downloads/export.zip

# Get JSON records for steps (use jq to filter further)
health-data/health-data.sh export-json HKQuantityTypeIdentifierStepCount ~/Downloads/export.zip --limit 20
# Or save to a restricted file (600-permission) instead of stdout
health-data/health-data.sh export-json HKQuantityTypeIdentifierStepCount ~/Downloads/export.zip --limit 20 --out ~/Documents/steps.json

Commands

list-types \x3Cexport-path>

Prints every \x3CRecord type="..."> identifier in the export, sorted by frequency. Use this to understand which categories (steps, workouts, heart rate, etc.) are available before you dig into payloads.

summary \x3Cexport-path>

Reports:

  • total record count and date coverage
  • step count and walking/running distance sums (meters by default)
  • counts of sleep analysis categories (asleep/in-bed)
  • top five data sources by record volume

This command relies on xmlstarlet to query the XML so it stays fast even on large exports.

export-json \x3Crecord-type> \x3Cexport-path> [--limit N] [--out \x3Cfile>]

Pulls the requested record type into JSON so you can pipe it to jq, Python, or other tools. The command emits a runtime PHI warning banner on stderr, streams records instead of slurping them, warns after 100,000 emitted records when --limit is omitted, and supports --out \x3Cfile> to save the JSON to a file created with 600 permissions. Supply --limit to avoid overwhelming the reader (default: unlimited). Examples:

health-data/health-data.sh export-json HKCategoryTypeIdentifierSleepAnalysis ~/Downloads/export.zip --limit 5
health-data/health-data.sh export-json HKQuantityTypeIdentifierStepCount ~/Downloads/export.zip --limit 20 --out ~/Documents/step-records.json

Advanced filtering

Because the output from export-json is valid JSON, use jq for additional insights:

health-data/health-data.sh export-json HKQuantityTypeIdentifierStepCount ~/Downloads/export.zip --limit 50 \
  | jq '[.[] | {value, startDate}]'

Combine jq selectors (like map(select(.unit == "count"))) to focus on specific fields without writing additional parsing logic.

Examples

  • "What record types did my Health export include?" → health-data.sh list-types ~/path/to/export.zip
  • "Show me step totals and sleep breakdown for my export" → health-data.sh summary ~/path/to/export.zip
  • "I want the raw step records for the last week" → health-data.sh export-json HKQuantityTypeIdentifierStepCount ~/path/to/export.zip --limit 100 and pipe through jq '.[].startDate | select(startswith("2026-03"))'
  • "Save a slice of the export to a local file" → health-data.sh export-json HKQuantityTypeIdentifierStepCount ~/path/to/export.zip --limit 50 --out ~/Documents/step-records.json

Troubleshooting

  • no such file or directory: Ensure the export path points to either apple_health_export/export.xml or the zipped export produced by Apple Health.
  • zip ... does not contain export.xml: Re-export from the Health app—sometimes partial exports omit the XML if interrupted.
  • Missing dependencies: Install xmlstarlet, jq, and unzip via Homebrew (brew install xmlstarlet jq unzip).
安全使用建议
This skill appears to do what it says: parse Apple Health export XML locally. Before installing or running it: 1) Ensure your environment has xmlstarlet, jq, and unzip installed (the registry metadata should be updated to list these). 2) Only run the script on exports you control; Health exports contain PHI/PII—do not upload the zip or paste raw XML/derived records to cloud services without consent. 3) When using --out, choose a safe path (the script creates the file with 600 perms, but avoid shared folders or symlink targets). 4) Review the bundled health-data.sh yourself (it is short and readable) and test with a non-sensitive sample export first. If you need the skill to run autonomously, consider the operational risk that it will process PHI whenever invoked and ensure appropriate policy/consent is in place.
功能分析
Type: OpenClaw Skill Name: health-data Version: 1.0.0 The health-data skill is a utility for local analysis of Apple Health exports using xmlstarlet and jq. It includes robust privacy measures, such as explicit PHI/PII warnings, secure file creation (mode 600) in health-data.sh, and automatic cleanup of temporary files via shell traps. No network activity, data exfiltration, or malicious intent was detected in the code or instructions.
能力评估
Purpose & Capability
The name/description and the included health-data.sh script are coherent: the script parses Apple Health export XML and summarizes or emits JSON. One small mismatch: the registry lists no required binaries, but both SKILL.md and the script clearly require xmlstarlet, jq, and unzip. This is an administrative/metadata discrepancy (not evidence of malicious behavior) and should be corrected so installers know to provide these tools.
Instruction Scope
SKILL.md instructs the agent to operate locally on an export.zip or exported folder, warns about PHI/PII, and explicitly tells the user not to upload or publish raw exports. The script only reads the specified export path, extracts export.xml to a temporary file (via mktemp + unzip -p), processes it with xmlstarlet/jq, and cleans up on EXIT. It does not read other system files, environment variables, or perform network calls. Minor operational note: writing an --out file will truncate/create the target; users should avoid pointing --out at shared or sensitive locations without verifying ownership/permissions.
Install Mechanism
There is no install spec (instruction-only + a bundled shell script). Nothing is downloaded or installed by the skill itself, which keeps install risk low. The only runtime requirement is that the local environment has xmlstarlet, jq, and unzip available.
Credentials
The skill requests no environment variables, credentials, or config paths. The script only accesses the user-supplied export path and an optional output path; this is proportional to its purpose. No secrets or unrelated credentials are requested.
Persistence & Privilege
The skill is not marked always:true and does not modify persistent agent configuration or other skills. Temporary files are cleaned up via a trap on EXIT. The only possible persistence is an explicit --out file the user asks the script to create (the script intentionally enforces 600 permissions).
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install health-data
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /health-data 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: Apple Health export parsing, PHI safeguards, secure output mode
元数据
Slug health-data
版本 1.0.0
许可证
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Health Data 是什么?

Analyze Apple Health exports (export.zip or the exported folder) using xmlstarlet/jq to summarize activity, steps, sleep, and source counts. Trigger this ski... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 285 次。

如何安装 Health Data?

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

Health Data 是免费的吗?

是的,Health Data 完全免费(开源免费),可自由下载、安装和使用。

Health Data 支持哪些平台?

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

谁开发了 Health Data?

由 pp(@ppopen)开发并维护,当前版本 v1.0.0。

💬 留言讨论