Skip to main content

Workout Library

A workout library is a flat collection of reusable workout templates. Each workout is a complete, self-contained definition that can be referenced or embedded in programs and standalone workouts.

Document Format

{
"openset_version": "1.0",
"type": "workout_library",
"id": "my-workout-library",
"name": "My Workout Library",
"version": "1.0.0",
"provider": "my-org",
"license": "MIT",
"workouts": [...]
}

Required Fields

FieldTypeDescription
openset_versionstringMust be "1.0"
typestringMust be "workout_library"
idstringUnique library identifier
namestringHuman-readable library name
versionstringSemantic version of the library
providerstringOrganization or author
licensestringLicense identifier (e.g. "MIT")
workoutsarrayArray of workout definitions

Workout Definition

Each workout in the workouts array is a complete workout template:

{
"id": "upper_body_push",
"name": "Upper Body Push",
"description": "Horizontal and vertical pressing",
"tags": ["upper_body", "push", "strength"],
"level": "intermediate",
"duration": { "value": 60, "unit": "min" },
"sports": ["strength"],
"library": { "id": "openset-default", "version": "1.0.0" },
"blocks": [...]
}

Required Fields

FieldTypeDescription
idstringUnique snake_case identifier within the library
namestringHuman-readable workout name
blocksarrayArray of blocks (same structure as standalone workouts)

Optional Fields

FieldTypeDescription
descriptionstringFree-text description
tagsstring[]Searchable tags
levelstringOne of: beginner, intermediate, advanced, elite
durationobjectEstimated duration object with numeric value and unit from `s
sportsstring[]Target sports or activities
notestringGeneral notes
libraryobjectReference to an exercise library ({ id, version })
mediaobjectVideos and photos ({ videos, photos })

Relationship to Exercise Libraries

Workout libraries can reference exercise libraries. Exercises within workout blocks can use exercise_id to reference exercises from any library, or use inline name for ad-hoc exercises.

{
"library": { "id": "openset-default", "version": "1.0.0" },
"blocks": [{
"series": [{
"execution_mode": "SEQUENTIAL",
"exercises": [
{ "exercise_id": "bench_press", "sets": [...] },
{ "name": "Custom Drill", "sets": [...] }
]
}]
}]
}

Validation

The @diby/openset-validator validates workout library documents:

  • The workouts array must be non-empty
  • Each workout must have id, name, and blocks
  • Workout IDs must be unique within the library
  • Inner blocks are validated using the same rules as standalone workouts
  • W006 ("Workout has no date") is suppressed for library workouts since they are templates