← 返回
开发者工具

Health Auto Log

Automatically detect and log health data (weight, blood sugar, exercise) to AX3 system. Use when user sends health measurements via WhatsApp or other messagi...
自动检测并记录健康数据(体重、血糖、运动)至AX3系统。当用户通过WhatsApp或其他消息应用发送健康测量数据时使用。
klcintw
开发者工具 clawhub v1.0.0 1 版本 99838.4 Key: 无需
★ 0
Stars
📥 618
下载
💾 12
安装
1
版本
#latest

概述

Health Auto Log

Overview

Automatically detect health metrics from user messages and record them to AX3 Personal system. Supports weight, blood sugar, and exercise time tracking with flexible input formats.

When to Use This Skill

Trigger this skill when user messages contain:

  • Weight measurements (e.g., "體重69.8公斤", "69.8kg", "69.8")
  • Blood sugar readings (e.g., "血糖120", "120 mg/dL")
  • Exercise time (e.g., "跑步機30分", "跑步30")

Quick Start

Use the record_health_data.py script to process any message:

python3 scripts/record_health_data.py "體重69.8公斤"

The script will:

  1. Extract health metrics from the message
  2. Validate the values are within reasonable ranges
  3. Record to AX3 using mcporter
  4. Return confirmation with record IDs

Supported Metrics

1. Weight (體重)

Habit ID: 1

Unit: kg

Range: 40-200 kg

Supported formats:

  • 體重69.8公斤
  • 69.8kg
  • 69.8 (plain number)

2. Blood Sugar (血糖)

Habit ID: 4

Unit: mg/dL

Range: 50-500 mg/dL

Supported formats:

  • 血糖120
  • 120 mg/dL

3. Running Time (跑步機)

Habit ID: 2

Unit: minutes

Supported formats:

  • 跑步機30分
  • 跑步30

Workflow

Automatic Detection Flow

  1. Receive message from WhatsApp or other channel
  2. Run script with message text: python3 scripts/record_health_data.py ""
  3. Extract metrics using regex patterns
  4. Validate values are in reasonable ranges
  5. Record to AX3 via mcporter call to ax3-personal.record_habit
  6. Confirm with user showing what was recorded

Example Usage

# Single metric
python3 scripts/record_health_data.py "體重69.8公斤"
# Output: ✅ 體重 69.8 kg 已記錄

# Multiple metrics in one message
python3 scripts/record_health_data.py "體重69.8公斤 血糖120"
# Output: 
# ✅ 體重 69.8 kg 已記錄
# ✅ 血糖 120 mg/dL 已記錄

Integration Pattern

When a user sends a health-related message:

  1. Call the script with the message text
  2. Parse the JSON output to check if data was detected
  3. If detected, respond with confirmation (e.g., "收到!69.8 kg 已記錄 📝")
  4. If not detected, reply normally without mentioning the skill

Error Handling

The script includes validation:

  • Out of range values are ignored (e.g., weight of 500kg won't be recorded)
  • Invalid formats are silently skipped
  • mcporter failures are captured and returned in the JSON output

Resources

scripts/record_health_data.py

Python script that handles:

  • Pattern matching for various health data formats
  • Value validation and range checking
  • AX3 API calls via mcporter
  • JSON output for programmatic integration

The script can be called directly or integrated into message handling workflows.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 02:45 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,808
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 668 📥 324,236
ai-intelligence

Story Chain Multiverse

klcintw
多元宇宙互動故事接龍系統。根據玩家輸入與當前劇情,續寫下一小段故事。支援科幻、未來、歷史、穿越、系統、仙俠、魔法、奇幻、影視動漫同人、武俠、重生、都市、異能等多題材自由混合。
★ 0 📥 1,008