健康追踪助手
通过 JSON 文件记录每日饮水量与睡眠时间,支持添加、查看、更新与删除记录。
它能帮你做什么
先看懂,再决定要不要交给 AI。
一个轻量级的健康追踪 Skill,基于本地 JSON 文件存储数据,无需数据库或外部依赖。用户可通过自然语言指令(如「uống 2 cốc」「đi ngủ」「thức dậy」「thống kê」)记录饮水量和睡眠事件。Skill 使用 Node.js 内置模块完成文件的读取、写入与统计计算,所有时间戳采用 ISO8601 格式,文件不存在时会自动创建。
怎么交给 AI
在线读取优先,本地安装作为备选。
适合能访问网页的 ChatGPT、Agent 或其他 AI。
请访问 https://skills.dhmip.cn/skills/skillhub/healthcheck/SKILL.md,读取并按照该 Skill 完成任务;如当前环境支持本地安装,也可以下载该 Skill。未登录时可使用公共安装文档;登录后可以按不同 AI 分开管理。
请根据 https://skills.dhmip.cn/install/skillhub.md,安装 @skillhub/healthcheck。兼容性与要求
安装或使用前,先确认环境是否匹配。
适用客户端
使用要求
- Node.js 运行环境
- 可读写本地文件系统
- Skill 模板变量 {baseDir} 解析支持
⌘技术详情查看完整 SKILL.md 与原始内容⌄
name: healthcheck
description: Track water and sleep with JSON file storage
version: 1.0.2
tags: health, tracking
Health Tracker
Simple tracking for water intake and sleep using JSON file.
Data Format
File: {baseDir}/health-data.json
{
"water": [{"time": "ISO8601", "cups": 2}],
"sleep": [{"time": "ISO8601", "action": "sleep|wake"}]
}
Add Water Record
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.
Add Sleep Record
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')"
Add Wake Record
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')}"
View Stats
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')"
Update Record
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')"
Delete Record
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')"
Notes
- Uses Node.js built-in modules only
- File auto-created if missing
- All timestamps in ISO8601 format