AGENTS.md
Guidance for coding agents working on AlexandrAI Tools One Rep Max in the alexandrai-tools project.
Project overview
This guide covers src/tools/one-rep-max. epley returns the input weight for one rep and otherwise applies the Epley formula with rounding. brzycki returns the input weight for one rep, returns NaN for reps 37 or higher, and otherwise applies the Brzycki formula with rounding. ormTable builds nine descending percentage rows for both formula outputs.
Primary source files
- src/tools/one-rep-max/index.ts defines meta, epley, brzycki, OrmRow, PCT_LEVELS, and ormTable.
- src/tools/one-rep-max/index.test.ts covers one-rep behavior, five-rep examples, Brzycki invalid reps, nine table rows, first-row matching, and descending percentages.
- src/tools/one-rep-max/Body.astro owns weight and rep inputs plus table rendering.
- src/tools/one-rep-max/i18n.ts owns localized labels.
- src/lib/tools.ts registers the tool metadata.
Setup commands
npm install npm test npm run typecheck npm run build npm run dev
Change rules
- Return the input weight unchanged when reps equals one.
- Round Epley and Brzycki estimates to whole weight units.
- Return NaN for Brzycki when reps are 37 or greater.
- Keep percentage rows in descending order from 100 through 60.
- Propagate NaN Brzycki values through the table rather than hiding formula limits in the helper.
- Document formula assumptions in UI copy.
- Avoid implying the estimate is a safe lifting prescription.
Testing
Test one-rep inputs, common multi-rep examples, high-rep Brzycki invalid output, table row count, percentage order, formula consistency, UI formatting of NaN, and invalid input handling.
PR checklist
- npm test passes for one-rep-max.
- Calculator formulas, units, and rounding rules are documented.
- Health and fitness outputs keep informational safety scope.
- UI labels, validation, and pure helper tests stay aligned.