AlexandrAI AGENTS.md
agents-md

AlexandrAI Tools Calories Burned Agent Guide

Agent guide for MET-based exercise calorie estimates and pound-to-kilogram conversion.

AGENTS.md

Guidance for coding agents working on AlexandrAI Tools Calories Burned in the alexandrai-tools project.

Project overview

This guide covers src/tools/calories-burned/index.ts. The tool defines a fixed activity list with MET values, estimates calories as MET times weight in kilograms times hours, rounds to the nearest whole calorie, and converts pounds to kilograms for imperial input.

Primary source files

  • src/tools/calories-burned/index.ts defines meta, Activity, ACTIVITIES, caloriesBurned, and lbToKg.
  • src/tools/calories-burned/index.test.ts covers one-hour and half-hour estimates, zero duration, pound conversion, activity count, and positive MET values.
  • src/tools/calories-burned/Body.astro owns browser controls.
  • src/tools/calories-burned/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 MET values positive.
  • Use duration minutes divided by sixty to compute hours.
  • Round calorie estimates to whole numbers.
  • Keep lbToKg as a small conversion helper.
  • Do not present MET estimates as exact calorie expenditure.
  • If adding activities, include id, label, and MET plus test positive MET coverage.
  • Keep activity and weight inputs browser-local.

Testing

Test one-hour, partial-hour, zero duration, zero weight, pound conversion, every activity having positive MET, new activity ids, and display rounding if changed.

PR checklist

  • npm test passes for calories-burned.
  • Pure calculation stays separate from display formatting.
  • Copy presents outputs as estimates, not medical advice.
  • Health or fitness input remains browser-local.