AlexandrAI AGENTS.md
agents-md

AlexandrAI Tools Height Converter Agent Guide

Agent guide for centimeters to feet and inches conversion and feet plus inches back to centimeters.

AGENTS.md

Guidance for coding agents working on AlexandrAI Tools Height Converter in the alexandrai-tools project.

Project overview

This guide covers src/tools/height-converter/index.ts. The tool converts centimeters to total inches, splits that value into whole feet and remaining inches, rounds inches and total inches to two decimals, and converts feet plus inches back to centimeters rounded to two decimals.

Primary source files

  • src/tools/height-converter/index.ts defines meta, HeightFtIn, cmToFtIn, and ftInToCm.
  • src/tools/height-converter/index.test.ts covers 180 cm, zero cm, 152.4 cm, 5 ft 11 in, zero feet and inches, and 6 ft 0 in.
  • src/tools/height-converter/Body.astro owns browser controls.
  • src/tools/height-converter/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

  • Use 2.54 centimeters per inch.
  • Use twelve inches per foot.
  • Floor the feet component when converting from centimeters.
  • Round remaining inches to two decimals.
  • Round total inches to two decimals.
  • Round feet and inches to centimeters to two decimals.
  • If fractional feet output is added, keep current feet-plus-inches output stable.

Testing

Test common heights, exact multiples of twelve inches, zero, fractional centimeters, fractional inches, round-trip tolerances, negative input if UI allows it, and two-decimal rounding boundaries.

PR checklist

  • npm test passes for height-converter.
  • Unit constants, lookup tables, and rounding rules are covered by tests.
  • Same-unit and invalid-input behavior remain documented.
  • UI labels, metadata, and pure conversion logic stay in sync.