ClawCoach Food — Photo Analysis & Meal Logging
This skill handles food photo analysis via Claude Vision, text-based meal logging, and the confirmation flow.
When to Activate
- - User sends a photo — assume it is food unless context clearly suggests otherwise
- User types a food description ("I had 2 eggs and toast for breakfast")
- User says "log [food]" or "I ate [food]"
- User wants to edit or delete a previous meal
Data Storage
All meals are stored in ~/.clawcoach/food-log.json with this structure:
CODEBLOCK0
Photo Analysis Flow
When the user sends a photo:
- 1. Analyze the image using your vision capabilities. Identify every distinct food item visible. For each item estimate:
- Name (be specific: "grilled chicken breast" not just "chicken")
- Portion in common units (oz, cups, pieces, slices)
- Calories and macros (protein, fat, carbs in grams)
Use your nutritional knowledge. For common foods, these are well-established values. Be conservative with portions if uncertain.
- 2. Present the results in the user's persona voice:
- List each item with portion and macros
- Show meal total
- Show daily running totals (consumed / target / remaining)
- Ask: "confirm? (yes / edit / redo)"
- 3. Handle response:
-
"yes" / "confirm" — Write the meal to
~/.clawcoach/food-log.json with status "confirmed"
-
Correction (e.g., "the rice was brown rice" or "it was more like 8oz") — recalculate and present updated totals
-
"redo" — ask for a new photo or text description
- 4. After confirmation, always show updated daily totals.
Text-Based Logging
When the user describes food in text:
- 1. Parse the food items and estimate portions from the description
- Calculate macros for each item using your nutritional knowledge
- Follow the same confirmation flow as photo analysis
Meal Type Auto-Detection
Categorize meals by time:
- - Before 10:00 = breakfast
- 10:00 - 14:00 = lunch
- 14:00 - 17:00 = snack
- After 17:00 = dinner
The user can override: "log this as a snack"
Editing and Deleting
- - "Delete my lunch" — find today's lunch entry, remove it from food-log.json
- "I think that was more like 400 calories" — update the specific meal entry
- "What did I eat today?" — list all confirmed meals for today with totals
Daily Totals
After any meal is confirmed, calculate and show:
- 1. Read profile from
~/.clawcoach/profile.json for targets - Sum all confirmed meals for today from food-log.json
- Display:
-
Consumed: X cal | Xg protein | Xg fat | Xg carbs
-
Target: X cal | Xg protein | Xg fat | Xg carbs
-
Remaining: X cal | Xg protein | Xg fat | Xg carbs
Edge Cases
- - Blurry or unclear photo: "I can't quite make out the food. Try a better lit photo, or just tell me what you had."
- Non-food photo: "That doesn't look like food! Send a photo of your meal, or type what you ate."
- Unknown food: Ask the user for clarification rather than guessing wildly.
- Multiple items unclear: "I can see chicken and something else — is that rice or pasta?"
- No portion visible: Use standard serving sizes and note: "I estimated a standard portion — let me know if it was more or less."
Nutritional Reference (Common Foods per 100g)
Use these as a baseline. Scale by estimated portion size.
| Food | Cal | Protein | Fat | Carbs |
|---|
| Chicken breast (grilled) | 165 | 31 | 3.6 | 0 |
| Salmon (baked) |
208 | 20 | 13 | 0 |
| White rice (cooked) | 130 | 2.7 | 0.3 | 28 |
| Brown rice (cooked) | 123 | 2.7 | 1.0 | 26 |
| Pasta (cooked) | 131 | 5 | 1.1 | 25 |
| Broccoli (steamed) | 35 | 2.4 | 0.4 | 7 |
| Egg (whole, large ~50g) | 155 | 13 | 11 | 1.1 |
| Avocado | 160 | 2 | 15 | 9 |
| Sweet potato (baked) | 90 | 2 | 0.1 | 21 |
| Greek yogurt (plain) | 59 | 10 | 0.7 | 3.6 |
| Banana (~120g) | 89 | 1.1 | 0.3 | 23 |
| Oats (cooked) | 68 | 2.4 | 1.4 | 12 |
| Bread (white, per slice ~30g) | 265 | 9 | 3.2 | 49 |
| Cheese (cheddar) | 403 | 25 | 33 | 1.3 |
| Almonds | 579 | 21 | 50 | 22 |
| Olive oil (1 tbsp ~14ml) | 884 | 0 | 100 | 0 |
| Pizza (pepperoni, per slice) | 298 | 12 | 14 | 30 |
| Burger (quarter lb w/ bun) | ~550 | 30 | 30 | 40 |
| Steak (sirloin) | 206 | 26 | 11 | 0 |
| Tofu (firm) | 144 | 17 | 9 | 3 |
| Lentils (cooked) | 116 | 9 | 0.4 | 20 |
| Milk (whole, 250ml) | 61 | 3.2 | 3.3 | 4.8 |
| Protein shake (~1 scoop) | ~120 | 25 | 1.5 | 3 |
For foods not on this list, use your general nutritional knowledge. Be transparent when estimating.
Important
- - Always present macros rounded to whole numbers
- Always show daily running totals after confirming a meal
- The persona voice comes from clawcoach-core — match it in all responses
- Never log a meal without user confirmation
- Generate unique meal IDs as: INLINECODE3
ClawCoach 食物 — 照片分析与餐食记录
本技能通过Claude视觉功能处理食物照片分析、文本餐食记录以及确认流程。
何时激活
- - 用户发送照片——除非上下文明确表明不是食物,否则默认为食物
- 用户输入食物描述(我早餐吃了2个鸡蛋和吐司)
- 用户说记录[食物]或我吃了[食物]
- 用户想要编辑或删除之前的餐食
数据存储
所有餐食存储在~/.clawcoach/food-log.json中,结构如下:
json
{
meals: [
{
id: 2026-02-22-lunch-001,
date: 2026-02-22,
type: lunch,
status: confirmed,
items: [
{
name: grilled chicken breast,
portion: 6 oz,
calories: 280,
protein_g: 52,
fat_g: 6,
carbs_g: 0
}
],
total_calories: 520,
totalproteing: 62,
totalfatg: 14,
totalcarbsg: 48,
source: photo,
timestamp: 2026-02-22T12:35:00Z
}
]
}
照片分析流程
当用户发送照片时:
- 1. 分析图像,利用你的视觉能力。识别所有可见的不同食物项目。对每个项目估算:
- 名称(要具体:烤鸡胸肉而不是鸡肉)
- 份量(常用单位:盎司、杯、块、片)
- 卡路里和宏量营养素(蛋白质、脂肪、碳水化合物,以克为单位)
运用你的营养学知识。对于常见食物,这些数值是公认的。如果不确定,对份量采取保守估计。
- 2. 呈现结果,使用用户的角色语气:
- 列出每个项目及其份量和宏量营养素
- 显示餐食总计
- 显示每日累计总计(已摄入/目标/剩余)
- 询问:确认?(是/编辑/重做)
- 3. 处理回复:
-
是/确认 — 将餐食写入~/.clawcoach/food-log.json,状态设为confirmed
-
修正(例如米饭是糙米或更像是8盎司)— 重新计算并呈现更新后的总计
-
重做 — 要求提供新照片或文字描述
- 4. 确认后,始终显示更新后的每日总计。
文本记录
当用户用文字描述食物时:
- 1. 解析食物项目并根据描述估算份量
- 运用你的营养学知识计算每个项目的宏量营养素
- 遵循与照片分析相同的确认流程
餐食类型自动检测
按时间对餐食进行分类:
- - 10:00之前 = 早餐
- 10:00 - 14:00 = 午餐
- 14:00 - 17:00 = 零食
- 17:00之后 = 晚餐
用户可以覆盖:将此记录为零食
编辑和删除
- - 删除我的午餐 — 查找今天的午餐条目,从food-log.json中删除
- 我觉得那更像是400卡路里 — 更新特定餐食条目
- 我今天吃了什么? — 列出今天所有已确认的餐食及其总计
每日总计
任何餐食确认后,计算并显示:
- 1. 从~/.clawcoach/profile.json读取目标
- 从food-log.json汇总今天所有已确认的餐食
- 显示:
-
已摄入:X卡路里 | X克蛋白质 | X克脂肪 | X克碳水化合物
-
目标:X卡路里 | X克蛋白质 | X克脂肪 | X克碳水化合物
-
剩余:X卡路里 | X克蛋白质 | X克脂肪 | X克碳水化合物
边界情况
- - 模糊或不清楚的照片:我看不太清食物。试试光线更好的照片,或者直接告诉我你吃了什么。
- 非食物照片:那看起来不像食物!发送你的餐食照片,或者输入你吃了什么。
- 未知食物:向用户询问澄清,而不是胡乱猜测。
- 多个项目不明确:我能看到鸡肉和其他东西——那是米饭还是意面?
- 看不到份量:使用标准份量并注明:我估算的是标准份量——如果多了或少了请告诉我。
营养参考(每100克常见食物)
以此作为基准。根据估算的份量进行缩放。
| 食物 | 卡路里 | 蛋白质 | 脂肪 | 碳水化合物 |
|---|
| 鸡胸肉(烤) | 165 | 31 | 3.6 | 0 |
| 三文鱼(烤) |
208 | 20 | 13 | 0 |
| 白米饭(熟) | 130 | 2.7 | 0.3 | 28 |
| 糙米饭(熟) | 123 | 2.7 | 1.0 | 26 |
| 意面(熟) | 131 | 5 | 1.1 | 25 |
| 西兰花(蒸) | 35 | 2.4 | 0.4 | 7 |
| 鸡蛋(整颗,大号约50克) | 155 | 13 | 11 | 1.1 |
| 牛油果 | 160 | 2 | 15 | 9 |
| 红薯(烤) | 90 | 2 | 0.1 | 21 |
| 希腊酸奶(原味) | 59 | 10 | 0.7 | 3.6 |
| 香蕉(约120克) | 89 | 1.1 | 0.3 | 23 |
| 燕麦(熟) | 68 | 2.4 | 1.4 | 12 |
| 面包(白面包,每片约30克) | 265 | 9 | 3.2 | 49 |
| 奶酪(切达) | 403 | 25 | 33 | 1.3 |
| 杏仁 | 579 | 21 | 50 | 22 |
| 橄榄油(1汤匙约14毫升) | 884 | 0 | 100 | 0 |
| 披萨(意式辣香肠,每片) | 298 | 12 | 14 | 30 |
| 汉堡(四分之一磅加面包) | ~550 | 30 | 30 | 40 |
| 牛排(西冷) | 206 | 26 | 11 | 0 |
| 豆腐(硬豆腐) | 144 | 17 | 9 | 3 |
| 扁豆(熟) | 116 | 9 | 0.4 | 20 |
| 牛奶(全脂,250毫升) | 61 | 3.2 | 3.3 | 4.8 |
| 蛋白粉(约1勺) | ~120 | 25 | 1.5 | 3 |
对于此列表中没有的食物,使用你的一般营养学知识。在估算时要透明。
重要事项
- - 始终将宏量营养素四舍五入为整数
- 确认餐食后始终显示每日累计总计
- 角色语气来自clawcoach-core——在所有回复中保持一致
- 未经用户确认不得记录餐食
- 生成唯一的餐食ID格式为:{日期}-{餐食类型}-{序号}