Fitness Planner
Fitness, strength-training and nutrition-planning microservice: build a weekly workout split (full-body, upper/lower, push-pull-legs, bro-split) sized to days-per-week and a goal (strength...
fitness-planner
A training-programming & performance-nutrition microservice. Deterministic exercise-science formulas: build a weekly workout split, generate a linear progression, compute macros and a calorie target, estimate a one-rep max, plan a deload, and generate warm-up sets. Programming tools also attach an optional plain-English LLM coaching cue and silently fall back offline; results are tagged mode: 'heuristic' | 'llm'. All numbers are pure math — a model never changes them.
Tools
| Tool | Input | Output |
|---|---|---|
workoutSplit | { daysPerWeek, goal } | A proven split (full-body / upper-lower / PPL / bro-split) with per-day focus + goal-tuned set/rep scheme. +optional cue. |
progression | { lift:{name,startWeight,startReps?,sets?}, weeks, goal } | A week-by-week linear load/rep ramp with built-in deload weeks. +optional cue. |
macros | { weight, goal, activity } | Daily protein/carbs/fat grams (+ calories and % split) from bodyweight × goal × activity. |
calorieTarget | { goal, activity, options:{age,sex,weightKg,heightCm} } | Daily calorie target: Mifflin-St Jeor BMR × activity factor + goal adjustment. |
oneRepMax | { weight, reps, options:{formula?} } | Estimated 1RM (Epley/Brzycki/Lombardi + average) and a %-of-1RM training table. |
deloadPlan | { trainingMax, goal } | A recovery-week prescription (~60% load, reduced volume). |
warmupSets | { weight, options:{steps?,units?} } | A warm-up ramp from the empty bar up to the working weight. |
goal ∈ strength / hypertrophy / endurance / fatLoss / maintain / gain / general. activity ∈ sedentary / light / moderate / active / veryActive. options.units ∈ lb (default) / kg.
Usage
import pack from './index.js';
pack.adapters.oneRepMax({ weight: 225, reps: 5 });
// -> { estimates:{epley,brzycki,lombardi}, oneRepMax: ~253, percentages:{'90%':...} }
pack.adapters.macros({ weight: 180, goal: 'hypertrophy', activity: 'active' });
// -> { calories, macros:{protein,carbs,fat}, percent:{...} }
pack.adapters.workoutSplit({ daysPerWeek: 5, goal: 'strength' });
// -> { split:'Push / Pull / Legs + Upper/Lower', days:[...] }
DRY boundaries
- Training + performance nutrition only. General body metrics (BMI, standalone BMR, body-fat)
and biorhythm cycles live in other packs. The Mifflin-St Jeor BMR here is an internal step of the calorieTarget formula, not a public body-metric tool.
- Self-contained: the only cross-pack import is
../_shared/llm.js. - Pure ESM, Node built-ins only, zero npm deps.