{
  "schemaVersion": "1.0",
  "item": {
    "slug": "healthsync",
    "name": "healthsync",
    "source": "tencent",
    "type": "skill",
    "category": "数据分析",
    "sourceUrl": "https://clawhub.ai/BRO3886/healthsync",
    "canonicalUrl": "https://clawhub.ai/BRO3886/healthsync",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/healthsync",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=healthsync",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "references/schema.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/healthsync"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/healthsync",
    "agentPageUrl": "https://openagent3.xyz/skills/healthsync/agent",
    "manifestUrl": "https://openagent3.xyz/skills/healthsync/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/healthsync/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Installing healthsync",
        "body": "# macOS and Linux (recommended)\ncurl -fsSL https://healthsync.sidv.dev/install | bash\n\n# Or via Go\ngo install github.com/BRO3886/healthsync@latest\n\nAfter installing the binary, parse your Apple Health export:\n\n# Export from Health app → profile picture → Export All Health Data\nhealthsync parse ~/Downloads/export.zip\n\nInstall this skill into your agent:\n\n# Claude Code or Codex\nhealthsync skills install\n\n# OpenClaw\nhealthsync skills install --agent openclaw\n\nQuery Apple Health export data stored in a local SQLite database. This skill is read-only — never INSERT, UPDATE, DELETE, or DROP anything."
      },
      {
        "title": "Important Constraints",
        "body": "READ ONLY — You must NEVER write to the database. No INSERT, UPDATE, DELETE, DROP, ALTER, or any write operations.\nTwo query methods: CLI (healthsync query) or direct SQLite (sqlite3 ~/.healthsync/healthsync.db)\nPrefer CLI for simple queries. Use direct SQLite for complex aggregations, joins, or custom SQL."
      },
      {
        "title": "Database Location",
        "body": "Default: ~/.healthsync/healthsync.db"
      },
      {
        "title": "Quick Start",
        "body": "# Recent heart rate readings\nhealthsync query heart-rate --limit 10\n\n# Steps in a date range\nhealthsync query steps --from 2024-01-01 --to 2024-06-30 --limit 100\n\n# Deduplicated daily step totals\nhealthsync query steps --total --from 2024-01-01\n\n# Deduplicated daily active energy totals\nhealthsync query active-energy --total --from 2024-01-01\n\n# Workouts as JSON\nhealthsync query workouts --format json --limit 20\n\n# Sleep data as CSV\nhealthsync query sleep --format csv --limit 50\n\n# Resting heart rate trend\nhealthsync query resting-heart-rate --limit 30\n\n# HRV readings\nhealthsync query hrv --limit 30\n\n# Blood pressure\nhealthsync query blood-pressure --limit 20\n\n# Body weight trend\nhealthsync query body-mass --limit 30\n\n# Direct SQLite for aggregations\nsqlite3 ~/.healthsync/healthsync.db \"SELECT date(start_date) as day, SUM(value) as total_steps FROM steps GROUP BY day ORDER BY day DESC LIMIT 7\"\n\n# Average resting heart rate per week\nsqlite3 ~/.healthsync/healthsync.db \"SELECT strftime('%Y-W%W', start_date) as week, ROUND(AVG(value),1) as avg_rhr FROM resting_heart_rate GROUP BY week ORDER BY week DESC LIMIT 12\""
      },
      {
        "title": "healthsync query <table>",
        "body": "FlagDescriptionDefault--fromFilter records from this date (inclusive)—--toFilter records to this date (inclusive)—--limitMaximum records to return50--formatOutput format: table, json, csvtable--totalDeduplicated daily totals (steps, active-energy, basal-energy only)false--dbOverride database path~/.healthsync/healthsync.db"
      },
      {
        "title": "Available Tables",
        "body": "Cardiac\n\nCLI NameDB TableNotesheart-rateheart_rateBPM; high-frequencyresting-heart-rateresting_heart_rateDaily RHRhrvhrvHRV SDNN (ms); nightlyheart-rate-recoveryheart_rate_recoveryPost-exercise HR recoveryrespiratory-raterespiratory_rateBreaths/minblood-pressureblood_pressurePaired systolic + diastolic (mmHg)\n\nActivity / Energy\n\nCLI NameDB TableNotesstepsstepsSupports --totalactive-energyactive_energykcal; supports --totalbasal-energybasal_energykcal; supports --totalexercise-timeexercise_timeMinutesstand-timestand_timeMinutesflights-climbedflights_climbedCountdistance-walking-runningdistance_walking_runningkm/midistance-cyclingdistance_cyclingkm/mi\n\nBody\n\nCLI NameDB TableNotesbody-massbody_masskg/lbbmibody_mass_indexheightheightm/ft\n\nMobility / Walking\n\nCLI NameDB TableNoteswalking-speedwalking_speedm/swalking-step-lengthwalking_step_lengthmwalking-asymmetrywalking_asymmetry%walking-double-supportwalking_double_support%walking-steadinesswalking_steadinessScorestair-ascent-speedstair_ascent_speedft/sstair-descent-speedstair_descent_speedft/ssix-minute-walksix_minute_walkm\n\nRunning\n\nCLI NameDB TableNotesrunning-speedrunning_speedm/srunning-powerrunning_powerWrunning-stride-lengthrunning_stride_lengthmrunning-ground-contact-timerunning_ground_contact_timemsrunning-vertical-oscillationrunning_vertical_oscillationcm\n\nOther\n\nCLI NameDB TableNotesspo2spo20-1 fraction (0.98 = 98%)vo2maxvo2_maxmL/min·kgsleepsleepSleep stages (category, no unit)workoutsworkoutsduration, distance, energywrist-temperaturewrist_temperature°C deviationtime-in-daylighttime_in_daylightMinutesdietary-waterdietary_watermL/Lphysical-effortphysical_effortMET scorewalking-heart-ratewalking_heart_rateBPM while walkingmindful-sessionsmindful_sessionsCategory; no unit columnstand-hoursstand_hoursCategory; no unit column"
      },
      {
        "title": "healthsync parse <file>",
        "body": "Parse an Apple Health export into the database. (Informational — do not run unless the user asks.)\n\nFlagDescriptionDefault-vVerbose logging with progress ratefalse--dbOverride database path~/.healthsync/healthsync.db"
      },
      {
        "title": "healthsync server",
        "body": "Start HTTP server for receiving uploads. (Informational — do not start unless the user asks.)\n\nEndpoints:\n\nPOST /api/upload — Upload .zip or .xml (multipart form, field: file). Returns 202, parses async.\nGET /api/upload/status — Poll parse progress.\nGET /api/health/{table}?from=&to=&limit= — Query data as JSON."
      },
      {
        "title": "Standard quantity tables",
        "body": "Schema: id, source_name, start_date, end_date, value REAL, unit TEXT, created_at\n\nApplies to all tables except blood_pressure, sleep, mindful_sessions, stand_hours, and workouts.\n\nCREATE TABLE resting_heart_rate (\n    id          INTEGER PRIMARY KEY AUTOINCREMENT,\n    source_name TEXT NOT NULL,\n    start_date  TEXT NOT NULL,\n    end_date    TEXT NOT NULL,\n    value       REAL NOT NULL,\n    unit        TEXT NOT NULL,\n    created_at  TEXT DEFAULT CURRENT_TIMESTAMP,\n    UNIQUE(source_name, start_date, end_date, value)\n);"
      },
      {
        "title": "blood_pressure (special — paired systolic + diastolic)",
        "body": "CREATE TABLE blood_pressure (\n    id          INTEGER PRIMARY KEY AUTOINCREMENT,\n    source_name TEXT NOT NULL,\n    start_date  TEXT NOT NULL,\n    end_date    TEXT NOT NULL,\n    systolic    REAL NOT NULL,   -- mmHg\n    diastolic   REAL NOT NULL,   -- mmHg\n    unit        TEXT NOT NULL,   -- \"mmHg\"\n    created_at  TEXT DEFAULT CURRENT_TIMESTAMP,\n    UNIQUE(source_name, start_date, end_date, systolic, diastolic)\n);"
      },
      {
        "title": "Category tables — no unit column",
        "body": "Applies to: sleep, mindful_sessions, stand_hours\n\nCREATE TABLE sleep (\n    id          INTEGER PRIMARY KEY AUTOINCREMENT,\n    source_name TEXT NOT NULL,\n    start_date  TEXT NOT NULL,\n    end_date    TEXT NOT NULL,\n    value       TEXT NOT NULL,   -- e.g. HKCategoryValueSleepAnalysisAsleepCore\n    created_at  TEXT DEFAULT CURRENT_TIMESTAMP,\n    UNIQUE(source_name, start_date, end_date, value)\n);"
      },
      {
        "title": "workouts",
        "body": "CREATE TABLE workouts (\n    id                       INTEGER PRIMARY KEY AUTOINCREMENT,\n    activity_type            TEXT NOT NULL,\n    source_name              TEXT NOT NULL,\n    start_date               TEXT NOT NULL,\n    end_date                 TEXT NOT NULL,\n    duration                 REAL,\n    duration_unit            TEXT,\n    total_distance           REAL,\n    total_distance_unit      TEXT,\n    total_energy_burned      REAL,\n    total_energy_burned_unit TEXT,\n    created_at               TEXT DEFAULT CURRENT_TIMESTAMP,\n    UNIQUE(activity_type, start_date, end_date, source_name)\n);"
      },
      {
        "title": "Date Format",
        "body": "All dates stored as text: 2024-01-15 08:30:00 +0530. Filter with date prefix — 2024-01-01 works via SQLite string comparison."
      },
      {
        "title": "Sleep Stage Values",
        "body": "ValueMeaningHKCategoryValueSleepAnalysisInBedIn bedHKCategoryValueSleepAnalysisAsleepCoreCore sleepHKCategoryValueSleepAnalysisAsleepDeepDeep sleepHKCategoryValueSleepAnalysisAsleepREMREM sleepHKCategoryValueSleepAnalysisAwakeAwakeHKCategoryValueSleepAnalysisAsleepUnspecifiedUnspecified"
      },
      {
        "title": "Daily step totals (deduped)",
        "body": "healthsync query steps --total --from 2024-01-01"
      },
      {
        "title": "Daily active energy totals (deduped)",
        "body": "healthsync query active-energy --total --from 2024-01-01"
      },
      {
        "title": "Average resting heart rate per week",
        "body": "SELECT strftime('%Y-W%W', start_date) as week,\n  ROUND(AVG(value), 1) as avg_rhr\nFROM resting_heart_rate\nGROUP BY week ORDER BY week DESC LIMIT 12;"
      },
      {
        "title": "HRV trend",
        "body": "SELECT date(start_date) as day, ROUND(AVG(value), 1) as hrv_ms\nFROM hrv\nGROUP BY day ORDER BY day DESC LIMIT 30;"
      },
      {
        "title": "Blood pressure history",
        "body": "SELECT date(start_date) as day,\n  ROUND(AVG(systolic), 1) as avg_sys,\n  ROUND(AVG(diastolic), 1) as avg_dia\nFROM blood_pressure\nGROUP BY day ORDER BY day DESC LIMIT 30;"
      },
      {
        "title": "Body weight trend",
        "body": "SELECT date(start_date) as day, value as kg\nFROM body_mass\nORDER BY day DESC LIMIT 30;"
      },
      {
        "title": "Sleep duration per night",
        "body": "SELECT date(start_date) as night,\n  ROUND(SUM((julianday(end_date) - julianday(start_date)) * 24), 1) as hours\nFROM sleep\nWHERE value LIKE '%Asleep%'\nGROUP BY night ORDER BY night DESC LIMIT 14;"
      },
      {
        "title": "Average heart rate per day",
        "body": "SELECT date(start_date) as day,\n  ROUND(AVG(value), 1) as avg_hr,\n  MIN(value) as min_hr,\n  MAX(value) as max_hr\nFROM heart_rate\nGROUP BY day ORDER BY day DESC LIMIT 30;"
      },
      {
        "title": "Workout summary",
        "body": "SELECT activity_type, COUNT(*) as count,\n  ROUND(AVG(duration), 1) as avg_min,\n  ROUND(SUM(total_energy_burned)) as total_kcal\nFROM workouts\nGROUP BY activity_type ORDER BY count DESC;"
      },
      {
        "title": "Weekly VO2 Max trend",
        "body": "SELECT strftime('%Y-W%W', start_date) as week,\n  ROUND(AVG(value), 2) as avg_vo2\nFROM vo2_max\nGROUP BY week ORDER BY week DESC LIMIT 12;"
      },
      {
        "title": "Mindfulness minutes per week",
        "body": "SELECT strftime('%Y-W%W', start_date) as week,\n  ROUND(SUM((julianday(end_date) - julianday(start_date)) * 1440), 0) as minutes\nFROM mindful_sessions\nGROUP BY week ORDER BY week DESC LIMIT 12;"
      },
      {
        "title": "Limitations",
        "body": "Read-only — This skill must never write to the database\nNo real-time data — Data is only as fresh as the last healthsync parse run\nDate filtering is string-based — Timezone offsets are part of the stored date string\nSpO2 values are fractions — 0.98 means 98%, not 98\nBlood pressure is paired — systolic and diastolic are stored together in one row per measurement\nCategory tables have no unit column — sleep, mindful_sessions, stand_hours store text values, not numeric"
      }
    ],
    "body": "healthsync — Apple Health Data Query Skill\nInstalling healthsync\n# macOS and Linux (recommended)\ncurl -fsSL https://healthsync.sidv.dev/install | bash\n\n# Or via Go\ngo install github.com/BRO3886/healthsync@latest\n\n\nAfter installing the binary, parse your Apple Health export:\n\n# Export from Health app → profile picture → Export All Health Data\nhealthsync parse ~/Downloads/export.zip\n\n\nInstall this skill into your agent:\n\n# Claude Code or Codex\nhealthsync skills install\n\n# OpenClaw\nhealthsync skills install --agent openclaw\n\n\nQuery Apple Health export data stored in a local SQLite database. This skill is read-only — never INSERT, UPDATE, DELETE, or DROP anything.\n\nImportant Constraints\nREAD ONLY — You must NEVER write to the database. No INSERT, UPDATE, DELETE, DROP, ALTER, or any write operations.\nTwo query methods: CLI (healthsync query) or direct SQLite (sqlite3 ~/.healthsync/healthsync.db)\nPrefer CLI for simple queries. Use direct SQLite for complex aggregations, joins, or custom SQL.\nDatabase Location\n\nDefault: ~/.healthsync/healthsync.db\n\nQuick Start\n# Recent heart rate readings\nhealthsync query heart-rate --limit 10\n\n# Steps in a date range\nhealthsync query steps --from 2024-01-01 --to 2024-06-30 --limit 100\n\n# Deduplicated daily step totals\nhealthsync query steps --total --from 2024-01-01\n\n# Deduplicated daily active energy totals\nhealthsync query active-energy --total --from 2024-01-01\n\n# Workouts as JSON\nhealthsync query workouts --format json --limit 20\n\n# Sleep data as CSV\nhealthsync query sleep --format csv --limit 50\n\n# Resting heart rate trend\nhealthsync query resting-heart-rate --limit 30\n\n# HRV readings\nhealthsync query hrv --limit 30\n\n# Blood pressure\nhealthsync query blood-pressure --limit 20\n\n# Body weight trend\nhealthsync query body-mass --limit 30\n\n# Direct SQLite for aggregations\nsqlite3 ~/.healthsync/healthsync.db \"SELECT date(start_date) as day, SUM(value) as total_steps FROM steps GROUP BY day ORDER BY day DESC LIMIT 7\"\n\n# Average resting heart rate per week\nsqlite3 ~/.healthsync/healthsync.db \"SELECT strftime('%Y-W%W', start_date) as week, ROUND(AVG(value),1) as avg_rhr FROM resting_heart_rate GROUP BY week ORDER BY week DESC LIMIT 12\"\n\nCLI Reference\nhealthsync query <table>\nFlag\tDescription\tDefault\n--from\tFilter records from this date (inclusive)\t—\n--to\tFilter records to this date (inclusive)\t—\n--limit\tMaximum records to return\t50\n--format\tOutput format: table, json, csv\ttable\n--total\tDeduplicated daily totals (steps, active-energy, basal-energy only)\tfalse\n--db\tOverride database path\t~/.healthsync/healthsync.db\nAvailable Tables\n\nCardiac\n\nCLI Name\tDB Table\tNotes\nheart-rate\theart_rate\tBPM; high-frequency\nresting-heart-rate\tresting_heart_rate\tDaily RHR\nhrv\thrv\tHRV SDNN (ms); nightly\nheart-rate-recovery\theart_rate_recovery\tPost-exercise HR recovery\nrespiratory-rate\trespiratory_rate\tBreaths/min\nblood-pressure\tblood_pressure\tPaired systolic + diastolic (mmHg)\n\nActivity / Energy\n\nCLI Name\tDB Table\tNotes\nsteps\tsteps\tSupports --total\nactive-energy\tactive_energy\tkcal; supports --total\nbasal-energy\tbasal_energy\tkcal; supports --total\nexercise-time\texercise_time\tMinutes\nstand-time\tstand_time\tMinutes\nflights-climbed\tflights_climbed\tCount\ndistance-walking-running\tdistance_walking_running\tkm/mi\ndistance-cycling\tdistance_cycling\tkm/mi\n\nBody\n\nCLI Name\tDB Table\tNotes\nbody-mass\tbody_mass\tkg/lb\nbmi\tbody_mass_index\t\nheight\theight\tm/ft\n\nMobility / Walking\n\nCLI Name\tDB Table\tNotes\nwalking-speed\twalking_speed\tm/s\nwalking-step-length\twalking_step_length\tm\nwalking-asymmetry\twalking_asymmetry\t%\nwalking-double-support\twalking_double_support\t%\nwalking-steadiness\twalking_steadiness\tScore\nstair-ascent-speed\tstair_ascent_speed\tft/s\nstair-descent-speed\tstair_descent_speed\tft/s\nsix-minute-walk\tsix_minute_walk\tm\n\nRunning\n\nCLI Name\tDB Table\tNotes\nrunning-speed\trunning_speed\tm/s\nrunning-power\trunning_power\tW\nrunning-stride-length\trunning_stride_length\tm\nrunning-ground-contact-time\trunning_ground_contact_time\tms\nrunning-vertical-oscillation\trunning_vertical_oscillation\tcm\n\nOther\n\nCLI Name\tDB Table\tNotes\nspo2\tspo2\t0-1 fraction (0.98 = 98%)\nvo2max\tvo2_max\tmL/min·kg\nsleep\tsleep\tSleep stages (category, no unit)\nworkouts\tworkouts\tduration, distance, energy\nwrist-temperature\twrist_temperature\t°C deviation\ntime-in-daylight\ttime_in_daylight\tMinutes\ndietary-water\tdietary_water\tmL/L\nphysical-effort\tphysical_effort\tMET score\nwalking-heart-rate\twalking_heart_rate\tBPM while walking\nmindful-sessions\tmindful_sessions\tCategory; no unit column\nstand-hours\tstand_hours\tCategory; no unit column\nhealthsync parse <file>\n\nParse an Apple Health export into the database. (Informational — do not run unless the user asks.)\n\nFlag\tDescription\tDefault\n-v\tVerbose logging with progress rate\tfalse\n--db\tOverride database path\t~/.healthsync/healthsync.db\nhealthsync server\n\nStart HTTP server for receiving uploads. (Informational — do not start unless the user asks.)\n\nEndpoints:\n\nPOST /api/upload — Upload .zip or .xml (multipart form, field: file). Returns 202, parses async.\nGET /api/upload/status — Poll parse progress.\nGET /api/health/{table}?from=&to=&limit= — Query data as JSON.\nDatabase Schema\nStandard quantity tables\n\nSchema: id, source_name, start_date, end_date, value REAL, unit TEXT, created_at\n\nApplies to all tables except blood_pressure, sleep, mindful_sessions, stand_hours, and workouts.\n\nCREATE TABLE resting_heart_rate (\n    id          INTEGER PRIMARY KEY AUTOINCREMENT,\n    source_name TEXT NOT NULL,\n    start_date  TEXT NOT NULL,\n    end_date    TEXT NOT NULL,\n    value       REAL NOT NULL,\n    unit        TEXT NOT NULL,\n    created_at  TEXT DEFAULT CURRENT_TIMESTAMP,\n    UNIQUE(source_name, start_date, end_date, value)\n);\n\nblood_pressure (special — paired systolic + diastolic)\nCREATE TABLE blood_pressure (\n    id          INTEGER PRIMARY KEY AUTOINCREMENT,\n    source_name TEXT NOT NULL,\n    start_date  TEXT NOT NULL,\n    end_date    TEXT NOT NULL,\n    systolic    REAL NOT NULL,   -- mmHg\n    diastolic   REAL NOT NULL,   -- mmHg\n    unit        TEXT NOT NULL,   -- \"mmHg\"\n    created_at  TEXT DEFAULT CURRENT_TIMESTAMP,\n    UNIQUE(source_name, start_date, end_date, systolic, diastolic)\n);\n\nCategory tables — no unit column\n\nApplies to: sleep, mindful_sessions, stand_hours\n\nCREATE TABLE sleep (\n    id          INTEGER PRIMARY KEY AUTOINCREMENT,\n    source_name TEXT NOT NULL,\n    start_date  TEXT NOT NULL,\n    end_date    TEXT NOT NULL,\n    value       TEXT NOT NULL,   -- e.g. HKCategoryValueSleepAnalysisAsleepCore\n    created_at  TEXT DEFAULT CURRENT_TIMESTAMP,\n    UNIQUE(source_name, start_date, end_date, value)\n);\n\nworkouts\nCREATE TABLE workouts (\n    id                       INTEGER PRIMARY KEY AUTOINCREMENT,\n    activity_type            TEXT NOT NULL,\n    source_name              TEXT NOT NULL,\n    start_date               TEXT NOT NULL,\n    end_date                 TEXT NOT NULL,\n    duration                 REAL,\n    duration_unit            TEXT,\n    total_distance           REAL,\n    total_distance_unit      TEXT,\n    total_energy_burned      REAL,\n    total_energy_burned_unit TEXT,\n    created_at               TEXT DEFAULT CURRENT_TIMESTAMP,\n    UNIQUE(activity_type, start_date, end_date, source_name)\n);\n\nDate Format\n\nAll dates stored as text: 2024-01-15 08:30:00 +0530. Filter with date prefix — 2024-01-01 works via SQLite string comparison.\n\nSleep Stage Values\nValue\tMeaning\nHKCategoryValueSleepAnalysisInBed\tIn bed\nHKCategoryValueSleepAnalysisAsleepCore\tCore sleep\nHKCategoryValueSleepAnalysisAsleepDeep\tDeep sleep\nHKCategoryValueSleepAnalysisAsleepREM\tREM sleep\nHKCategoryValueSleepAnalysisAwake\tAwake\nHKCategoryValueSleepAnalysisAsleepUnspecified\tUnspecified\nCommon Query Patterns\nDaily step totals (deduped)\nhealthsync query steps --total --from 2024-01-01\n\nDaily active energy totals (deduped)\nhealthsync query active-energy --total --from 2024-01-01\n\nAverage resting heart rate per week\nSELECT strftime('%Y-W%W', start_date) as week,\n  ROUND(AVG(value), 1) as avg_rhr\nFROM resting_heart_rate\nGROUP BY week ORDER BY week DESC LIMIT 12;\n\nHRV trend\nSELECT date(start_date) as day, ROUND(AVG(value), 1) as hrv_ms\nFROM hrv\nGROUP BY day ORDER BY day DESC LIMIT 30;\n\nBlood pressure history\nSELECT date(start_date) as day,\n  ROUND(AVG(systolic), 1) as avg_sys,\n  ROUND(AVG(diastolic), 1) as avg_dia\nFROM blood_pressure\nGROUP BY day ORDER BY day DESC LIMIT 30;\n\nBody weight trend\nSELECT date(start_date) as day, value as kg\nFROM body_mass\nORDER BY day DESC LIMIT 30;\n\nSleep duration per night\nSELECT date(start_date) as night,\n  ROUND(SUM((julianday(end_date) - julianday(start_date)) * 24), 1) as hours\nFROM sleep\nWHERE value LIKE '%Asleep%'\nGROUP BY night ORDER BY night DESC LIMIT 14;\n\nAverage heart rate per day\nSELECT date(start_date) as day,\n  ROUND(AVG(value), 1) as avg_hr,\n  MIN(value) as min_hr,\n  MAX(value) as max_hr\nFROM heart_rate\nGROUP BY day ORDER BY day DESC LIMIT 30;\n\nWorkout summary\nSELECT activity_type, COUNT(*) as count,\n  ROUND(AVG(duration), 1) as avg_min,\n  ROUND(SUM(total_energy_burned)) as total_kcal\nFROM workouts\nGROUP BY activity_type ORDER BY count DESC;\n\nWeekly VO2 Max trend\nSELECT strftime('%Y-W%W', start_date) as week,\n  ROUND(AVG(value), 2) as avg_vo2\nFROM vo2_max\nGROUP BY week ORDER BY week DESC LIMIT 12;\n\nMindfulness minutes per week\nSELECT strftime('%Y-W%W', start_date) as week,\n  ROUND(SUM((julianday(end_date) - julianday(start_date)) * 1440), 0) as minutes\nFROM mindful_sessions\nGROUP BY week ORDER BY week DESC LIMIT 12;\n\nLimitations\nRead-only — This skill must never write to the database\nNo real-time data — Data is only as fresh as the last healthsync parse run\nDate filtering is string-based — Timezone offsets are part of the stored date string\nSpO2 values are fractions — 0.98 means 98%, not 98\nBlood pressure is paired — systolic and diastolic are stored together in one row per measurement\nCategory tables have no unit column — sleep, mindful_sessions, stand_hours store text values, not numeric"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/BRO3886/healthsync",
    "publisherUrl": "https://clawhub.ai/BRO3886/healthsync",
    "owner": "BRO3886",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/healthsync",
    "downloadUrl": "https://openagent3.xyz/downloads/healthsync",
    "agentUrl": "https://openagent3.xyz/skills/healthsync/agent",
    "manifestUrl": "https://openagent3.xyz/skills/healthsync/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/healthsync/agent.md"
  }
}