闲社服务运行正常AI智能体自动化平台
h

健康追踪

技能标识:healthcheck

Track water and sleep with JSON file storage

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 1.0.0
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

健康追踪

健康追踪器

使用JSON文件简单追踪饮水量和睡眠情况。

数据格式

文件:{baseDir}/health-data.json

json
{
water: [{time: ISO8601, cups: 2}],
sleep: [{time: ISO8601, action: sleep|wake}]
}

添加饮水记录

当用户说喝了X杯或喝水X杯时:

bash
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(已记录:+CUPS+杯)

将CUPS替换为用户输入的数字。

添加睡眠记录

当用户说睡觉时:

bash
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(已记录:睡觉)

添加醒来记录

当用户说醒了或起床了时:

bash
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(已睡:+h+小时)}else{console.log(已记录:醒来)}

查看统计

当用户说统计或查看统计时:

bash
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(饮水:,d.water.length,条记录);console.log(睡眠:,d.sleep.length,条记录);const today=d.water.filter(w=>new Date(w.time).toDateString()===new Date().toDateString());console.log(今日:,today.reduce((s,w)=>s+w.cups,0),杯)

更新记录

更新最后一条饮水记录:

bash
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(已更新)

删除记录

删除最后一条饮水记录:

bash
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(已删除)

备注

  • - 仅使用Node.js内置模块
  • 文件缺失时会自动创建
  • 所有时间戳采用ISO8601格式

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 healthcheck-rose-1776012975 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 healthcheck-rose-1776012975 技能

通过命令行安装

skillhub install healthcheck-rose-1776012975

下载

⬇ 下载 healthcheck v1.0.0(免费)

文件大小: 1.56 KB | 发布时间: 2026-4-13 10:32

v1.0.0 最新 2026-4-13 10:32
- Initial release of health tracker skill using JSON file storage
- Track water intake and sleep/wake times via user commands
- Supports adding, updating, and deleting water and sleep records
- Simple statistics view: totals and today’s water intake
- Data stored in `{baseDir}/health-data.json` with ISO8601 timestamps
- Node.js built-in modules only; file is auto-created if missing
返回顶部