Use this skill to analyze Apple Health data already synced into local SQLite by the collector.
scripts/query_health.py to pull fresh JSON data./healthz before troubleshooting missing data.(Optional health check) Verify collector is reachable when user reports stale/missing data:
curl -fsS http://<collector-host>:8443/healthzcurl -fsS https://<collector-host>:8443/healthzQuery the local database via shell (preferred default):
python scripts/query_health.py --window-hours 24 --sleep-nights 7 --types heart_rate,glucose,sleep_stageAdjust parameters to user intent:
--window-hours 1--window-hours 24 --sleep-nights 7--types narrow to requested metrics.Summarize with numbers and timestamps, then give practical next steps.
Always include safety framing: informational only, not medical advice; suggest clinician contact for extreme/persistent readings.
Base your answer on the returned JSON fields:
generated_at, user_id, window_hoursquantity.<metric>[] entries with {ts, value, unit, source, device}sleep[] entries with {start_ts, end_ts, category, source, device}scripts/query_health.py already reads .env.The collector stores real-time BLE heart rate events from Wahoo HR straps (and compatible sensors) in the live_events table. Use this for workout monitoring, recent-activity check-ins, or comparing live readings against resting baseline.
scripts/query_live_hr.py to pull live HR events and per-session summaries.Query recent live HR events (default: last 60 minutes):
python scripts/query_live_hr.py --window-minutes 60Narrow to the last workout or a specific timeframe:
python scripts/query_live_hr.py --window-minutes 120Filter to a specific session (use a session UUID from a previous query):
python scripts/query_live_hr.py --session-id <uuid> --window-minutes 180Filter to a specific device (useful when multiple sensors are paired):
python scripts/query_live_hr.py --device-id <device_id> --window-minutes 60Base your answer on the returned JSON:
summary — aggregate stats for the queried window:
count — total event countlatest_bpm, min_bpm, max_bpm, avg_bpm, median_bpm, stddev_bpmlatest_zone — heart rate zone: resting (<60), normal (60–99), elevated (100–139), high (≥140)sessions[] — per-session breakdown with session_id, event_count, start_ts, end_ts, device_name, avg_bpm, min_bpm, max_bpm
events[] — individual readings with ts, value (BPM), session_id, seq, device_id, source_device_name
avg_bpm, max_bpm, and duration ( start_ts → end_ts of the session).latest_zone to practical advice (e.g., elevated zone during recovery warrants attention).count is 0, the sensor may not be paired or the session may not have started — advise the user to open the Live HR screen on their iPhone.