id: swim.threshold
name: Threshold Swim
sport: swim
type: threshold
category: threshold

params:
  reps:
    type: int
    required: true
    default: 10
    min: 6
    max: 16
    description: Number of 100m repeats at CSS pace
  rest_secs:
    type: int
    default: 10
    description: Rest between 100m repeats in seconds

structure:
  warmup:
    - type: warmup
      name: Easy swim
      distance: 400m
      duration: 8min
      pace: Easy
      intensity: Zone 1
    - type: warmup
      name: Build set
      description: "4x50m build 1-4"
      duration: 5min
      intensity: Zone 1-3
  main:
    - type: intervals
      repeats: "${reps}"
      work:
        type: work
        name: 100m @ CSS
        distance: 100m
        pace: "${paces.css}"
        intensity: Zone 4
      recovery:
        type: recovery
        name: Rest
        duration: "${rest_secs}s"
  cooldown:
    - type: cooldown
      name: Easy swim
      distance: 200m
      pace: Very easy
      intensity: Zone 1

humanReadable: |
  THRESHOLD SWIM

  WARM-UP:
  - 400m easy
  - 4 x 50m build (1-4)

  MAIN SET:
  ${reps} x 100m @ CSS pace
  Pace: ${paces.css}/100m
  Rest: ${rest_secs}s between each

  Maintain consistent pace throughout.
  This is "comfortably hard" - sustainable but challenging.

  COOL-DOWN: 200m easy

  Total: ~${400 + 200 + (reps * 100) + 200}m

estimatedDuration: "${13 + (reps * 2) + 4}"
targetZone: Z4
rpe: "7"
notes: Develops lactate threshold at CSS pace
