Diet Tracker
by @yonghaozhao722
Tracks daily diet and calculates nutrition information to help achieve weight loss goals. Use when user provides meal information, asks about calorie intake,...
clawhub install diet-trackerš About This Skill
name: diet-tracker description: Tracks daily diet and calculates nutrition information to help achieve weight loss goals. Use when user provides meal information, asks about calorie intake, requests remaining calorie budget, or needs meal logging reminders. Automatically reminds user to log meals via cron job at lunch and dinner times.
Diet Tracker
This skill helps track daily diet and achieve weight loss goals with automated meal reminders.
Trigger Conditions
User might say:
Or automatically triggered by cron job for meal reminders.
Cron Job Integration
This skill works with automated cron jobs:
Cron job system event: é„®é£č®°å½ę£ę„:åé¤ or é„®é£č®°å½ę£ę„:ęé¤
User Profile (Required)
The skill reads from USER.md:
Activity levels:
Workflow
When User Logs a Meal:
1. Identify food items from user's description
2. Fetch nutrition data via scripts/get_food_nutrition.py
- MUST GET: calories(kcal), protein(g), carbs(g), fat(g)
- Searches web for calorie/protein/carbs/fat info
- Falls back to references/food_database.json if needed
- If complete nutrition data cannot be found, MUST clearly inform user of estimated values
3. Update daily log via scripts/update_memory.py
- Saves to memory/YYYY-MM-DD.md
- RECORD FORMAT: Food Name - XX kcal (P: XXg, C: XXg, F: XXg)
- Calculates meal totals
- Updates daily running totals
4. Report to user:
- MUST REPORT: calories + protein/carbs/fat grams
- Today's consumed / remaining calories
- MUST REPORT: Remaining macronutrient budgets
- Predicted weight change based on deficit/surplus
When User Asks for Status:
1. Read current day's memory file 2. Calculate totals consumed 3. Report: - Remaining calorie budget - Remaining protein/carbs/fat (if targets set) - Weight change prediction
Scripts
scripts/get_food_nutrition.py: Fetches nutrition info + calculates TDEEscripts/update_memory.py: Updates daily memory file with meal datareferences/food_database.json: Fallback database of common foodsError Handling
Common Issues
Issue: "Cannot read USER.md" or missing user data
Issue: Nutrition lookup fails for uncommon foods
Issue: Multiple food items in one meal
Data Format
Daily Memory Entry (memory/YYYY-MM-DD.md)
REQUIRED FORMAT ā Must include calories + macronutrients:
## Diet LogBreakfast: [food] - [X] kcal (P: [X]g, C: [X]g, F: [X]g)
Lunch: [food] - [X] kcal (P: [X]g, C: [X]g, F: [X]g)
Dinner: [food] - [X] kcal (P: [X]g, C: [X]g, F: [X]g)
Daily Total: [X] / [target] kcal
Protein: [X] / [target]g (remaining: [X]g)
Carbs: [X] / [target]g (remaining: [X]g)
Fat: [X] / [target]g (remaining: [X]g)
Predicted weight change: [-/+ X] kg
ā ļø Strictly prohibited to record only calories while omitting macronutrient grams!