MyFitnessClaw: AI 营养与宏量元素追踪器 - Openclaw Skills

作者:互联网

2026-03-27

AI教程

什么是 MyFitnessClaw?

MyFitnessClaw 是为 OpenClaw 环境构建的高级营养管理技能。它允许用户使用自然语言记录食物摄入量,智能体随后将其解析为详细的宏量和微量营养素数据。通过利用 Openclaw Skills,该工具弥合了对话式 AI 与结构化健康追踪之间的鸿沟,为监控饮食目标提供实时仪表盘。

下载入口:https://github.com/openclaw/skills/tree/main/skills/serg010101/my-fitness-claw

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install my-fitness-claw

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 my-fitness-claw。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

MyFitnessClaw 应用场景

  • 使用简单的自然语言描述记录日常膳食和零食。
  • 无需手动查找即可追踪维生素 D3、镁和锌等特定微量营养素。
  • 通过原生画布仪表盘可视化每日营养进度。
  • 基于历史数据和设定目标获取个性化的 AI 驱动健康洞察。
MyFitnessClaw 工作原理
  1. 用户在聊天界面描述一餐。
  2. 技能通过参考常用食物数据库估算热量、宏量元素和 10 种必需微量营养素。
  3. 规范数据在 nutrition/daily_macros.json 文件中更新。
  4. 同步离线镜像以确保可通过标准浏览器访问可视化内容。
  5. 调用 OpenClaw Canvas 工具向用户展示视觉仪表盘。
  6. AI 智能体根据目标分析进度并生成健康洞察。

MyFitnessClaw 配置指南

要在您的工作区中部署此技能,请确保已为 Openclaw Skills 启用所需的工具权限。

# 创建目录结构
mkdir -p assets/nutrition/foods
mkdir -p assets/canvas

# 初始化数据文件
echo '[]' > assets/nutrition/daily_macros.json

确保在您的智能体环境中正确配置了画布(canvas)、读取(read)、写入(write)和编辑(edit)工具。

MyFitnessClaw 数据架构与分类体系

资产路径 用途 格式
nutrition/daily_macros.json 所有每日摄入记录和总量的主要存储。 JSON
nutrition/targets.json 定义卡路里、宏量和微量元素的每日目标。 JSON
nutrition/insights.json 存储 AI 生成的健康建议和分析。 JSON
canvas/index.html 营养仪表盘的可视化前端。 HTML
canvas/offline_data.js 用于在没有智能体服务器运行时查看数据的镜像。 JavaScript
name: my-fitness-claw
version: 1.7.0
description: Your personal nutrition sidekick. Log meals in plain natural language, track macros (P/C/F) automatically, and visualize your progress on a beautiful real-time dashboard. Version 1.7 adds automatic micronutrient tracking based on general 32-year-old male recommended daily intakes. Includes AI-driven health insights, common food memory, and daily progress tracking—all controlled via chat.
requires:
  tools: [canvas, read, write, edit]
  paths: [nutrition/, canvas/, memory/]

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.
  • assets/nutrition/targets.json: Daily nutritional goals (calories, protein, carbs, fats, and 10 essential micronutrients).
  • assets/nutrition/insights.json: AI-generated tips based on current progress.
  • assets/nutrition/foods/common.md: A reference list of frequently eaten foods and their macros/micros.
  • assets/canvas/index.html: 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.
  3. 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).
  5. Show Dashboard: Use canvas(action=present, url='skills/my-fitness-claw/assets/canvas/index.html') to show the updated dashboard inside OpenClaw.
  6. 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.
  • assets/canvas/offline_data.js: 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 [].
  2. Sanitize Mirror: Clear canvas/offline_data.js to match the empty state: window.__OFFLINE_DAILY_MACROS = [];.
  3. Check Insights: Clear nutrition/insights.json or reset to template tips.
  4. Remove Personal Notes: Scrub nutrition/targets.json and memory/ of any sensitive info.
  5. Verify Assets: Ensure no private images or documents are in the assets/ folder.