← Back to Skills Marketplace
rainbowlion0320

nutricoach 营养专家

by RainbowLion0320 · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ Security Clean
127
Downloads
1
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install nutricoach
Description
Personal health data management and intelligent diet recommendation system. Use when users need to: - Record and track body metrics (weight, height, BMI, bod...
README (SKILL.md)

NutriCoach Skill

A comprehensive personal health management system for tracking body metrics, logging meals, analyzing nutrition, managing pantry inventory, and receiving intelligent diet recommendations.

Quick Start

1. Initialize Database

python3 scripts/init_db.py --user \x3Cusername>

Creates isolated SQLite database for the user with all required tables.

2. Set Up User Profile

python3 scripts/user_profile.py --user \x3Cusername> set \
  --name "Robert" \
  --gender male \
  --birth-date 1994-05-15 \
  --height-cm 175 \
  --target-weight 70 \
  --activity-level moderate \
  --goal-type maintain

3. Log Daily Weight

python3 scripts/body_metrics.py --user \x3Cusername> log-weight --weight 72.5

4. Log a Meal

python3 scripts/meal_logger.py --user \x3Cusername> log \
  --meal-type lunch \
  --foods "米饭:150g, 鸡胸肉:100g, 西兰花:100g"

5. Get Diet Recommendation

python3 scripts/diet_recommender.py --user \x3Cusername> recommend --meal-type dinner

6. Launch Web Dashboard

python3 scripts/launch_dashboard.py --user \x3Cusername>

Opens browser at http://127.0.0.1:5000 with visual health data overview.

Core Features

📊 Body Metrics Tracking

  • Weight logging with automatic BMI calculation
  • Body fat percentage tracking
  • 7/30-day trend analysis
  • TDEE (Total Daily Energy Expenditure) calculation

🍽️ Meal Logging

  • Natural language food entry: 米饭:150g, 鸡胸肉:100g
  • Automatic nutrition calculation
  • Daily summary with remaining calories vs TDEE
  • 569 built-in Chinese foods database

📷 OCR Food Recognition

  • Scan food packaging with camera
  • Extract nutrition facts automatically
  • Barcode matching for existing products
  • Support for Kimi Vision and macOS Vision engines

🥬 Pantry Management

  • Track inventory by storage location (fridge/freezer/dry goods/counter)
  • Expiration date tracking with alerts
  • Automatic quantity deduction when logging meals
  • Category-based organization (protein/vegetable/carb/fruit/dairy)

🍳 Smart Recipe Recommendations

  • Generate recipes based on available pantry items
  • Prioritize ingredients nearing expiration
  • Match recipes to nutritional gaps
  • Dynamic threshold adjustment based on inventory levels

📈 Web Dashboard (v2)

  • Tabbed interface: Overview / Pantry / Weight History
  • Visual charts for weight and nutrition trends
  • Interactive pantry management
  • One-click recipe generation

💾 Data Management

  • JSON/CSV export
  • Automatic database backups (keeps last 10)
  • Easy restore from backup
  • Multi-user data isolation

Architecture

See references/ARCHITECTURE.md for system design and data flow.

Database Schema

See references/DATABASE_SCHEMA.md for complete ER diagram and table definitions.

Feature Guide

See references/FEATURE_GUIDE.md for detailed user-facing documentation including:

  • Complete feature descriptions
  • OCR food recognition workflow
  • Pantry management guide
  • Smart recipe recommendations
  • Web dashboard usage
  • Quick command reference

Developer Guide

See references/DEVELOPER_GUIDE.md for:

  • Complete API reference for all scripts
  • Food database structure
  • Database schema details
  • Extension guidelines

Changelog

See CHANGELOG.md for version history and breaking changes.

Available Scripts

Script Purpose
init_db.py Initialize user database
user_profile.py Manage user profile and goals
body_metrics.py Log weight and track trends
meal_logger.py Log meals and view daily summary
diet_recommender.py Get meal recommendations
food_analyzer.py Search foods, OCR scan, add custom
pantry_manager.py Manage ingredient inventory
smart_recipe.py Generate recipes from pantry
launch_dashboard.py Start web dashboard
report_generator.py Generate weekly/nutrition reports
export_data.py Export to JSON/CSV
backup_db.py Backup and restore database
food_ocr.py OCR engine wrapper
food_matcher.py Match OCR results to database
migrate_db.py Database migration tool

Data Storage

Each user has an isolated SQLite database stored at:

~/.openclaw/workspace/skills/nutricoach/data/\x3Cusername>.db

Backups are stored in:

~/.openclaw/workspace/skills/nutricoach/data/backups/

Common Workflows

Daily Logging Workflow

  1. Morning: Log weight with body_metrics.py log-weight
  2. After meals: Log food with meal_logger.py log
  3. Evening: Review daily nutrition summary

Weekly Review Workflow

  1. Generate weekly report with report_generator.py weekly
  2. Check weight trend
  3. Adjust targets if needed with user_profile.py update

Photo Food Recognition Workflow

  1. Save food photo to accessible path
  2. Run: python3 scripts/food_analyzer.py --user \x3Cusername> scan --image \x3Cpath>
  3. Review identified foods and confirm/edit quantities
  4. Log confirmed foods with meal_logger.py log

Pantry Management Workflow

  1. Add groceries: pantry_manager.py add --food "鸡胸肉" --quantity 500
  2. Log meals (auto-deducts from pantry)
  3. Check expiring items: pantry_manager.py list --expiring 3
  4. Get recipe ideas: smart_recipe.py --count 3

Web Dashboard Workflow

  1. Launch: launch_dashboard.py --user \x3Cusername>
  2. Browse Overview tab for trends
  3. Manage Pantry tab for inventory
  4. Use smart recipe buttons directly from pantry view

Configuration

OCR Engine Setup

OCR 食品包装识别支持多种方式,零配置即可使用

方式一:AI 助手识别(推荐,零配置)

如果你使用 AI 助手(如 OpenClaw),直接发送食品包装图片:

[发送图片]
"录入这个食材,生产日期 2025-01-15"

助手会直接识别图片并录入,无需任何配置

方式二:本地识别(命令行,免费)

使用 macOS 内置 Vision 框架,无需配置:

python3 scripts/food_analyzer.py --user \x3Cname> scan --image food.jpg --engine macos

方式三:云端识别(命令行,可选)

如需更高识别精度,配置云端 Vision API:

步骤 1:创建配置文件

cp data/user_config.example.yaml data/user_config.yaml

步骤 2:填入 API key

vision:
  api_key: "your-api-key"
  base_url: "https://api.moonshot.cn/v1"  # 或其他兼容 OpenAI 的 API
  model: "kimi-k2.5"

步骤 3:使用

python3 scripts/food_analyzer.py --user \x3Cname> scan --image food.jpg

支持的 API 提供商:

  • Moonshot (Kimi)
  • OpenAI
  • 阿里 DashScope
  • 其他兼容 OpenAI 接口的服务

说明:

  • user_config.yaml 已被加入 .gitignore,不会意外提交
  • 云端 OCR 仅在命令行模式下需要配置
  • AI 助手模式始终优先使用助手内置的视觉能力

Food Database

Built-in database includes 569 Chinese foods across categories:

  • Proteins: 鸡胸肉, 牛肉, 鸡蛋, 豆腐, etc.
  • Vegetables: 西兰花, 菠菜, 西红柿, etc.
  • Carbs: 米饭, 燕麦, 红薯, etc.
  • Fruits: 苹果, 香蕉, 橙子, etc.
  • Dairy: 牛奶, 酸奶, 奶酪, etc.

Add custom foods via OCR scan or manual entry.


Last updated: 2026-03-28 (v2.0: Added pantry management, smart recipes, OCR, web dashboard)

Usage Guidance
This skill appears to implement what it claims (local meal/pantry tracking, recipe suggestions, OCR wrappers and a local dashboard). Before installing and running: - If you want to use OCR cloud services, be aware that you will need to provide an API key (e.g., OPENAI_API_KEY or a Kimi Vision key) — only enable cloud OCR if you trust the external provider and accept that images/nutrition data may be sent off-device. The skill's metadata does not declare those env vars explicitly. - The code includes a HARDCODING_AUDIT pointing out many hardcoded row indices and other brittle code; this is an engineering quality issue (risk of bugs/corrupted exports) but not malicious. Review/patch db_schema usage before relying on it in production. - The web dashboard template pulls Chart.js from a CDN and the UI may request external assets; if you need an offline deployment, host those assets locally. - Data is stored in the skill's data/backups directories (relative to the skill). Backups are local copies of the DB — ensure you store backups securely (they contain sensitive health data). - Recommended: run the code in an isolated environment (virtualenv/container), review any optional OCR integration code paths you plan to enable, and inspect or run the test suite included to validate behaviour on your platform. If you want, I can: (a) scan specific files for network calls and exact locations where OPENAI_API_KEY or other env vars are read, (b) list all code locations that call subprocess/network, or (c) point out the highest-risk lines that should be reviewed/changed before deployment.
Capability Assessment
Purpose & Capability
Name, description, SKILL.md and the included scripts (meal logging, pantry, OCR wrappers, web dashboard, backups, export) are coherent — the code implements the advertised features (body metrics, meals, pantry, OCR, recipe recommendations, web UI). There are no obvious unrelated permissions or credentials requested.
Instruction Scope
SKILL.md instructs running the included scripts and launching a local web dashboard; the scripts operate on per-user SQLite DBs under the skill's data folder. A few instructions and scripts reference optional cloud OCR and advise setting OPENAI_API_KEY or using a data/user_config.yaml — that environment credential is not declared in the skill metadata. The skill will run subprocesses (calls to other included scripts) and read/write local files (data and backups) — all consistent with its function, but the optional OCR path can involve networked OCR services if configured.
Install Mechanism
There is no install spec (the package is distributed as source scripts). Dependencies are declared in requirements.txt (Flask, PyYAML, optional OpenAI/Tesseract commented). No remote archives or download URLs are used by the install process shown. This is low install risk, but running pip install -r requirements.txt will pull packages from PyPI if used.
Credentials
The skill declares no required environment variables, which aligns with local-only operation. However, the code and SKILL.md mention optional cloud OCR (Kimi Vision / OpenAI) and reference OPENAI_API_KEY and data/user_config.yaml in error messages — these are optional but if you enable cloud OCR the skill will use API keys not declared up-front. No unrelated system credentials (AWS, GitHub tokens, etc.) are requested.
Persistence & Privilege
always:false and user-invocable:true. The skill stores per-user SQLite DBs and keeps backups under its data/backups directory; it does not request system-wide configuration changes or claim permanent always-on privileges. Backups are local copies of the DB and the skill does not modify other skills' configuration.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install nutricoach
  3. After installation, invoke the skill by name or use /nutricoach
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
- Added configuration examples and explanation for local and cloud OCR recognition, including user_config.yaml workflow. - Updated the configuration section with clear options for zero-config AI assistant, local (macOS), and cloud (API) OCR modes. - .gitignore and Clawhub project files were added for improved version control and project management. - Removed deprecated static CSS and archive dashboard template files, streamlining the codebase. - Documentation now better clarifies cloud OCR setup steps and safety regarding API key confidentiality.
v1.0.0
Major upgrade: NutriCoach evolves from a simple health tracker to an all-in-one personal health and nutrition management platform. - Comprehensive tracking for body metrics, daily meals, and nutrition history - Intelligent diet recommendations and recipe suggestions based on pantry items, goals, and nutrition gaps - Pantry inventory management with expiration tracking and automated deduction during meal logging - OCR food recognition from photos and support for barcode/packaging scan - Multi-user database isolation and full-featured web dashboard with luxury refined UI - 570 Chinese foods database with complete nutrition data - Data export, automatic backups, and detailed usage guides
Metadata
Slug nutricoach
Version 1.0.1
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is nutricoach 营养专家?

Personal health data management and intelligent diet recommendation system. Use when users need to: - Record and track body metrics (weight, height, BMI, bod... It is an AI Agent Skill for Claude Code / OpenClaw, with 127 downloads so far.

How do I install nutricoach 营养专家?

Run "/install nutricoach" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is nutricoach 营养专家 free?

Yes, nutricoach 营养专家 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does nutricoach 营养专家 support?

nutricoach 营养专家 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created nutricoach 营养专家?

It is built and maintained by RainbowLion0320 (@rainbowlion0320); the current version is v1.0.1.

💬 Comments