Comprehensive fitness and diet tracking with natural language meal logging, workout logging, food image analysis, automatic calorie/macro calculation, daily and weekly health summaries integrating Fitbit data, hydration tracking, saved meal shortcuts, exercise standardization (60+ exercises), progressive overload tracking with PR history, workout templates, recovery monitoring, natural language workout queries, and adaptive training suggestions. Use for logging meals ("I ate X for lunch") or workouts ("I did 34 situps"), querying PRs ("What is my bench PR?"), daily/weekly summaries, or health tracking queries.
All thresholds and targets are configurable via under the section. When weight/height/age are set, calorie targets are calculated automatically using the Mifflin-St Jeor equation with activity multipliers.
config.jsonGOALS| Setting | Default | Description |
|---|---|---|
goal_type | maintenance | One of: maintenance, weight_loss, muscle_gain |
weight_kg | null | Body weight in kg (enables protein target calculation) |
height_cm | null | Height in cm (enables calorie target calculation) |
age | null | Age in years (enables calorie target calculation) |
sex | male | male or female (affects BMR calculation) |
activity_level | moderate | sedentary, light, moderate, active, very_active |
protein_per_kg | 0.8 | Protein target multiplier per kg body weight |
calorie_target | null | Manual override for daily calorie target |
sodium_limit_mg | 2300 | Daily sodium limit in mg |
fiber_target_g | 38 | Daily fiber target in grams |
step_target | 10000 | Daily step target |
sleep_target_h | 7.0 | Daily sleep target in hours |
Personalization for allergies, dietary restrictions, health conditions, and food preferences. Configured via config.json under the DIETARY_PROFILE section.
| Setting | Default | Description |
|---|---|---|
allergies | [] | Food allergies (e.g., peanuts, shellfish, dairy, gluten) |
dietary_restrictions | [] | Dietary restrictions (e.g., vegetarian, vegan, keto) |
dislikes | [] | Foods to avoid in meal suggestions |
cuisine_preferences | [] | Preferred cuisines (e.g., italian, mexican, asian) |
health_conditions | [] | Health conditions affecting diet (e.g., diabetes, hypertension) |
cooking_skill | null | Cooking skill level: basic, intermediate, advanced |
budget | null | Food budget: budget, moderate, premium |
meal_timing | null | Typical meal schedule |
meal_variety | "balanced" | Recommendation style: explore, balanced, or consistent |
notes | "" | Additional dietary notes |
Gradual learning: Preferences are learned over time through coach note prompts. Safety-critical items (allergies, health conditions) are asked after the first meal log. Other preferences are prompted gradually:
Quick setup: Say "let's configure" to set all preferences at once.
CLI:
python3 scripts/dietary_profile.py --show — View current profilepython3 scripts/dietary_profile.py --set allergies "peanuts,shellfish" — Set a preferencepython3 scripts/dietary_profile.py --next-prompt — Get next gradual learning promptpython3 scripts/dietary_profile.py --full-setup — Get all unset preference promptsThis skill manages personal health data through eight integrated workflows:
Process natural language food descriptions and automatically log to daily diet file with calorie/macro estimates using multi-source food database (750,000+ foods from local SQLite, OpenNutrition, and USDA API). Beverages are automatically tracked for hydration. Saved meal shortcuts are expanded before parsing.
Triggers:
Process:
Allergy Warnings: When allergens are detected in a meal, warnings are displayed in the terminal and logged to the diet file. Warnings are based on the user's configured allergies and the allergen map (allergen_map.json). Keyword matches (direct food name) and contextual matches (broader dishes like "pad thai" for peanuts) are both checked.
Example user input: "I had a chicken breast and some rice for lunch"
Expected log format:
### Lunch (~2:30 PM)
- Chicken breast (200g)
- White rice (1 cup)
- Est. calories: ~450
- Macros: ~40g protein, ~45g carbs, ~8g fat
- Hydration: 1 beverage(s)
Process natural language exercise descriptions and automatically log to daily fitness file with workout details (type, volume, duration, intensity). Exercise names are automatically normalized via the exercise database (see Exercise Standardization below). Saved workout templates are expanded before parsing. PRs are recorded automatically. Consult references/workout-programming.md for exercise science context.
Triggers:
Supported exercises: 60+ exercises in exercise_aliases.json covering:
Process:
Analyze food images and log meals with visual estimation.
Process:
Generate comprehensive daily health report combining Fitbit data, diet logs, and workout logs. All thresholds come from GOALS config. Consult references/nutrition-targets.md for coaching context.
Triggers:
Process:
Generate weekly trend analysis comparing current week to previous week. Includes exercise progression (PRs, trends, stalled lifts), recovery notes, and adaptive plan suggestions.
Triggers:
Process:
Script: python3 scripts/generate_weekly_summary.py [YYYY-MM-DD]
Beverages are automatically detected during meal logging and tracked as hydration data.
Tracked beverages: water, coffee, tea, soda, juice, smoothie, beer, wine, milk, lemonade, sparkling
Process:
Answer natural language questions about workout history, PRs, trends, and Fitbit metrics.
Triggers:
Process:
Script: python3 scripts/query_history.py 'your question'
Suggest meals based on remaining macros, user dietary profile, and preferences. Uses curated meal templates (~60 meals) with optional TheMealDB API enrichment (300+ recipes).
Triggers:
Process:
meal_templates.jsonVariety modes (meal_variety in DIETARY_PROFILE):
Scoring: Uses 10 weighted components (calorie_fit, protein_fit, sodium_ok, cuisine_bonus, cuisine_diverse, novelty_bonus, repetition_penalty, familiarity_bonus, pattern_match, random_factor) with weights selected by variety mode. All weights sum to 1.0.
Filter relaxation: If too few results, filters are relaxed in order: budget → cooking_skill → seasons → difficulty → dislikes. Allergens and dietary restrictions are NEVER relaxed.
CLI:
python3 scripts/meal_planner.py — Suggest for next mealpython3 scripts/meal_planner.py --type dinner — Suggest dinnerpython3 scripts/meal_planner.py --count 3 — Top 3 suggestionspython3 scripts/meal_planner.py --remaining — Show remaining macrosOutput format:
Remaining today: ~800 cal, 45g protein, 100g carbs, 30g fat
Suggested meals for dinner:
1. Grilled Chicken with Rice and Broccoli
~520 cal | 45g protein | 52g carbs | 10g fat
Prep: 25 min | Skill: Basic | American
Fills 65% of remaining calories, 100% of remaining protein
All exercise names are normalized through exercise_aliases.json, which maps common names and abbreviations to canonical exercise names. This ensures consistent tracking across workouts.
File: exercise_aliases.json (in skill root, ~60 exercises)
Each entry contains:
canonical: The standard name used for tracking (e.g., "Bench Press")aliases: Common names and abbreviations (e.g., "bench", "flat bench", "bb bench")muscle_groups: Muscles targeted (e.g., ["chest", "shoulders", "triceps"])type: Exercise classification (compound, isolation, bodyweight, cardio)Adding custom exercises: Edit exercise_aliases.json and add a new entry following the existing format. The database is loaded once at import time; call exercise_db.reload_db() to refresh.
Planet Fitness 30-Minute Express Circuit: The 10 circuit stations are all mapped in the database. Use the "pf express circuit" saved workout template to log all 10 at once.
Saved workouts are shortcuts for common workout routines stored in saved_workouts.json. When a saved workout name is used as input, it is expanded to the full exercise list before parsing.
File: saved_workouts.json (in skill root)
{
"push day": "3 sets of chest press machine, 3 sets of incline press machine, ...",
"pull day": "3 sets of lat pulldown machine, 3 sets of seated row machine, ...",
"leg day": "4 sets of smith machine squats, 3 sets of leg press machine, ...",
"pf express circuit": "seated row, leg press, leg curl, ab crunch, ..."
}
Usage:
python3 scripts/log_workout.py "push day" -- expands and logs all exercisespython3 scripts/log_workout.py --save "template name" "exercise description"Saved meals are shortcuts for frequently eaten meals stored in saved_meals.json. When a saved meal name appears in meal text, it is expanded to the full description before parsing.
File: saved_meals.json (in skill root)
{
"my usual breakfast": "2 eggs and toast with coffee",
"post workout shake": "protein shake with banana and almond milk"
}
Usage:
python3 scripts/calculate_macros.py --save "meal name" "food description"CRITICAL: Always follow this exact format so the daily summary script can parse macros correctly.
### {MealType} (~{Time})
- {Food item 1}
- {Food item 2}
- Est. calories: ~{calories}
- Macros: ~{protein}g protein, ~{carbs}g carbs, ~{fat}g fat
- Sodium: ~{sodium}mg (optional)
- Fiber: ~{fiber}g (optional)
## Daily Totals
- Calories: ~{total} kcal
- Protein: ~{total}g
- Carbs: ~{total}g
- Fat: ~{total}g
- Fiber: ~{total}g (optional)
- Hydration: {count} beverages (optional)
IMPORTANT:
- Calories: ~950 kcal (NOT "Total calories" or ranges like "900-1,000")Health summaries: $WORKSPACE/summaries/YYYY-MM-DD.md
generate_daily_summary.pyDiet logs: $WORKSPACE/diet/YYYY-MM-DD.md
Workout logs: $WORKSPACE/fitness/YYYY-MM-DD.md
Fitness data: $WORKSPACE/fitness/fitbit/YYYY-MM-DD.json
Fitbit sync script: scripts/fitbit-integration/fetch-fitbit.sh
./scripts/fitbit-integration/fetch-fitbit.sh [YYYY-MM-DD]Food images: $WORKSPACE/diet/images/YYYY-MM-DD-meal-#.jpg
Configuration: config.json (GOALS, DIETARY_PROFILE, data sources, paths), .env (API keys, secrets)
Saved meals: saved_meals.json (meal shortcuts)
Saved workouts: saved_workouts.json (workout template shortcuts)
Exercise database: exercise_aliases.json (60+ exercises with aliases and muscle groups)
PR history: pr_history.json (per-exercise PR and session history, auto-generated)
Allergen map: allergen_map.json (14 allergens with food keywords and contextual matches)
Meal templates: meal_templates.json (~60 curated meals with macros, allergens, and tags)
Dietary profile state: dietary_profile_state.json (internal gradual learning state, auto-generated)
Diet:
Fitness (from Fitbit):
Activity:
Active Minutes:
Heart:
Sleep:
Body Composition:
Energy:
Workouts (manual logging):
Consult these references when providing coaching advice:
| Reference | When to consult |
|---|---|
references/nutrition-targets.md | Giving diet advice, assessing macros, setting calorie targets, meal timing |
references/workout-programming.md | Analyzing workout volume, suggesting exercises, programming splits, deloads |
references/recovery.md | Poor sleep patterns, overtraining signs, rest day advice, stress management |
references/food-database.md | Quick lookup of common food macros |
references/macro-guidelines.md | General macro ratio guidelines |
references/summary-template.md | Daily summary format reference |
The food lookup system uses a multi-source architecture -- all enabled sources are queried simultaneously and results are merged by relevance. Configure sources via FOOD_SOURCES in config.json (default: ["local_db", "opennutrition", "usda_api"]). Sources that are unavailable are silently skipped.
| Source | Config key | Type | Size |
|---|---|---|---|
local_db | DB_PATH | SQLite (ComprehensiveFoodDatabase) | ~450K foods |
opennutrition | OPENNUTRITION_DB_PATH | SQLite (imported via scripts/import_opennutrition.py) | ~300K foods |
usda_api | USDA_API_KEY | REST API (USDA FoodData Central) | Live queries |
Setup:
python3 scripts/import_local_db.py (requires megatools, downloads ~1.4 GB from Mega.nz)python3 scripts/import_opennutrition.py (downloads 282MB, imports ~300K foods into data/opennutrition.sqlite)HEALTH_SKILL_USDA_API_KEY in .envscripts/calculate_macros.py - Parse natural language and calculate macros from food database (with hydration tracking and saved meals) scripts/log_workout.py - Parse natural language workouts, expand templates, normalize names, record PRs scripts/generate_daily_summary.py - Generate comprehensive daily health reports (diet + workout + Fitbit + PRs) scripts/generate_weekly_summary.py - Generate weekly trend analysis with exercise progression and adaptive plans scripts/exercise_db.py - Exercise name normalization and muscle group lookup scripts/progressive_overload.py - PR tracking, stall detection, and progression trends scripts/recovery_tracking.py - Muscle group recovery monitoring scripts/query_history.py - Natural language workout query engine scripts/regenerate_summary.py - Regenerate summary for specific date scripts/dietary_profile.py - Dietary profile management and gradual preference learning scripts/allergy_checker.py - Allergen detection during meal logging scripts/meal_history.py - Meal history analysis, ingredient-based cuisine detection, and caching scripts/meal_planner.py - Meal suggestion engine with scoring, filtering, and seasonal awareness scripts/themealdb.py - Optional TheMealDB API client for recipe enrichment