/workout-log — Record a completed workout
Append a short session to the user's daily log. One file per day; a working
day can hold several short sessions. Logs are stored as YAML
(~/workout-coach/logs/<date>.yaml) so they're machine-parseable yet still
readable by hand.
Steps
Determine today's date. Run date +%F to get YYYY-MM-DD. Use this
for the filename and run date +%H:%M for the session time. (Don't trust a
remembered date — read it from the shell.)
Figure out what was done. Ideally this follows a /workout
proposal — match the user's reported reps against the planned exercises so
you can show planned-vs-actual. If there was no prior proposal, just ask
what they did (exercise, sets × reps) and record that.
Capture for each exercise: name, sets × actual reps, and (if known) the
planned target. Note anything the user mentions (felt easy/hard, pain).
Also capture, for the session as a whole:
- Trainer — the active persona, if any
(
cat ~/workout-coach/trainer.md 2>/dev/null → the ## Trainer line).
- Effort — an optional perceived-exertion note (e.g. RPE 7/10, or
"felt easy / felt brutal"). Ask briefly if the user didn't say.
Write to ~/workout-coach/logs/<today>.yaml.
- Run
mkdir -p ~/workout-coach/logs first.
- If the file doesn't exist, create it with
date: <today> and a
sessions: list containing this one session.
- If it already exists, read it first, then append a new entry to the
sessions: list; do NOT overwrite or drop earlier sessions from the
same day.
- Keep the YAML valid: quote any value containing
: or # (e.g. times
like "13:27" and planned strings like "4x10-12s"), and use the schema
below. Omit fields that don't apply rather than leaving them blank.
Confirm what you logged and give one short, encouraging takeaway (e.g.
progress vs. last session if visible). Offer another set later via
/workout if appropriate.
Keep the profile current. If, while reporting the session, the user
volunteers durable health/fitness info — a niggle that has resolved or
newly appeared, a change in level/equipment, or a hit/new PB or target —
propose updating ~/workout-coach/profile.md and confirm before
editing, then apply it with Edit and bump the _Last updated_ date
(date +%F). For PBs, also update the relevant "current best" under the
profile's PB targets. Only persist lasting changes; one-off effort/feeling
notes stay in the log, not the profile. Never rewrite the profile silently.
Update the plan if the session came from it. If ~/workout-coach/plan.md
exists (cat it), decide whether the session just logged was taken from
the plan — i.e. it matches a session the plan schedules for today, or the
/workout proposal / conversation indicates it was the planned one. A
session the user explicitly did off-plan does not count.
If it was taken from the plan:
- Tick adherence: under the plan's
## This week (adherence) section,
record the completed session with today's date (append a line; if the week
just rolled over, add a Week of <this Monday's date> heading). Compute
that Monday from the shell rather than by hand —
date -v-$(($(date +%u)-1))d +%F on macOS, or
date -d "-$(($(date +%u)-1)) days" +%F on GNU/Linux — the same way
today's date is read; don't trust a remembered date.
- Ratchet progression: compare the actual reps/sets/time against the
plan's
## Progression targets for those movements. If the user met or
beat the target per that movement's ratchet rule, bump the target up a
notch; if they fell short repeatedly, ease it back. Record the change
in the plan's ## Revision log with today's date.
- Bump the plan's
_Last updated_ date (date +%F).
Make these as in-place Edits — never rewrite the whole plan, and leave it
untouched for off-plan sessions.
Daily file format (YAML)
One file per day, ~/workout-coach/logs/<YYYY-MM-DD>.yaml:
date: 2026-06-15
sessions:
- time: "13:27" # HH:MM, quoted
label: Upper body & core # short human label
trainer: Bruce Lee # active persona, or omit if none
from_plan: Wed Slot 2 # plan slot it came from; omit if off-plan
off_plan: false # set true for an explicitly off-plan session
effort: RPE 7/10 # perceived exertion, or omit
exercises:
- name: Push-ups
sets: 4
reps: [12, 12, 12, 12] # per-set reps (a list), or a single int
planned: "4x12" # the prescribed target, quoted; omit if none
met: true # true if met/beat target, false if under
- name: L-sit hold
sets: 4
duration_s: [6, 5, 5, 6] # timed holds, seconds per set
planned: "4x10-12s"
met: false
- name: Run # cardio: use the fields that fit
distance_km: 3
duration: "17:45"
pace: "5:55/km"
met: true
notes: nailed everything but L-sit — out of practice on it
# append further same-day sessions as additional list items here
Field guide
- Per exercise, always give
name; then include only the fields that
apply: sets, reps (int or per-set list), duration_s (timed holds),
distance_km / duration / pace (cardio), weight_kg (loaded moves),
planned (the prescribed target as a quoted string), met (bool), and an
optional per-exercise note.
met records whether the target was hit: true when the user met or
beat the planned target, false when they came in under (no judgment — it's
just a signal for future scaling). Omit it when there was no planned target.
from_plan vs off_plan: set from_plan to the plan slot when the
session was taken from plan.md; set off_plan: true for an explicitly
off-plan session. (This is what step 6 keys off of.)
Keep entries terse. This file is the history that /workout, /workout-stats,
and /workout-plan read to balance future workouts and track progress.
1---2name: workout-log3description: Log a completed workout. The user reports how many reps/sets they actually did (usually against a workout that was just suggested), and this records it to a per-day YAML file at ~/workout-coach/logs/YYYY-MM-DD.yaml. Use when the user says "log my workout", "I did X reps", "done", "I finished my set", or wants to record exercise they completed.4---56# /workout-log — Record a completed workout78Append a short session to the user's daily log. One file per day; a working9day can hold several short sessions. Logs are stored as **YAML**10(`~/workout-coach/logs/<date>.yaml`) so they're machine-parseable yet still11readable by hand.1213## Steps14151. **Determine today's date.** Run `date +%F` to get `YYYY-MM-DD`. Use this16 for the filename and run `date +%H:%M` for the session time. (Don't trust a17 remembered date — read it from the shell.)18192. **Figure out what was done.** Ideally this follows a `/workout`20 proposal — match the user's reported reps against the planned exercises so21 you can show planned-vs-actual. If there was no prior proposal, just ask22 what they did (exercise, sets × reps) and record that.2324 Capture for each exercise: name, sets × actual reps, and (if known) the25 planned target. Note anything the user mentions (felt easy/hard, pain).26 Also capture, for the session as a whole:27 - **Trainer** — the active persona, if any28 (`cat ~/workout-coach/trainer.md 2>/dev/null` → the `## Trainer` line).29 - **Effort** — an optional perceived-exertion note (e.g. RPE 7/10, or30 "felt easy / felt brutal"). Ask briefly if the user didn't say.31323. **Write to `~/workout-coach/logs/<today>.yaml`.**33 - Run `mkdir -p ~/workout-coach/logs` first.34 - If the file **doesn't exist**, create it with `date: <today>` and a35 `sessions:` list containing this one session.36 - If it **already exists**, read it first, then **append a new entry to the37 `sessions:` list**; do NOT overwrite or drop earlier sessions from the38 same day.39 - Keep the YAML valid: quote any value containing `:` or `#` (e.g. times40 like `"13:27"` and planned strings like `"4x10-12s"`), and use the schema41 below. Omit fields that don't apply rather than leaving them blank.42434. **Confirm** what you logged and give one short, encouraging takeaway (e.g.44 progress vs. last session if visible). Offer another set later via45 `/workout` if appropriate.46475. **Keep the profile current.** If, while reporting the session, the user48 volunteers *durable* health/fitness info — a niggle that has resolved or49 newly appeared, a change in level/equipment, or a hit/new PB or target —50 **propose updating `~/workout-coach/profile.md` and confirm before51 editing**, then apply it with `Edit` and bump the `_Last updated_` date52 (`date +%F`). For PBs, also update the relevant "current best" under the53 profile's PB targets. Only persist lasting changes; one-off effort/feeling54 notes stay in the log, not the profile. Never rewrite the profile silently.55566. **Update the plan if the session came from it.** If `~/workout-coach/plan.md`57 exists (`cat` it), decide whether the session just logged was **taken from58 the plan** — i.e. it matches a session the plan schedules for today, or the59 `/workout` proposal / conversation indicates it was the planned one. A60 session the user explicitly did *off-plan* does **not** count.61 If it was taken from the plan:62 - **Tick adherence:** under the plan's `## This week (adherence)` section,63 record the completed session with today's date (append a line; if the week64 just rolled over, add a `Week of <this Monday's date>` heading). Compute65 that Monday from the shell rather than by hand —66 `date -v-$(($(date +%u)-1))d +%F` on macOS, or67 `date -d "-$(($(date +%u)-1)) days" +%F` on GNU/Linux — the same way68 today's date is read; don't trust a remembered date.69 - **Ratchet progression:** compare the actual reps/sets/time against the70 plan's `## Progression targets` for those movements. If the user **met or71 beat** the target per that movement's ratchet rule, bump the target up a72 notch; if they **fell short** repeatedly, ease it back. Record the change73 in the plan's `## Revision log` with today's date.74 - Bump the plan's `_Last updated_` date (`date +%F`).75 Make these as in-place `Edit`s — never rewrite the whole plan, and leave it76 untouched for off-plan sessions.7778## Daily file format (YAML)7980One file per day, `~/workout-coach/logs/<YYYY-MM-DD>.yaml`:8182```yaml83date: 2026-06-1584sessions:85 - time: "13:27" # HH:MM, quoted86 label: Upper body & core # short human label87 trainer: Bruce Lee # active persona, or omit if none88 from_plan: Wed Slot 2 # plan slot it came from; omit if off-plan89 off_plan: false # set true for an explicitly off-plan session90 effort: RPE 7/10 # perceived exertion, or omit91 exercises:92 - name: Push-ups93 sets: 494 reps: [12, 12, 12, 12] # per-set reps (a list), or a single int95 planned: "4x12" # the prescribed target, quoted; omit if none96 met: true # true if met/beat target, false if under97 - name: L-sit hold98 sets: 499 duration_s: [6, 5, 5, 6] # timed holds, seconds per set100 planned: "4x10-12s"101 met: false102 - name: Run # cardio: use the fields that fit103 distance_km: 3104 duration: "17:45"105 pace: "5:55/km"106 met: true107 notes: nailed everything but L-sit — out of practice on it108 # append further same-day sessions as additional list items here109```110111### Field guide112- **Per exercise**, always give `name`; then include only the fields that113 apply: `sets`, `reps` (int or per-set list), `duration_s` (timed holds),114 `distance_km` / `duration` / `pace` (cardio), `weight_kg` (loaded moves),115 `planned` (the prescribed target as a quoted string), `met` (bool), and an116 optional per-exercise `note`.117- **`met`** records whether the target was hit: `true` when the user met or118 beat the planned target, `false` when they came in under (no judgment — it's119 just a signal for future scaling). Omit it when there was no planned target.120- **`from_plan`** vs **`off_plan`**: set `from_plan` to the plan slot when the121 session was taken from `plan.md`; set `off_plan: true` for an explicitly122 off-plan session. (This is what step 6 keys off of.)123124Keep entries terse. This file is the history that `/workout`, `/workout-stats`,125and `/workout-plan` read to balance future workouts and track progress.