MyFitnessClaw
This skill manages your nutritional data and provides a visual dashboard for tracking macros and micronutrients using OpenClaw's native tools.
Core Files (Skill Assets)
- -
assets/nutrition/daily_macros.json: The structured log of daily intake. - INLINECODE1 : Daily nutritional goals (calories, protein, carbs, fats, and 10 essential micronutrients).
- INLINECODE2 : AI-generated tips based on current progress.
- INLINECODE3 : A reference list of frequently eaten foods and their macros/micros.
- INLINECODE4 : The visual dashboard for the OpenClaw Canvas.
Workflow: Logging Food
When the user mentions eating something:
- 1. Estimate Macros & Micros: If the user doesn't provide them, estimate:
- Macros: Calories, protein, carbs, fats.
- Micros: Vitamin D3, Magnesium, Potassium, Zinc, Vitamin B6, Vitamin B12, Selenium, Vitamin C, Vitamin A, Vitamin E.
Check
assets/nutrition/foods/common.md first.
- 2. Update Daily Log (Canonical): Update
assets/nutrition/daily_macros.json. Include the micros object for both individual meals and the daily total. - Update Offline Mirror: Update
assets/canvas/offline_data.js with the same data, ensuring micronutrients are included.
- Overwrite the file with:
window.__OFFLINE_DAILY_MACROS = [...]; window.__OFFLINE_TARGETS = {...}; window.__OFFLINE_INSIGHTS = {...};
- This ensures the dashboard works when opened via
file:// (offline/browser-first).
- 4. Update Memory: Log the meal in the agent's current daily memory file (e.g.,
memory/YYYY-MM-DD.md). - Show Dashboard: Use
canvas(action=present, url='skills/my-fitness-claw/assets/canvas/index.html') to show the updated dashboard inside OpenClaw. - Provide Browser Access: After every log, provide the following message:
> 📊
View in your browser:
> -
Quick: Open
skills/my-fitness-claw/assets/canvas/index.html in your browser (uses offline mirror).
> -
Full: Run
python -m http.server 8000 from the workspace root and visit
http://localhost:8000/skills/my-fitness-claw/assets/canvas/index.html.
- 7. Generate Insights: Analyze progress against goals in
assets/nutrition/targets.json and update assets/nutrition/insights.json.
Persistence Rules:
- -
assets/nutrition/*.json: Canonical storage. - INLINECODE19 : Mirror for
file:// viewing only. - Do not modify
assets/canvas/index.html during routine logging.
Publishing Checklist (Public Safety)
Before publishing or sharing this skill:
- 1. Sanitize Data: Clear
nutrition/daily_macros.json by setting it to []. - Sanitize Mirror: Clear
canvas/offline_data.js to match the empty state: window.__OFFLINE_DAILY_MACROS = [];. - Check Insights: Clear
nutrition/insights.json or reset to template tips. - Remove Personal Notes: Scrub
nutrition/targets.json and memory/ of any sensitive info. - Verify Assets: Ensure no private images or documents are in the
assets/ folder.
MyFitnessClaw
该技能管理你的营养数据,并使用OpenClaw原生工具提供用于追踪宏量和微量营养素的视觉仪表盘。
核心文件(技能资产)
- - assets/nutrition/daily_macros.json:每日摄入量的结构化日志。
- assets/nutrition/targets.json:每日营养目标(卡路里、蛋白质、碳水化合物、脂肪以及10种必需微量营养素)。
- assets/nutrition/insights.json:基于当前进度的AI生成建议。
- assets/nutrition/foods/common.md:常见食物及其宏量/微量营养素的参考列表。
- assets/canvas/index.html:OpenClaw Canvas的视觉仪表盘。
工作流程:记录食物
当用户提到吃了某样东西时:
- 1. 估算宏量与微量营养素:如果用户未提供,则进行估算:
- 宏量营养素:卡路里、蛋白质、碳水化合物、脂肪。
- 微量营养素:维生素D3、镁、钾、锌、维生素B6、维生素B12、硒、维生素C、维生素A、维生素E。
首先检查assets/nutrition/foods/common.md。
- 2. 更新每日日志(规范存储):更新assets/nutrition/dailymacros.json。在单餐和每日总计中均包含micros对象。
- 更新离线镜像:使用相同数据更新assets/canvas/offlinedata.js,确保包含微量营养素。
- 用以下内容覆盖文件:window.
OFFLINEDAILYMACROS = [...]; window.OFFLINE
TARGETS = {...}; window.OFFLINEINSIGHTS = {...};
- 这确保仪表盘在通过file://(离线/浏览器优先)打开时能正常工作。
- 4. 更新记忆:将餐食记录到代理的当前每日记忆文件中(例如memory/YYYY-MM-DD.md)。
- 显示仪表盘:使用canvas(action=present, url=skills/my-fitness-claw/assets/canvas/index.html)在OpenClaw内显示更新后的仪表盘。
- 提供浏览器访问:每次记录后,提供以下消息:
> 📊
在浏览器中查看:
> -
快速方式: 在浏览器中打开skills/my-fitness-claw/assets/canvas/index.html(使用离线镜像)。
> -
完整方式: 在工作区根目录运行python -m http.server 8000,然后访问http://localhost:8000/skills/my-fitness-claw/assets/canvas/index.html。
- 7. 生成洞察:对照assets/nutrition/targets.json中的目标分析进度,并更新assets/nutrition/insights.json。
持久化规则:
- - assets/nutrition/*.json:规范存储。
- assets/canvas/offline_data.js:仅用于file://查看的镜像。
- 不要在常规记录过程中修改assets/canvas/index.html。
发布清单(公共安全)
在发布或分享此技能之前:
- 1. 清理数据:将nutrition/dailymacros.json清空,设置为[]。
- 清理镜像:将canvas/offlinedata.js清空以匹配空状态:window.OFFLINEDAILYMACROS = [];。
- 检查洞察:清空nutrition/insights.json或重置为模板建议。
- 移除个人笔记:清除nutrition/targets.json和memory/中的任何敏感信息。
- 验证资产:确保assets/文件夹中没有私人图片或文档。