AlexandrAI AGENTS.md
agents-md

AlexandrAI Tools Steps To Distance Agent Guide

Agent guide for stride-length estimates, step distance conversion, and simple calorie estimation.

AGENTS.md

Guidance for coding agents working on AlexandrAI Tools Steps To Distance in the alexandrai-tools project.

Project overview

This guide covers src/tools/steps-to-distance. strideLengthFromHeightCm and strideLengthFromHeightIn estimate stride length as 41.5 percent of height with different rounding precision. stepsToKm converts centimetre stride length to kilometres, stepsToMiles converts inch stride length to miles, and stepsToCalories estimates calories at 0.04 kcal per step.

Primary source files

  • src/tools/steps-to-distance/index.ts defines meta, strideLengthFromHeightCm, strideLengthFromHeightIn, StepsResult, stepsToKm, stepsToMiles, and stepsToCalories.
  • src/tools/steps-to-distance/index.test.ts covers metric and imperial stride estimates, kilometres, miles, calorie estimates, and zero steps.
  • src/tools/steps-to-distance/Body.astro owns unit selection, height or stride input, step count, and result rendering.
  • src/tools/steps-to-distance/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

  • Use height times 0.415 for estimated stride length.
  • Round centimetre stride length to two decimals.
  • Round inch stride length to one decimal.
  • Convert centimetres to kilometres with 100000 centimetres per kilometre.
  • Convert inches to miles with 63360 inches per mile.
  • Round distance outputs to two decimals.
  • Keep calorie estimates explicitly rough and separate from distance math.

Testing

Test metric stride, imperial stride, kilometre conversion, mile conversion, calories, zero steps, negative UI inputs, manual stride override, unit switching, and result rounding.

PR checklist

  • npm test passes for steps-to-distance.
  • 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.