endurance-coach-architecture-contractlisted
Install: claude install-skill maxeskell/personal-training-app
# Endurance Coach — architecture contract
**Use this when** you are designing or reviewing a change that touches the daily state, the data sources,
the write path, persistence, the dashboard HTML, or the LLM coach layer, and you need to know *what the
system guarantees and where those guarantees are enforced* so your change preserves them.
**Don't use this when** — a live thing is broken and you need to triage it (use
`endurance-coach-debugging-playbook`); you need the env-var catalog or a flag's meaning (use
`endurance-coach-config-and-flags`); you need the meaning/maths of a metric or the statistics internals (use
`endurance-domain-reference`, `endurance-coach-proof-and-analysis-toolkit`); or you're asking whether a
change may be committed/shipped (use `endurance-coach-change-control`, then `endurance-coach-run-and-operate`).
Jargon defined once, here:
- **AIE** = AI Endurance, the external coaching platform reached over **MCP** (Model Context Protocol, a
tool-call protocol) with **OAuth**. It owns the training-load science (FTP, CSS, thresholds, predictions,
recovery). We *consume* it; we never re-derive it.
- **AthleteState** = the one assembled daily object every downstream layer reads.
- **Provenanced<T>** = a value wrapped with where it came from: `{ value: T | null, source, note? }`.
- **Write gate** = the propose→confirm two-step that is the only path to mutating the AIE plan.
---
## The one-paragraph model
Local-first, single-athlete. Each day `assembleSta