@isparling/engram-coach 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +85 -18
- package/SETUP.md +559 -0
- package/SKILL_PACK.md +75 -0
- package/analyses/catalog.md +257 -0
- package/analysis-tools/hrv-trend.ts +592 -0
- package/analysis-tools/migrate-structured-capture.ts +234 -0
- package/analysis-tools/race-context.ts +96 -0
- package/analysis-tools/stream-analyze.ts +1008 -0
- package/analysis-tools/tsb-predict.ts +117 -0
- package/capture-handler.ts +301 -0
- package/config.json.example +21 -0
- package/engram-coach-ambient-capture.ts +336 -0
- package/engram-coach-capture-types.ts +185 -0
- package/engram-coach-config.ts +268 -0
- package/engram-coach-domain.ts +7 -2
- package/engram-coach-keys.ts +189 -0
- package/engram-coach-materialization.ts +638 -0
- package/engram-coach-migration.ts +1078 -0
- package/engram-coach-pack.ts +17 -12
- package/engram-coach-presentation.ts +10 -1
- package/engram-coach-reconciliation.ts +305 -2
- package/engram-coach-structured-capture.ts +622 -0
- package/package.json +39 -6
- package/personas/aggressive-monitoring.md +121 -0
- package/personas/aggressive.json +85 -0
- package/personas/conservative-monitoring.md +133 -0
- package/personas/conservative.json +93 -0
- package/personas/polarized-monitoring.md +112 -0
- package/personas/polarized.json +72 -0
- package/personas/volume-monitoring.md +85 -0
- package/personas/volume.json +108 -0
- package/shared/retrieval.md +71 -0
- package/shared/setup.md +207 -0
- package/skills/.gitkeep +0 -0
- package/skills/adapt-plan/SKILL.md +263 -0
- package/skills/block-review/SKILL.md +275 -0
- package/skills/consult/SKILL.md +176 -0
- package/skills/intake/SKILL.md +315 -0
- package/skills/lactate-analyze/SKILL.md +230 -0
- package/skills/lessons-rollup/SKILL.md +196 -0
- package/skills/monitoring-rollup/SKILL.md +208 -0
- package/skills/race-analysis/SKILL.md +219 -0
- package/skills/season-retrospective/SKILL.md +200 -0
- package/skills/set-goal/SKILL.md +297 -0
- package/templates/base.md +55 -0
- package/templates/build-1.md +57 -0
- package/templates/build-2.md +62 -0
- package/templates/race-report.md +51 -0
- package/templates/race-specificity.md +62 -0
- package/templates/season-review.md +40 -0
- package/engram-coach-extractor.ts +0 -295
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: consult
|
|
3
|
+
description: Use when seeking advice; whether a key workout has been completed, life circumstances are changed, where advice about the plan is needed. Requires Intervals.icu MCP tools and config.json with coaching_docs_dir and prescriptions_dir configured.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Consult
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Workflow for analysis of objective historical execution data, subjective athlete experience, existing workout prescriptions, and occurances in life outside of athletic endeavors. Provides evidence-based adjustments to the plan, and advice on balancing with life requirements. All reasoning is recorded as persistent knowledge in the coaching docs directory.
|
|
11
|
+
|
|
12
|
+
**This skill is RIGID — phases execute in exact order. Do not skip, reorder, or combine phases.**
|
|
13
|
+
|
|
14
|
+
## Workflow
|
|
15
|
+
|
|
16
|
+
```dot
|
|
17
|
+
digraph adapt_plan {
|
|
18
|
+
"Phase 1: Orient" [shape=box];
|
|
19
|
+
"Phase 2: Gather" [shape=box];
|
|
20
|
+
"Phase 3: Synthesize" [shape=box];
|
|
21
|
+
"Phase 4: Propose" [shape=box];
|
|
22
|
+
"Athlete approves?" [shape=diamond];
|
|
23
|
+
"Phase 5: Write" [shape=box];
|
|
24
|
+
|
|
25
|
+
"Phase 1: Orient" -> "Phase 2: Gather";
|
|
26
|
+
"Phase 2: Gather" -> "Phase 3: Synthesize";
|
|
27
|
+
"Phase 3: Synthesize" -> "Phase 4: Propose";
|
|
28
|
+
"Phase 4: Propose" -> "Athlete approves?";
|
|
29
|
+
"Athlete approves?" -> "Phase 5: Write" [label="yes"];
|
|
30
|
+
"Athlete approves?" -> "Phase 4: Propose" [label="revise"];
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
### Pre-Phase Setup _(no user input — run silently)_
|
|
37
|
+
|
|
38
|
+
Follow **`${CLAUDE_PLUGIN_ROOT}/shared/setup.md`** — the shared configuration
|
|
39
|
+
preamble (paths, config, profile, persona, athlete profile).
|
|
40
|
+
|
|
41
|
+
**Optional steps this skill declares:** PRESCRIPTIONS, SEASON, MCP, MONITORING
|
|
42
|
+
|
|
43
|
+
Do not proceed past a stop condition defined there.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### Phase 1 — Orient _(no user input)_
|
|
47
|
+
|
|
48
|
+
Read and search silently before asking anything:
|
|
49
|
+
|
|
50
|
+
1. **Weekly consultation** - Read `{coaching_docs_dir}/{season}/{training-phase}/consultations.md` to gain context on recent concerns athlete has raised with coach over this training phase.
|
|
51
|
+
2. **Historical adaptations** - Read `{coaching_docs_dir}/{season}/{training-phase}/{week}/.*-adaptation.md` records to understand historical adaptations and patterns tied to specific workouts.
|
|
52
|
+
3. **Active prescription/plan** — List all YAML files in `prescriptions_dir`. For each file, find the maximum session_date. The active block is the file whose most recent session_date is on or before today. If ambiguous (multiple files with recent sessions), ask: "I found multiple prescription files with recent sessions: [list]. Which block are you currently in?" Read the full prescription file for the active block and the surrounding block context (week number, phase, upcoming sessions).
|
|
53
|
+
4. **Training block context** — determine current phase (base/build/peak/recovery), position within the week, and upcoming workouts that may be affected by today's adaptation. After identifying the active block from step 1, resolve the block name to a template file name by stripping any date prefix and normalizing to lowercase with hyphens (e.g., "Build 1" → "build-1", "Base" → "base", "Race Specificity" → "race-specificity"). Then read `${CLAUDE_PLUGIN_ROOT}/templates/{block-name}.md` as additional context. This file describes the block's intent, session patterns, weekly structure, and success signals. If the file is missing: continue without it and annotate in the Orient summary: "[Block template {block-name}.md not found — proceeding without block template context.]"
|
|
54
|
+
|
|
55
|
+
5. **Retrieval — find precedent.** Follow `${CLAUDE_PLUGIN_ROOT}/shared/retrieval.md`.
|
|
56
|
+
Build 2-3 queries from *this session's specifics* — the session type, the numbers
|
|
57
|
+
actually observed, and any anomaly worth explaining — never from this skill's name
|
|
58
|
+
or topic. Cover both levels the policy describes: durable pattern, and session
|
|
59
|
+
precedent. Report honestly when nothing relevant is found.
|
|
60
|
+
|
|
61
|
+
Announce what you found before asking anything. If past decisions are relevant (e.g., "Last time RPE was high on week 2 sub-LT2, we reduced interval count by one"), surface them explicitly.
|
|
62
|
+
|
|
63
|
+
### Phase 2 Gather _(one question at a time)_
|
|
64
|
+
|
|
65
|
+
Ask only what execution data cannot answer. Adapt to what the data shows — if a specific pattern is visible (e.g., power fade >10% on final interval), ask specifically about that observation rather than generically.
|
|
66
|
+
|
|
67
|
+
1. Do you have concerns about the plan? Has something come up that I should know about?
|
|
68
|
+
|
|
69
|
+
If the answer to the first question doesn't provide enough context to work with, ask a few more questions to prompt athlete, for example:
|
|
70
|
+
1. Are you sick?
|
|
71
|
+
2. Are you more or less tired than expected?
|
|
72
|
+
3. Is work overly stressful?
|
|
73
|
+
|
|
74
|
+
**Ask one question at a time. Wait for each answer before asking the next.**
|
|
75
|
+
|
|
76
|
+
### Phase 3 — Synthesize _(shown to athlete)_
|
|
77
|
+
|
|
78
|
+
Reason aloud before proposing anything. Cover:
|
|
79
|
+
|
|
80
|
+
- Sickness
|
|
81
|
+
- Expected tireness, how that tracks to where athlete is in the phase/plan, threshold classification (green/amber/red per persona thresholds), and how it interacts with the existing signal picture (TSB/HRV/CTL).
|
|
82
|
+
- Consult the persona's monitoring.md `## Analysis Interpretation` section for the interpretation framework and coaching voice for each analysis. Higher-weight analyses (as configured in the persona's `analyses` config) receive more reasoning space; lower-weight analyses are mentioned briefly. Analyses that **reinforce** the existing signal picture (e.g., decoupling green while TSB is in push zone) are noted concisely. Analyses that **contradict** the existing signal picture (e.g., decoupling red while TSB is in push zone) are called out explicitly with the specific signal interaction from the monitoring.md — these contradictions are the high-value findings that may change the recommendation.
|
|
83
|
+
- Subjective data weighted against objective data (e.g., low RPE despite power fade → pacing issue, not fitness gap)
|
|
84
|
+
- Training block position — implications differ between early build (accumulate) and peak week (preserve)
|
|
85
|
+
- Upcoming workout demands — does the next session's intensity change the calculus?
|
|
86
|
+
- Emphasis relevant patterns from QMD history. Call out if this matches prior lessons/patterns/successes/mistakes.
|
|
87
|
+
- Reference ATHLETE_PROFILE.md when patterns from prior blocks are relevant to the consultation question. Cite the source tag in your reasoning so the athlete can trace the basis (e.g., "based on the recovery pattern from `[block-review:build-1-2026]`").
|
|
88
|
+
|
|
89
|
+
Alongside the reasoning above, assemble the typed domain input for this consultation as a `StructuredChangeSet`. If Phase 3 reasoning concludes the prescription should change, emit **one state change** containing:
|
|
90
|
+
|
|
91
|
+
- `entity_type: "prescription"` with `key_components` carrying `arc_id` and the durable `session_id`
|
|
92
|
+
- the effective date of the change
|
|
93
|
+
- a concise statement of what changes and why
|
|
94
|
+
- the COMPLETE updated prescription session value — never a prose patch. The value must carry every field of the session: `sessionId`, `sessionDate`, `sessionName`, block metadata (`blockName`, `week`, `day`), `order`, `effortZone`, and the full `intervals` array (each with `durationMin`, `powerLowPct`, `powerHighPct`, `count`, `recoveryMin`)
|
|
95
|
+
- the artifact relative path (e.g. `prescriptions/{arc_id}.yaml`)
|
|
96
|
+
|
|
97
|
+
Also emit **one consultation event** containing:
|
|
98
|
+
|
|
99
|
+
- the athlete's question or concern
|
|
100
|
+
- the subjective inputs gathered (sickness, fatigue, life stress)
|
|
101
|
+
- the decision rationale linking Phase 3 evidence to the action
|
|
102
|
+
- `action_targets`: the session IDs the decision acts on
|
|
103
|
+
- the compatibility path of the consultation log (e.g. `coaching/consultations.md`)
|
|
104
|
+
|
|
105
|
+
If no prescription change is warranted, the change set carries only the consultation event.
|
|
106
|
+
|
|
107
|
+
**Monitoring contributions (merged BEFORE Phase 4)**
|
|
108
|
+
|
|
109
|
+
Before Phase 4 begins, collect due monitoring contributions so ONE preview
|
|
110
|
+
covers everything:
|
|
111
|
+
|
|
112
|
+
1. Invoke the `monitoring-rollup` skill in **CONTRIBUTION MODE** with
|
|
113
|
+
`source = consult:{YYYY-MM-DD}` and the context already gathered this
|
|
114
|
+
session. It reads `{coaching_docs_dir}/tracking/concerns.yaml`, gathers
|
|
115
|
+
any DUE active concern, and RETURNS typed `state_changes` (keyed
|
|
116
|
+
`monitoring:<concern-id>:<signal>` current state) and append-only
|
|
117
|
+
`events` — it never previews, never applies, and never writes.
|
|
118
|
+
2. Merge both arrays into THIS change set. The merged change set is what
|
|
119
|
+
Phase 4 previews: one plan hash and one approval cover the prescription
|
|
120
|
+
change, the consultation event, and all due monitoring changes together.
|
|
121
|
+
3. If no concern is active or due, monitoring-rollup returns EMPTY arrays.
|
|
122
|
+
Merge them and continue — the parent's single preview stands; never
|
|
123
|
+
produce a second preview for monitoring.
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
This phase is **explanatory only**. No changes proposed yet. The athlete can push back on any part of the reasoning before you proceed.
|
|
127
|
+
|
|
128
|
+
### Phase 4 — Propose/Answer _(requires explicit approval)_
|
|
129
|
+
|
|
130
|
+
Answer athlete's questions. Do not coddle the athlete. Propose specific changes to the plan, and **be realistic** about what matches the training goals. If there are multiple approaches, seek athlete's input for what fits their needs and be explicit about what the tradeoffs are, both within the training plan and inside the broader needs of their life.
|
|
131
|
+
|
|
132
|
+
For each change, explicitly state:
|
|
133
|
+
- **What** changes — interval count, duration, intensity target, rest period, structure
|
|
134
|
+
- **Why** — the specific reasoning from Phase 3 that drives this change
|
|
135
|
+
- **Tradeoffs** - what will have to change (whether other parts of plan, or outside scope of athletic endoavors, or anything else) to support this change.
|
|
136
|
+
|
|
137
|
+
**Before presenting anything**, call `engram_capture_preview` with the Phase 3 merged `StructuredChangeSet` — the single preview covers the prescription change, the consultation event, and any due monitoring contributions as one plan.
|
|
138
|
+
|
|
139
|
+
If the preview returns blocked, STOP: Phase 4 cannot proceed until the input is corrected and a preview succeeds.
|
|
140
|
+
|
|
141
|
+
Present TOGETHER, in one message:
|
|
142
|
+
|
|
143
|
+
1. The human coaching proposal. Answer athlete's questions; do not coddle the athlete. Propose specific changes to the plan, and **be realistic** about what matches the training goals. For each change state:
|
|
144
|
+
- **What** changes — interval count, duration, intensity target, rest period, structure
|
|
145
|
+
- **Why** — the specific reasoning from Phase 3 that drives this change
|
|
146
|
+
- **Tradeoffs** - what will have to change (whether other parts of plan, or outside scope of athletic endoavors, or anything else) to support this change.
|
|
147
|
+
2. The record plan from the preview: which records will be created, refined, superseded, or retired.
|
|
148
|
+
3. The generated compatibility artifact paths that will regenerate (e.g. `prescriptions/{arc_id}.yaml`, `coaching/consultations.md`).
|
|
149
|
+
4. The exact `plan_hash` from the preview result.
|
|
150
|
+
|
|
151
|
+
Ask for approval. Approval must explicitly cover BOTH the coaching action AND the record/artifact plan identified by that exact `plan_hash` — approving the advice approves the durable mutation of the same content.
|
|
152
|
+
|
|
153
|
+
Wait for **explicit approval, rejection, or modification**. On modification, rebuild the change set, re-run `engram_capture_preview`, and present the new hash.
|
|
154
|
+
|
|
155
|
+
### Phase 5 — Apply _(with approved hash)_
|
|
156
|
+
|
|
157
|
+
Call `engram_capture_apply` with ONLY the exact `plan_hash` the athlete approved. Never edit any file directly — every prescription YAML, the consultation log, and the qmd index are updated by the apply pipeline (records → guarded index refresh → regenerated compatibility views).
|
|
158
|
+
|
|
159
|
+
Outcome handling:
|
|
160
|
+
|
|
161
|
+
- **stale**: the records changed since preview. Return to Phase 4: re-run `engram_capture_preview`, present the fresh record plan and new `plan_hash`, and obtain fresh athlete approval before applying again.
|
|
162
|
+
- **apply failure**: stop Phase 5. No compatibility view is written and none may be edited by hand; diagnose and retry through the tools.
|
|
163
|
+
- **committed with a stale index or stale views**: the records ARE authoritative — report the authoritative record IDs to the athlete and the exact retry state: re-calling `engram_capture_apply` with the SAME committed `plan_hash` in the same session reruns only materialization and never re-approves or re-applies the record mutations.
|
|
164
|
+
- **committed clean**: report the applied record IDs.
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Key Constraints
|
|
169
|
+
|
|
170
|
+
| Rule | Detail |
|
|
171
|
+
| -------------------------- | --------------------------------------------------------------------------------------------------- |
|
|
172
|
+
| Rigid phases | Execute in order — no skipping, reordering, or combining |
|
|
173
|
+
| Approval gate | Nothing written until Phase 4 explicitly approved |
|
|
174
|
+
| One question at a time | Phase 2 never batches questions |
|
|
175
|
+
| Reasoning before proposing | Phase 3 must complete before Phase 4 begins |
|
|
176
|
+
| Knowledge compounds | Every adaptation recorded in `{coaching_docs_dir}/{season}/`; future Orient phases benefit from past decisions |
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: intake
|
|
3
|
+
description: One-time coaching setup. Discovers athlete goals, maps to a coaching persona (or creates one from an existing coach's philosophy), migrates historical adaptation records, and writes config.json. Run this before invoking any other skill for the first time, or when onboarding a new season or athlete.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Coaching Intake
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Rigid five-phase intake workflow. Establishes everything engram-coach needs to start coaching: goals, persona, prescriptions, and coaching docs path. Phases execute in exact order.
|
|
11
|
+
|
|
12
|
+
**This skill is RIGID — phases execute in exact order. Do not skip, reorder, or combine phases.**
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
### Pre-Phase Setup _(no user input — run silently)_
|
|
17
|
+
|
|
18
|
+
Follow **`${CLAUDE_PLUGIN_ROOT}/shared/setup.md`** — the shared configuration
|
|
19
|
+
preamble (paths, config, profile, persona, athlete profile).
|
|
20
|
+
|
|
21
|
+
**Optional steps this skill declares:** SEASON
|
|
22
|
+
|
|
23
|
+
Do not proceed past a stop condition defined there.
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Phase 1 — Goals
|
|
27
|
+
|
|
28
|
+
Ask these three questions in a single message:
|
|
29
|
+
|
|
30
|
+
1. **What is your primary goal?**
|
|
31
|
+
(e.g., race, target event, performance goal, health and fitness maintenance)
|
|
32
|
+
2. **What is the target date?**
|
|
33
|
+
(e.g., "May 2, 2026" — or "no specific date / ongoing")
|
|
34
|
+
3. **What is your primary sport or modality?**
|
|
35
|
+
(e.g., cycling, running, triathlon, swimming, multi-sport)
|
|
36
|
+
|
|
37
|
+
After the athlete answers, summarize what was heard in 2-3 sentences. Confirm before continuing.
|
|
38
|
+
|
|
39
|
+
> If the athlete asks to skip a question, accept a placeholder and continue — do not block on any single field.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
### Phase 2 — Plan History
|
|
44
|
+
|
|
45
|
+
Ask: **"Have you been following a formal training plan or working with a coach?"**
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
#### Path A: Existing plan or coach
|
|
50
|
+
|
|
51
|
+
Ask two questions together:
|
|
52
|
+
|
|
53
|
+
1. **What is the plan or coach's name?**
|
|
54
|
+
(e.g., "a volume-focused plan", "a sweet-spot base plan", "a polarized coach", "just following a generic program")
|
|
55
|
+
2. **Describe their philosophy in a sentence or two.**
|
|
56
|
+
(e.g., "lots of volume, mostly easy Z1/Z2 riding", "hard threshold intervals with minimal easy work", "very conservative — always backed off when tired", "polarized: long easy plus hard VO2max efforts")
|
|
57
|
+
|
|
58
|
+
Based on the description, recommend one of the four built-in personas. Present all four so the athlete can compare:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
conservative — Health-first. HRV veto: if HRV drops, the day is easy regardless of other signals.
|
|
62
|
+
Errs toward rest when signals conflict. Requires high freshness for hard sessions.
|
|
63
|
+
|
|
64
|
+
aggressive — Load-maximizing. Tolerates deep fatigue. Weighted scoring — no HRV veto.
|
|
65
|
+
Pushes hard sessions when there is any reasonable basis to train hard.
|
|
66
|
+
|
|
67
|
+
polarized — 80/20 intensity split. Long easy sessions in Z1 plus hard VO2max efforts in Z4.
|
|
68
|
+
Eliminates moderate-intensity (sweet spot / tempo) work.
|
|
69
|
+
|
|
70
|
+
volume — High-volume aerobic accumulation. 14-day CTL trend window as a primary signal.
|
|
71
|
+
Permissive fatigue tolerance within the full recovery and session-quality picture.
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
State the recommendation and explain why (one sentence connecting the athlete's description to the persona's philosophy).
|
|
75
|
+
|
|
76
|
+
Ask: **"Does this match the philosophy you've been training under? Or would you like to create a custom persona based on your coach's actual thresholds and approach?"**
|
|
77
|
+
|
|
78
|
+
- If the athlete accepts a built-in: note the chosen slug for Phase 4.
|
|
79
|
+
- If they want a custom persona: say "To create a custom persona, I'll need your coach's specific thresholds and logic. Open `PERSONA_SCHEMA.md` in the engram-coach repo for the required field list — we can fill it in together now, or you can do it separately and set `active_persona` to your new slug in `config.json`." Proceed with intake using a placeholder slug and note in the intake record that the custom persona is pending.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
Ask: **"Do you have historical coaching records or adaptation notes from this training block?"**
|
|
84
|
+
|
|
85
|
+
(e.g., notes from the coach, adaptation records you've been keeping, a coaching journal)
|
|
86
|
+
|
|
87
|
+
- **If yes:** Ask for the directory path where these files live. Then run:
|
|
88
|
+
```
|
|
89
|
+
cd {path}
|
|
90
|
+
qmd update
|
|
91
|
+
```
|
|
92
|
+
Note how many files were indexed. Say: "I've indexed {N} documents from {path}. These will be available as reasoning context in future skill invocations."
|
|
93
|
+
- **If no:** Say: "No problem — coaching history will be built from this session onward."
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
#### Path B: No formal plan
|
|
98
|
+
|
|
99
|
+
Ask four questions in a single message to identify the right persona:
|
|
100
|
+
|
|
101
|
+
1. **When your training signals conflict** (e.g., low HRV but you feel physically ready), do you prefer to back off and protect recovery, or trust how you feel and train hard?
|
|
102
|
+
2. **During build periods**, are you comfortable accumulating significant fatigue for weeks at a time, or do you prefer more frequent lighter recovery days?
|
|
103
|
+
3. **For hard sessions**, do you prefer polarized training (long easy plus hard VO2max intervals, nothing in between), or mixed-zone work (sweet spot, tempo, threshold)?
|
|
104
|
+
4. **Is your primary training concern** injury prevention and long-term health, or maximizing performance at a target event?
|
|
105
|
+
|
|
106
|
+
Based on answers, apply this mapping:
|
|
107
|
+
- Q1 "back off" + Q4 "health" → **conservative**
|
|
108
|
+
- Q1 "trust feeling" + Q2 "comfortable with fatigue" + Q4 "performance" → **aggressive**
|
|
109
|
+
- Q3 "polarized" → **polarized** (regardless of other answers)
|
|
110
|
+
- Q2 "comfortable with significant fatigue" + Q4 "performance" + Q1 "moderate" → **volume**
|
|
111
|
+
|
|
112
|
+
State the recommendation with a one-sentence explanation connecting the athlete's answers to the persona's philosophy. Ask for confirmation.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
Ask: **"Do you have a prescription file (training plan YAML) already, or would you like help creating one?"**
|
|
117
|
+
|
|
118
|
+
- If existing prescription: go to Phase 3A
|
|
119
|
+
- If creating new: go to Phase 3B
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
### Phase 3A — Existing Prescription
|
|
124
|
+
|
|
125
|
+
Ask: **"What is the path to your prescriptions directory?"**
|
|
126
|
+
(The directory that contains your training plan YAML files — e.g., `~/code/training/prescriptions/`)
|
|
127
|
+
|
|
128
|
+
Check that the path exists and contains at least one `.yaml` or `.yml` file.
|
|
129
|
+
|
|
130
|
+
- If it exists and has YAML files: confirm the directory and list the file(s) found. Note the path for Phase 4.
|
|
131
|
+
- If it does not exist or has no YAML files: stop and output:
|
|
132
|
+
> "No prescription files found at `{path}`. Prescription YAMLs define your session-by-session training plan and are required before `adapt-plan` can run. See `PRESCRIPTION_FORMAT.md` in this repo for the schema and an example. Create at least one file there and re-run intake."
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
### Phase 3B — New Prescription (guided creation)
|
|
137
|
+
|
|
138
|
+
Ask four questions together:
|
|
139
|
+
|
|
140
|
+
1. **What training block are you starting?**
|
|
141
|
+
(base / build-1 / build-2 / race-specificity)
|
|
142
|
+
2. **How many weeks is this block?**
|
|
143
|
+
3. **How many training days per week do you plan?**
|
|
144
|
+
4. **Which days are key sessions** (high-intensity or long endurance), and which are easy/recovery?
|
|
145
|
+
|
|
146
|
+
Based on the answers, generate a skeleton YAML. Use this structure (adapt session count and names to match their answers):
|
|
147
|
+
|
|
148
|
+
```yaml
|
|
149
|
+
# {BlockType} — {N}-week block
|
|
150
|
+
# Generated by engram-coach intake. Fill in session_date values for each session
|
|
151
|
+
# and set power targets. See PRESCRIPTION_FORMAT.md for full field reference.
|
|
152
|
+
|
|
153
|
+
block_name: {block_slug} # e.g., build_1, base, race_specificity
|
|
154
|
+
|
|
155
|
+
sessions:
|
|
156
|
+
|
|
157
|
+
# Week 1
|
|
158
|
+
- week: 1
|
|
159
|
+
day: {KeyDay1}
|
|
160
|
+
session_date: YYYY-MM-DD # replace with actual date
|
|
161
|
+
session_name: W1_KeySession
|
|
162
|
+
total_duration_min: 90 # adjust to your target
|
|
163
|
+
warmup_power_low_pct: 40
|
|
164
|
+
warmup_power_high_pct: 65
|
|
165
|
+
cooldown_power_low_pct: 35
|
|
166
|
+
cooldown_power_high_pct: 45
|
|
167
|
+
intervals:
|
|
168
|
+
- duration_min: 10 # adjust interval length
|
|
169
|
+
power_low_pct: 85 # adjust to block type
|
|
170
|
+
power_high_pct: 92
|
|
171
|
+
count: 3
|
|
172
|
+
recovery_min: 5
|
|
173
|
+
recovery_power_low_pct: 45
|
|
174
|
+
recovery_power_high_pct: 55
|
|
175
|
+
|
|
176
|
+
- week: 1
|
|
177
|
+
day: {EasyDay1}
|
|
178
|
+
session_date: YYYY-MM-DD
|
|
179
|
+
session_name: W1_Endurance
|
|
180
|
+
total_duration_min: 120
|
|
181
|
+
effort_zone: Z1-Z2 # simple sessions use effort_zone instead of intervals
|
|
182
|
+
|
|
183
|
+
# (repeat pattern for remaining weeks)
|
|
184
|
+
# See PRESCRIPTION_FORMAT.md for all available fields
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Ask: **"Where should I save this file?"** (e.g., `~/code/training/prescriptions/build_1.yaml`)
|
|
188
|
+
|
|
189
|
+
Write the skeleton YAML to the specified path. Note the prescriptions directory (parent folder) for Phase 4.
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
### Phase 3C — Capture Model
|
|
194
|
+
|
|
195
|
+
Ask: **"Which provider/model should ambient conversation capture use?"**
|
|
196
|
+
(e.g., `anthropic/claude-sonnet-4-5`, `openai/gpt-5-mini` — an explicit
|
|
197
|
+
`provider/model` string.)
|
|
198
|
+
|
|
199
|
+
This model runs the separate headless extraction pass after each settled turn.
|
|
200
|
+
It is independent of the interactive session model and is never inherited from
|
|
201
|
+
it. If the athlete has no preference, recommend a small, inexpensive model:
|
|
202
|
+
extraction emits concise atomic candidate records, not coaching reasoning.
|
|
203
|
+
|
|
204
|
+
Record the exact `provider/model` string for Phase 4. Ambient capture cannot
|
|
205
|
+
run without it: if neither this value nor the `ENGRAM_COACH_CAPTURE_MODEL`
|
|
206
|
+
environment variable is configured, capture fails as a configuration error.
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
### Phase 4 — Configure
|
|
211
|
+
|
|
212
|
+
Assemble the `config.json` content using values collected during intake:
|
|
213
|
+
|
|
214
|
+
```json
|
|
215
|
+
{
|
|
216
|
+
"_comment": "Generated by engram-coach intake. config.json is gitignored — machine-specific paths are never tracked.",
|
|
217
|
+
"active_profile": "default",
|
|
218
|
+
"profiles": {
|
|
219
|
+
"default": {
|
|
220
|
+
"active_persona": "{chosen-slug}",
|
|
221
|
+
"coaching_docs_dir": "{coaching-docs-path}",
|
|
222
|
+
"prescriptions_dir": "{prescriptions-path}",
|
|
223
|
+
"season": "{season-label}"
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
"capture": {
|
|
227
|
+
"model": "{provider/model from Phase 3C}",
|
|
228
|
+
"timeout_seconds": 60,
|
|
229
|
+
"max_candidates_per_turn": 3
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
For `capture`: write the exact `provider/model` string collected in Phase 3C
|
|
235
|
+
and exactly `timeout_seconds: 60` and `max_candidates_per_turn: 3`. The
|
|
236
|
+
`ENGRAM_COACH_CAPTURE_MODEL` environment variable, when set nonblank, overrides
|
|
237
|
+
**only** `capture.model`; the timeout and candidate limit always come from this
|
|
238
|
+
block.
|
|
239
|
+
|
|
240
|
+
For `season`: derive from the goal date (e.g., "May 2, 2026" → `"2026"`). If no date was given, ask: **"What season label should I use for coaching records?"** (e.g., `"2026"`, `"2026-spring"`)
|
|
241
|
+
|
|
242
|
+
For `coaching_docs_dir`: if not yet established (no Path A history migration and not previously configured), ask: **"Where should coaching records be written?"** (e.g., `~/code/training/docs/coaching`) Note: create the directory if it does not exist.
|
|
243
|
+
|
|
244
|
+
Show the assembled config.json content. Ask: **"Does this look correct? I'll write it to `{config_path}`."**
|
|
245
|
+
|
|
246
|
+
On confirmation:
|
|
247
|
+
- Write `{config_path}`
|
|
248
|
+
- If `coaching_docs_dir` does not exist on disk, create it: `mkdir -p {coaching_docs_dir}`
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
### Phase 5 — Intake Record
|
|
253
|
+
|
|
254
|
+
Write `{coaching_docs_dir}/{season}/intake.md`:
|
|
255
|
+
|
|
256
|
+
```markdown
|
|
257
|
+
---
|
|
258
|
+
date: {today ISO date}
|
|
259
|
+
type: intake
|
|
260
|
+
persona: {slug}
|
|
261
|
+
goal_event: {goal from Phase 1}
|
|
262
|
+
goal_date: {date from Phase 1}
|
|
263
|
+
sport: {modality from Phase 1}
|
|
264
|
+
prescription: {prescriptions_dir}
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
# Coaching Intake
|
|
268
|
+
|
|
269
|
+
## Goals
|
|
270
|
+
|
|
271
|
+
**Event:** {goal}
|
|
272
|
+
**Target date:** {date}
|
|
273
|
+
**Sport:** {modality}
|
|
274
|
+
|
|
275
|
+
## Coaching Persona
|
|
276
|
+
|
|
277
|
+
**Active persona:** {slug} — {one-sentence persona description}
|
|
278
|
+
|
|
279
|
+
**Selection rationale:** {why this persona was chosen — from Path A recommendation or Path B reasoning}
|
|
280
|
+
|
|
281
|
+
## Plan History
|
|
282
|
+
|
|
283
|
+
{If Path A: "Previously on: {plan/coach name}. {Philosophy description}. Mapped to {slug} because {reason}."}
|
|
284
|
+
{If Path A + history migration: "Historical coaching records indexed from {path} — {N} documents available via qmd query."}
|
|
285
|
+
{If Path B: "No prior formal plan. Persona selected based on intake questionnaire responses."}
|
|
286
|
+
|
|
287
|
+
## Prescription
|
|
288
|
+
|
|
289
|
+
**Prescriptions directory:** {path}
|
|
290
|
+
**Active block:** {block_name of first/only YAML found, or "pending — skeleton created at {path}"}
|
|
291
|
+
|
|
292
|
+
## Next Steps
|
|
293
|
+
|
|
294
|
+
1. Fill in `session_date` values in your prescription YAML if you used the skeleton generator
|
|
295
|
+
2. Run `qmd update` in the engram-coach repo after adding coaching docs
|
|
296
|
+
3. Invoke `adapt-plan` after completing a key session:
|
|
297
|
+
`Read and follow ./skills/adapt-plan.md`
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
Run `qmd update` in the engram-coach repo to index the intake record.
|
|
301
|
+
|
|
302
|
+
Output the completion summary:
|
|
303
|
+
|
|
304
|
+
```
|
|
305
|
+
✓ Intake complete
|
|
306
|
+
|
|
307
|
+
Persona: {slug}
|
|
308
|
+
Goal: {goal event} — {date}
|
|
309
|
+
Prescription: {prescriptions_dir}
|
|
310
|
+
Capture model: {provider/model}
|
|
311
|
+
Coaching docs: {coaching_docs_dir}
|
|
312
|
+
Intake record: {coaching_docs_dir}/{season}/intake.md
|
|
313
|
+
|
|
314
|
+
Next: Read and follow ./skills/adapt-plan.md after completing a key session.
|
|
315
|
+
```
|