Language reference
A scannable cheat sheet. For explanations and examples, see Getting started, Sets & syntax, and Progressions & hooks. For the full hook and macro reference, see Lifecycle hooks and Progression macros.
Directives
| Directive | Purpose |
|---|---|
@version 1 | Required. Pins syntax stability |
@name "..." | Program name |
@author "..." | Author |
@description "..." | Long description |
@difficulty <level> | beginner · intermediate · advanced · elite |
@category <cat> | powerlifting · bodybuilding · strength · hypertrophy · conditioning · general |
@unit <unit> | Default weight unit: kg · lb · lbs |
Blocks
| Block | Purpose |
|---|---|
tm { ... } | Training maxes that @% percentages reference |
state { ... } | Program-wide variables (initial values) |
alias { ... } | Local exercise-name aliases |
substitutions { ... } | Approved exercise alternatives |
progression "name" (params) { ... } | Reusable progression rule |
week "name" { ... } | A training week of day blocks |
deload week "name" { scale: use: } | A scaled-down week |
day "name" { ... } | A training day of exercise blocks |
superset { ... } | Exercises sharing one rest timer |
Set forms
| Form | Meaning |
|---|---|
5 | 5 reps |
5+ / amrap | As many reps as possible |
8-12 | Rep range |
3x8 | 3 sets of 8 |
30s / 1m30s | Time-based set |
@%85 | 85% of this exercise's TM |
@%85 of Squat | 85% of another exercise's TM |
@135lbs / @60kg | Fixed weight |
@BW / @BW+20kg | Bodyweight (+ added load) |
warmup · drop · failure | Set flags |
Exercise-block options
| Option | Meaning |
|---|---|
rest: 3m | Rest between sets |
intensity: rpe / rir | Intensity logging mode |
notes: "..." | Coaching note |
using "macro" (args) | Attach a progression macro |
Hooks & variables
Hooks: on_set (after each set), on_complete (after the exercise). Read these inside hooks:
| Variable | Meaning |
|---|---|
completed | Did the set/exercise hit its target? |
completed_reps | Reps logged on the latest set |
target_reps | Target reps for the latest set |
total_reps | Total reps across the exercise |
current_weight | Weight used on the latest set |
set_index / set_count | Index / total of sets |
failed_sets | Count of sets that missed |
is_amrap / is_pr | Was it AMRAP / a PR? |
estimated_1rm | Estimated 1RM (in on_complete) |
unit_is_metric | 1 if the enrollment is in kg, 0 if lbs |
next_set_weight / next_set_reps | Writable in on_set to pre-fill the next set |
Training-max access: tm.self (this exercise) and tm.<exercise> (another, e.g. tm.bench).
State access: state.<name>.
Built-in functions
| Function | Returns |
|---|---|
round(x, n) | x rounded to the nearest n |
floor(x) / ceil(x) | Round down / up |
min(a, b) / max(a, b) | Smaller / larger |
clamp(x, lo, hi) | x constrained to [lo, hi] |
pct_of(weight, pct) | weight × pct |
rpe_to_pct(reps, rpe) | %1RM for a reps/RPE pair |
pick(cond, a, b) | a if cond is non-zero, else b |
Unit-aware increments
Weights in ReptoLang are raw numbers labelled with a unit — nothing ever converts kg ↔ lbs. To bump a
training max by the right amount for either kind of lifter, write a unit pair { <kg>, <lbs> }:
{ Akg, Blbs } is shorthand for pick(unit_is_metric, A, B). It needs exactly one kg and one lbs
weight (order doesn't matter) and is the one place a program may name both units — the suffixes only pick
a slot, so no conversion happens. Each slot must be a non-negative weight literal; a leading - is a
parse error (write a subtraction like tm.self -= { 2.5kg, 5lbs } instead).
Built-in progression macros
lp · lp_deload · dp · wave_lp — see Progressions & hooks.
How exercise names resolve
When you write an exercise name, ReptoLang matches it in this order:
- Script
alias— your local mappings. - Exact match — case-insensitive against the library name.
- Built-in alias — common shorthand (e.g.
OHP,Bench,RDL). - Fuzzy match — closest library name above a similarity threshold.
If nothing matches, the exercise is flagged unresolved and you map it on import. Browse every referenceable name in the exercise library.