作者:互联网 时间: 2026-07-30 11:15:01
健康追踪器技能是一个以开发者为中心的工具,旨在 Openclaw Skills 环境中管理个人健康数据。通过利用本地 JSON 存储系统,它允许用户记录饮水量和睡眠时长,无需外部 API 或复杂的数据库。
该技能将自然语言输入转换为结构化的健康数据,通过无缝自动化使维持健康生活方式变得更加容易。它提供了一种私密、自托管的方式来维护健康日志,您的 AI 编程助手可以轻松访问和修改这些日志。
下载入口:https://github.com/openclaw/skills/tree/main/skills/stellarhold170nt/healthcheck
从源直接安装技能的最快方式。
npx clawhub@latest install healthcheck
将技能文件夹复制到以下位置之一
全局模式~/.openclaw/skills/
工作区
<project>/skills/
优先级:工作区 > 本地 > 内置
将此提示词复制到 OpenClaw 即可自动安装。
请帮我使用 Clawhub 安装 healthcheck。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。
此技能需要您的系统安装 Node.js。它利用内置模块,因此无需安装第三方软件包。Openclaw Skills 将管理运行环境。
# 确保 Node.js 可用
node -v
# 技能在首次运行时会自动初始化数据文件
# 文件位置: {baseDir}/health-data.json
该技能维护一个结构化的 JSON 架构,以确保数据的完整性并方便 Openclaw Skills 进行解析。
| 功能 | 数据类型 | 描述 |
|---|---|---|
water |
数组 | 包含 time (ISO8601) 和 cups (数字) 的对象集合。 |
sleep |
数组 | 包含 time (ISO8601) 和 action ('sleep' 或 'wake') 的对象集合。 |
示例架构结构:
{
"water": [{"time": "2023-10-27T10:00:00Z", "cups": 2}],
"sleep": [{"time": "2023-10-27T22:00:00Z", "action": "sleep"}]
}
name: healthcheck
description: Track water and sleep with JSON file storage
version: 1.0.2
tags: health, tracking
Simple tracking for water intake and sleep using JSON file.
File: {baseDir}/health-data.json
{
"water": [{"time": "ISO8601", "cups": 2}],
"sleep": [{"time": "ISO8601", "action": "sleep|wake"}]
}
When user says "u?ng X c?c" or "u?ng n??c X c?c":
node -e "const fs=require('fs');const f='{baseDir}/health-data.json';let d={water:[],sleep:[]};try{d=JSON.parse(fs.readFileSync(f))}catch(e){}d.water.push({time:new Date().toISOString(),cups:CUPS});fs.writeFileSync(f,JSON.stringify(d));console.log('Da ghi: '+CUPS+' coc')"
Replace CUPS with number from user input.
When user says "?i ng?":
node -e "const fs=require('fs');const f='{baseDir}/health-data.json';let d={water:[],sleep:[]};try{d=JSON.parse(fs.readFileSync(f))}catch(e){}d.sleep.push({time:new Date().toISOString(),action:'sleep'});fs.writeFileSync(f,JSON.stringify(d));console.log('Da ghi: di ngu')"
When user says "th?c d?y" or "d?y r?i":
node -e "const fs=require('fs');const f='{baseDir}/health-data.json';let d={water:[],sleep:[]};try{d=JSON.parse(fs.readFileSync(f))}catch(e){}const last=d.sleep.filter(s=>s.action==='sleep').pop();d.sleep.push({time:new Date().toISOString(),action:'wake'});fs.writeFileSync(f,JSON.stringify(d));if(last){const h=((new Date()-new Date(last.time))/3600000).toFixed(1);console.log('Da ngu: '+h+' gio')}else{console.log('Da ghi: thuc day')}"
When user says "th?ng kê" or "xem th?ng kê":
node -e "const fs=require('fs');const f='{baseDir}/health-data.json';let d={water:[],sleep:[]};try{d=JSON.parse(fs.readFileSync(f))}catch(e){}console.log('Water:',d.water.length,'records');console.log('Sleep:',d.sleep.length,'records');const today=d.water.filter(w=>new Date(w.time).toDateString()===new Date().toDateString());console.log('Today:',today.reduce((s,w)=>s+w.cups,0),'cups')"
To update last water entry:
node -e "const fs=require('fs');const f='{baseDir}/health-data.json';let d=JSON.parse(fs.readFileSync(f));d.water[d.water.length-1].cups=NEW_CUPS;fs.writeFileSync(f,JSON.stringify(d));console.log('Updated')"
To delete last water entry:
node -e "const fs=require('fs');const f='{baseDir}/health-data.json';let d=JSON.parse(fs.readFileSync(f));d.water.pop();fs.writeFileSync(f,JSON.stringify(d));console.log('Deleted')"