AGENTS.md
Guidance for coding agents working on AlexandrAI Tools Water Intake in the alexandrai-tools project.
Project overview
This guide covers src/tools/water-intake/index.ts. The tool estimates daily water intake from body weight using 35 ml per kilogram, adds an activity-level milliliter bump, converts the result to litres and cups, and supports imperial input by converting pounds to kilograms.
Primary source files
- src/tools/water-intake/index.ts defines meta, ActivityBump, activity extras, labels, ML_PER_CUP, WaterResult, calcWaterMetric, and calcWaterImperial.
- src/tools/water-intake/index.test.ts covers sedentary baseline, each activity bump, litres rounding, cup rounding, and imperial conversion parity.
- src/tools/water-intake/Body.astro owns browser inputs.
- src/tools/water-intake/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
- Keep base intake as 35 ml per kilogram.
- Keep activity keys synchronized across extra amounts, labels, UI, and tests.
- Round ml to a whole number, litres to two decimals, and cups to one decimal.
- Keep ML_PER_CUP at 240 unless copy and tests change.
- Do not present hydration estimates as medical advice.
- If climate, pregnancy, kidney, or medical modifiers are added, add explicit warnings and tests.
- Keep calculations browser-local.
Testing
Test baseline metric calculation, light, moderate, and heavy bumps, litre rounding, cup rounding, imperial conversion, zero weight behavior, and any new activity level.
PR checklist
- npm test passes for water-intake.
- Pure calculation stays separate from display formatting.
- Copy presents outputs as estimates, not medical advice.
- Health or fitness input remains browser-local.