← 返回 Skills 市场
49
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install laosi-health
功能描述
健康追踪技能 - 追踪饮水、睡眠、步数等健康数据,JSON存储。
使用说明 (SKILL.md)
Health Tracker - 健康追踪
激活词: 健康追踪 / 记录饮水 / 睡眠追踪
功能
- 饮水记录
- 睡眠追踪
- 步数记录
- 体重追踪
- 数据统计
数据存储
{
"water": [
{"time": "2026-04-28T08:00:00", "amount": 250}
],
"sleep": [
{"date": "2026-04-27", "start": "23:00", "end": "07:00", "hours": 8}
],
"steps": [
{"date": "2026-04-28", "count": 8000}
]
}
Python实现
import json
from datetime import datetime
from pathlib import Path
class HealthTracker:
def __init__(self, data_file: str = "health_data.json"):
self.data_file = data_file
self.data = self._load()
def _load(self) -> dict:
if Path(self.data_file).exists():
with open(self.data_file, 'r') as f:
return json.load(f)
return {'water': [], 'sleep': [], 'steps': []}
def _save(self):
with open(self.data_file, 'w') as f:
json.dump(self.data, f, indent=2)
def log_water(self, amount: int):
self.data['water'].append({
'time': datetime.now().isoformat(),
'amount': amount
})
self._save()
def log_sleep(self, start: str, end: str):
hours = self._calc_hours(start, end)
self.data['sleep'].append({
'date': datetime.now().date().isoformat(),
'start': start,
'end': end,
'hours': hours
})
self._save()
def log_steps(self, count: int):
today = datetime.now().date().isoformat()
# ���新今日数据
for entry in self.data['steps']:
if entry['date'] == today:
entry['count'] = count
break
else:
self.data['steps'].append({'date': today, 'count': count})
self._save()
def get_stats(self) -> dict:
# 今日饮水
today = datetime.now().date().isoformat()
water_today = sum(e['amount'] for e in self.data['water']
if e['time'].startswith(today))
# 平均睡眠
if self.data['sleep']:
avg_sleep = sum(e['hours'] for e in self.data['sleep']) / len(self.data['sleep'])
else:
avg_sleep = 0
return {
'water_today': water_today,
'water_goal': 2000,
'avg_sleep': avg_sleep,
'steps_today': self._get_steps_today(),
}
def _calc_hours(self, start: str, end: str) -> float:
start_h, start_m = map(int, start.split(':'))
end_h, end_m = map(int, end.split(':'))
hours = end_h - start_h
if end_h \x3C start_h:
hours += 24
return hours - start_m/60 + end_m/60
def _get_steps_today(self) -> int:
today = datetime.now().date().isoformat()
for entry in self.data['steps']:
if entry['date'] == today:
return entry['count']
return 0
使用命令
tracker = HealthTracker()
# 记录饮水
tracker.log_water(250) # 250ml
# 记录睡眠
tracker.log_sleep("23:00", "07:00")
# 记录步数
tracker.log_steps(8000)
# 获取统计
stats = tracker.get_stats()
print(f"今日饮水: {stats['water_today']}ml / {stats['water_goal']}ml")
print(f"平均睡眠: {stats['avg_sleep']:.1f}小时")
输出格式
## 健康数据
### 今日
- 饮水: 1500ml / 2000ml (75%)
- 步数: 8000步
- 睡眠: 7.5小时 (平均)
### 周报
- 平均饮水: 1800ml/天
- 平均睡眠: 7.2小时/天
- 总步数: 56,000步
安全使用建议
This skill appears to be a small, local health tracker that saves data to a JSON file (health_data.json) in the agent's working directory. It does not ask for credentials or perform network I/O. Consider where the agent will run: if the agent runs on a shared or cloud-hosted environment, the JSON file will be stored there and could contain personal health information, so you may want to restrict file permissions, move storage to a location you control, or add encryption if necessary. If you need remote sync or backups, add explicit, trusted integrations rather than relying on this simple local storage.
功能分析
Type: OpenClaw Skill
Name: laosi-health
Version: 1.0.0
The health-tracker skill bundle is a straightforward utility for logging and retrieving personal health data (water, sleep, steps) stored in a local JSON file. The Python implementation in SKILL.md is clean, lacks any network or shell execution capabilities, and strictly adheres to its stated purpose without any indicators of malicious intent or prompt injection.
能力评估
Purpose & Capability
Name and description (track water, sleep, steps, stats) match the provided Python implementation and the declared JSON storage; no unrelated capabilities or external services are requested.
Instruction Scope
SKILL.md contains only local operations (create/read/write a local health_data.json and compute simple stats). It does not instruct reading unrelated system files, accessing environment variables, or sending data externally.
Install Mechanism
Instruction-only skill with no install spec and no code files executed by the platform. The provided example Python code is simple and local; there are no download URLs or package installs.
Credentials
The skill declares no environment variables, credentials, or config paths. The storage is a single local file (default health_data.json), which is appropriate for the stated functionality.
Persistence & Privilege
The skill is not forced-always, does not request elevated privileges, and does not modify other skills or system settings. It only writes its own data file in the current working directory.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install laosi-health - 安装完成后,直接呼叫该 Skill 的名称或使用
/laosi-health触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
追踪饮水、睡眠、步数等健康数据
元数据
常见问题
健康追踪 是什么?
健康追踪技能 - 追踪饮水、睡眠、步数等健康数据,JSON存储。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 49 次。
如何安装 健康追踪?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install laosi-health」即可一键安装,无需额外配置。
健康追踪 是免费的吗?
是的,健康追踪 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
健康追踪 支持哪些平台?
健康追踪 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 健康追踪?
由 534422530(@534422530)开发并维护,当前版本 v1.0.0。
推荐 Skills