diet-record
Diet recording skill. Log meals via text description or food photo upload, auto-recognize food items and estimate nutrition/calories. Activate when user sends a food photo, describes what they ate, asks to log a meal, or queries calorie/nutrition info. Triggers include "记录饮食", "午饭吃了", "帮我记一下", "这个多少卡", "拍了张照片", "今天吃了什么", "log my meal", "what did I eat today".
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/734818028/diet-recordDiet Logger
Record meals via photo or text, auto-recognize food items and calculate nutrition.
Data Storage
All diet records are stored in diet-log.jsonl (same directory as this skill file, one JSON object per line). Create the file if it doesn't exist.
Each record schema:
{
"id": "uuid",
"timestamp": "ISO-8601",
"meal_type": "breakfast|lunch|dinner|snack",
"items": [
{
"name": "食物名称",
"portion_g": 150,
"calories_kcal": 230,
"protein_g": 12,
"fat_g": 8,
"carb_g": 28,
"fiber_g": 2
}
],
"total_calories": 460,
"notes": ""
}
User Preferences
Stored in diet-preferences.json (same directory as this skill file). Create the file if it doesn't exist.
{
"photo_auto_log": null,
"dietary_restrictions": [],
"allergies": [],
"disliked_foods": [],
"favorite_foods": [],
"diet_goal": null,
"daily_calorie_target": null,
"meal_routine": null,
"notes": ""
}
Fields:
photo_auto_log:true= auto-log on photo upload,false= confirm first,null= not yet set.dietary_restrictions: e.g.["素食", "清真", "无麸质", "低碳水"]allergies: e.g.["花生", "海鲜", "乳糖不耐"]disliked_foods: foods user explicitly dislikesfavorite_foods: frequently eaten or preferred foodsdiet_goal: e.g."减脂","增肌","维持体重","均衡饮食"daily_calorie_target: e.g.1800(kcal),nullif not setmeal_routine: e.g."一日三餐","16:8轻断食","少食多餐"notes: any other dietary habits or notes from user
Preference Discovery
Photo auto-log preference: On the first food photo upload (or when photo_auto_log is null), recognize items as usual, then ask: "以后发食物照片时,要自动帮你记录饮食吗?还是每次先确认再记录?"
Dietary habits: Whenever user mentions dietary preferences, restrictions, allergies, goals, or habits in conversation, extract and save to the corresponding fields. Examples:
- "我对花生过敏" → add
"花生"toallergies - "我在减脂" → set
diet_goalto"减脂" - "我不吃香菜" → add
"香菜"todisliked_foods - "我每天控制在1500卡" → set
daily_calorie_targetto1500 - "我在做16:8轻断食" → set
meal_routineto"16:8轻断食"
Preferences are accumulated over time — update individual fields without overwriting unrelated ones. Read preferences before each interaction to provide personalized feedback (e.g. warn if a meal exceeds calorie target, flag allergens in recognized food).
Workflow
Photo Input
- Receive food photo from user
- Read
diet-preferences.jsonto checkphoto_auto_log - Analyze the image: identify each food item, estimate portion size
- Look up nutrition data per item (use the reference table below)
- If
photo_auto_logisnull: present result, ask preference (see above), then log - If
photo_auto_logistrue: calculate totals, log directly, respond with summary - If
photo_auto_logisfalse: present recognized items — ask user to confirm or correct, then log - Append record to
diet-log.jsonl
Text Input
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-734818028-diet-record": {
"enabled": true,
"auto_update": true
}
}
}