Skip to main content
Workout planning, macros, and body metrics via wger/USDA.

Skill metadata

Reference: full SKILL.md

The following is the complete skill definition that Mibyan loads when this skill is triggered. This is what the agent sees as instructions when the skill is active.

Fitness & Nutrition

Expert fitness coach and sports nutritionist skill. Two data sources plus offline calculators — everything a gym-goer needs in one place. Data sources (all free, no pip dependencies):
  • wger (https://wger.de/api/v2/) — open exercise database, 690+ exercises with muscles, equipment, images. Public endpoints need zero authentication.
  • USDA FoodData Central (https://api.nal.usda.gov/fdc/v1/) — US government nutrition database, 380,000+ foods. DEMO_KEY works instantly; free signup for higher limits.
Offline calculators (pure stdlib Python):
  • BMI, TDEE (Mifflin-St Jeor), one-rep max (Epley/Brzycki/Lombardi), macro splits, body fat % (US Navy method)

When to Use

Trigger this skill when the user asks about:
  • Exercises, workouts, gym routines, muscle groups, workout splits
  • Food macros, calories, protein content, meal planning, calorie counting
  • Body composition: BMI, body fat, TDEE, caloric surplus/deficit
  • One-rep max estimates, training percentages, progressive overload
  • Macro ratios for cutting, bulking, or maintenance

Procedure

Exercise Lookup (wger API)

All wger public endpoints return JSON and require no auth. Always add format=json and language=2 (English) to exercise queries. Step 1 — Identify what the user wants:
  • By muscle → use /api/v2/exercise/?muscles={id}&language=2&status=2&format=json
  • By category → use /api/v2/exercise/?category={id}&language=2&status=2&format=json
  • By equipment → use /api/v2/exercise/?equipment={id}&language=2&status=2&format=json
  • By name → use /api/v2/exercise/search/?term={query}&language=english&format=json
  • Full details → use /api/v2/exerciseinfo/{exercise_id}/?format=json
Step 2 — Reference IDs (so you don’t need extra API calls): Exercise categories: Muscles: Equipment: Step 3 — Fetch and present results:

Nutrition Lookup (USDA FoodData Central)

Uses USDA_API_KEY env var if set, otherwise falls back to DEMO_KEY. DEMO_KEY = 30 requests/hour. Free signup key = 1,000 requests/hour.

Offline Calculators

Use the helper scripts in scripts/ for batch operations, or run inline for single calculations:
  • python scripts/body_calc.py bmi <weight_kg> <height_cm>
  • python scripts/body_calc.py tdee <weight_kg> <height_cm> <age> <M|F> <activity 1-5>
  • python scripts/body_calc.py 1rm <weight> <reps>
  • python scripts/body_calc.py macros <tdee_kcal> <cut|maintain|bulk>
  • python scripts/body_calc.py bodyfat <M|F> <neck_cm> <waist_cm> [hip_cm] <height_cm>
See references/FORMULAS.md for the science behind each formula.

Pitfalls

  • wger exercise endpoint returns all languages by default — always add language=2 for English
  • wger includes unverified user submissions — add status=2 to only get approved exercises
  • USDA DEMO_KEY has 30 req/hour — add sleep 2 between batch requests or get a free key
  • USDA data is per 100g — remind users to scale to their actual portion size
  • BMI does not distinguish muscle from fat — high BMI in muscular people is not necessarily unhealthy
  • Body fat formulas are estimates (±3-5%) — recommend DEXA scans for precision
  • 1RM formulas lose accuracy above 10 reps — use sets of 3-5 for best estimates
  • wger’s exercise/search endpoint uses term not query as the parameter name

Verification

After running exercise search: confirm results include exercise names, muscle groups, and equipment. After nutrition lookup: confirm per-100g macros are returned with kcal, protein, fat, carbs. After calculators: sanity-check outputs (e.g. TDEE should be 1500-3500 for most adults).

Quick Reference