AGENTS.md
Guidance for coding agents working on AlexandrAI Tools Ideal Weight in the alexandrai-tools project.
Project overview
This guide covers src/tools/ideal-weight/index.ts. The tool converts height to inches over five feet, applies four ideal body weight formulas for male or female inputs, rounds each estimate to one decimal place, returns the low and high range, and supports imperial input by converting to centimeters.
Primary source files
- src/tools/ideal-weight/index.ts defines meta, Sex, IdealWeightResult, idealWeightMetric, idealWeightImperial, and kgToLb.
- src/tools/ideal-weight/index.test.ts covers male and female formulas, low and high bounds, sex differences, five-foot baseline, imperial parity, and kg-to-pound conversion.
- src/tools/ideal-weight/Body.astro owns browser inputs.
- src/tools/ideal-weight/i18n.ts owns localized copy.
- src/lib/tools.ts registers metadata.
Setup commands
npm install npm test npm run typecheck npm run build npm run dev
Change rules
- Clamp inches above five feet to zero for shorter heights.
- Round each formula output to one decimal place.
- Compute low and high from the rounded formula values.
- Keep imperial input as a conversion wrapper around metric logic.
- Do not present ideal weight formulas as medical diagnosis or universal goals.
- If formula names or coefficients change, update tests and copy together.
- Keep kgToLb output rounded to one decimal place.
Testing
Test each formula for male and female inputs, five-foot baseline, shorter-than-baseline behavior, low and high range, imperial conversion parity, kgToLb conversion, and rounding.
PR checklist
- npm test passes for ideal-weight.
- Pure calculation stays separate from display formatting.
- Copy presents outputs as estimates, not medical advice.
- Health or fitness input remains browser-local.