You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,10 +12,13 @@ This document orients automation and human collaborators to the structure, conve
12
12
-`custom-exercises.js` merges Dropbox-backed custom exercises into `state.data`, assigns fresh identifiers, and exposes helpers for creating/syncing custom workout entries. Use its helpers instead of rebuilding catalogue math.
13
13
-`analytics-dashboard.js` powers the analytics tab, mapping Dropbox workouts + telemetry data into charts/statistics surfaced on the main site.
-`grouping-logic.js` and `superset-executor-v2.js` coordinate grouped/superset execution order; keep these aligned with the plan runner’s navigation expectations.
15
16
-`shared/weight-utils.js` — single source of truth for kg/lb conversions; also attaches itself to `window.WeightUtils` so the workout-time console can reuse the same math.
16
17
-`shared/echo-telemetry.js` — telemetry-processing helpers shared between the analytics dashboard and the workout-time console.
17
18
-`tests/` — committed `node:test` specs (builder serialization, plan storage, search, workout console flows, and custom-workout creation).
18
19
-`local-tests/` — lightweight Node-based test harness (builder, search, storage-sync, progression, and plan-runner tests).
20
+
-`Intensity_FAQ.md` — reference for how intensity techniques expand into micro-sets inside the workout-time app; keep it in sync with the builder dropdown and plan-runner behavior.
21
+
-`scripts/` — Node helpers for lint/format/test wrappers plus telemetry/superset simulators (`run-eslint.mjs`, `run-prettier.mjs`, `run-local-tests.mjs`, `analyze-echo-workout.mjs`, `simulate-group-transition.mjs`, etc.). Prefer these over ad hoc commands when reproducing issues.
19
22
20
23
## Key Flows
21
24
- The builder UI is data-driven: `js/context.js` initializes shared state; `js/builder.js` consumes that state to serialize plans. Keep mutations centralized in `context.js` helpers.
@@ -24,11 +27,15 @@ This document orients automation and human collaborators to the structure, conve
24
27
- The analytics tab relies on `analytics-dashboard.js` and the shared telemetry helpers. Update those modules in tandem if telemetry schemas change.
25
28
- Static assets are served as-is. No bundler is configured, so prefer vanilla JS modules and relative imports.
26
29
- For storage interactions in the plan builder, rely on `plan-storage.js` helpers. They normalise plan names, manage the plan index, and guard against localStorage failures. Avoid duplicating that logic elsewhere to keep UI state and persistence consistent.
30
+
- Grouped/superset workouts are driven by the `groupNumber` field emitted by the builder; `workout-time/grouping-logic.js` builds the grouped timeline and `superset-executor-v2.js` drives in-workout navigation. Keep these in sync so rest timing and round-robin ordering match the builder’s intent.
31
+
- Intensity techniques (Dropset, Rest-Pause, Slow negatives) are serialized via `js/storage.js` and expanded into micro-sets inside `workout-time/plan-runner.js`. Keep the options, defaults, and FAQ aligned whenever progression or intensity math changes.
27
32
28
33
## Development Tips
29
34
- Use `npx http-server .` or similar to preview pages locally. Both the root `index.html` and `workout-time/index.html` expect to run in a browser environment.
35
+
-`npm run dev` starts the local `http-server` on port 5173 against the repo root; prefer this for quick previews unless you need custom headers.
30
36
- Run `npm run test:unit` for the committed `tests/` suite and `npm run test:local` for the optional `local-tests/` harness; `npm test` runs both. Always exercise the relevant suite(s) before syncing Dropbox data or sending PRs.
31
37
- Run `npm run lint` before sending PRs so any trailing whitespace, loose equality, or rogue `var` declarations are caught early; `npm run format` will normalise whitespace/newlines when you need automatic fixes.
38
+
- For superset/debug flows without hardware, lean on `scripts/simulate-group-transition.mjs` or the `simulate-supertest*.mjs` helpers to iterate on grouping logic before hitting the UI.
32
39
- Maintain accessibility: new UI components should include keyboard support and ARIA labelling consistent with existing markup.
33
40
- After touching persistence or plan-index flows, update `plan-storage.js` first and adapt consumers (currently `js/main.js`) to avoid drift between cached plan state and saved plans.
34
41
- When documentation or instructions change (including this file), summarise the rationale in the PR description so future collaborators understand why guidance shifted.
@@ -41,8 +48,11 @@ This document orients automation and human collaborators to the structure, conve
41
48
- If any UI changes are made, take screenshots of new UI changes to ensure everything is working accordingly
42
49
- Always run tests
43
50
- When updating the workout builder (`js/`) or workout-time app (`workout-time/`), use the numeric `id_new` exercise identifier for new logic and persistence, keeping the legacy `id` only for backward compatibility.
51
+
- Keep grouped-exercise handling consistent across the builder, `workout-time/grouping-logic.js`, and `SupersetExecutorV2`; adjust `tests/superset-supertest.test.js` and related plan-runner specs if the navigation rules change.
52
+
- When tweaking intensity behaviors or progression math, update both UIs plus `Intensity_FAQ.md` so the dropdown options, serialization (`js/storage.js`), and micro-set expansion (`workout-time/plan-runner.js`) stay in lockstep.
44
53
45
54
## Outstanding Opportunities
46
55
- Wire the lint/test commands into CI (GitHub Actions or similar) so regressions are blocked automatically.
47
56
- Expand the workout-time coverage to include the rest-countdown DOM updates and audio cues alongside the telemetry auto-resume logic.
48
57
- Document the new shared weight utilities inside `workout-time/index.html` for future contributors and consider sharing additional helpers (e.g., unit labels, clamp logic) through the same module.
58
+
- Backfill automated coverage for intensity micro-sets and grouped navigation inside the workout-time plan runner to lock in the current behavior.
0 commit comments