Skip to main content

Exercise YAML Format

Exercises are stored as YAML files in mo-docs and seeded into the app database.


File Structure

mo-docs/data/exercises/
├── push/
│ ├── bench-press.yaml
│ ├── incline-dumbbell-press.yaml
│ └── ...
├── pull/
│ ├── barbell-row.yaml
│ ├── pull-up.yaml
│ └── ...
├── legs/
│ ├── back-squat.yaml
│ ├── romanian-deadlift.yaml
│ └── ...
└── core/
├── plank.yaml
└── ...

YAML Schema

# Required fields
name: "Barbell Bench Press"
slug: "barbell-bench-press"
category: "chest"
movementPattern: "horizontal_push"

# Muscle targeting
primaryMuscles:
- "chest"
secondaryMuscles:
- "front_delts"
- "triceps"

# Equipment and difficulty
equipment:
- "barbell"
- "bench"
difficulty: "intermediate"
priority: "essential" # essential, common, specialized, niche
exerciseUse: "training" # training, warmup, both

# Instructions
instructions:
- "Lie on bench with eyes under the bar"
- "Grip bar slightly wider than shoulder width"
- "Unrack and lower to mid-chest"
- "Press up to lockout"

tips:
- "Keep shoulder blades pinched together"
- "Drive feet into the floor"
- "Control the descent"

commonMistakes:
- "Flaring elbows too wide"
- "Bouncing bar off chest"
- "Lifting hips off bench"

# Relationships (optional)
variations:
- "close-grip-bench-press"
- "pause-bench-press"
alternatives:
- "dumbbell-bench-press"
- "push-up"
progressions:
- "weighted-bench-press"
regressions:
- "push-up"

Field Definitions

Required Fields

FieldTypeDescription
namestringDisplay name
slugstringURL-safe identifier
categorystringPrimary muscle category
movementPatternenumMovement pattern classification

Muscle Fields

FieldTypeDescription
primaryMusclesstring[]Main muscles worked
secondaryMusclesstring[]Supporting muscles

Classification

FieldTypeValues
equipmentstring[]Required equipment
difficultyenumbeginner, intermediate, advanced
priorityenumessential, common, specialized, niche
exerciseUseenumtraining, warmup, both

Instruction Fields

FieldTypeDescription
instructionsstring[]Step-by-step execution
tipsstring[]Form cues and optimization
commonMistakesstring[]Errors to avoid

Relationship Fields

FieldTypeDescription
variationsstring[]Slug refs to variations
alternativesstring[]Slug refs to alternatives
progressionsstring[]Slug refs to harder versions
regressionsstring[]Slug refs to easier versions

Movement Patterns

PatternDescription
horizontal_pushPressing away from body (bench press)
vertical_pushPressing overhead (OHP)
horizontal_pullPulling toward body (rows)
vertical_pullPulling down/up (pull-ups)
squatKnee-dominant leg (squats)
hingeHip-dominant leg (deadlifts)
lungeSingle-leg movements
coreAnti-rotation, flexion, stability
isolationSingle-joint movements

Priority Levels

PriorityDescriptionUsage
essentialMust-have exercisesAlways suggested first
commonStandard exercisesRegular suggestions
specializedNiche applicationsEquipment/goal specific
nicheRare use casesOnly when specifically needed

Validation

Before seeding, YAML files are validated for:

  1. Required fields present
  2. Valid enum values
  3. Slug uniqueness
  4. Valid relationship references (slugs exist)
  5. Proper YAML syntax

Seeding

# Run seed script
npx tsx lib/db/seed-exercises.ts

The seed script:

  1. Reads all YAML files from mo-docs
  2. Validates each exercise
  3. Upserts to database (by slug)
  4. Creates exercise_relationships entries