返回顶部
h

healthcheck

Track water and sleep with JSON file storage

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
82
下载量
0
收藏
概述
安装方式
版本历史

healthcheck

# Health Tracker Simple tracking for water intake and sleep using JSON file. ## Data Format File: `{baseDir}/health-data.json` ```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": ```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('Da ghi: '+CUPS+' coc')" ``` Replace `CUPS` with number from user input. ## Add Sleep Record When user says "đi ngủ": ```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('Da ghi: di ngu')" ``` ## Add Wake Record When user says "thức dậy" or "dậy rồi": ```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('Da ngu: '+h+' gio')}else{console.log('Da ghi: thuc day')}" ``` ## View Stats When user says "thống kê" or "xem thống kê": ```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('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: ```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('Updated')" ``` ## Delete Record To delete last water entry: ```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('Deleted')" ``` ## Notes - Uses Node.js built-in modules only - File auto-created if missing - All timestamps in ISO8601 format

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 healthcheck-local-1776006972 技能

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

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

通过命令行安装

skillhub install healthcheck-local-1776006972

下载 Zip 包

⬇ 下载 healthcheck v1.0.0

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

v1.0.0 最新 2026-4-13 10:32
- Initial release of healthcheck skill for tracking water intake and sleep.
- Stores data in a local JSON file using Node.js only.
- Supports adding, updating, and deleting water records.
- Records sleep and wake events and calculates sleep duration.
- Provides simple statistics on water and sleep records.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部