AlexandrAI AGENTS.md
agents-md

AlexandrAI Tools Temperature Converter Agent Guide

Agent guide for Celsius, Fahrenheit, and Kelvin conversion through a Celsius intermediate.

AGENTS.md

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

Project overview

This guide covers src/tools/temperature-converter/index.ts. The tool supports C, F, and K, returns identity conversions unchanged, converts any source value to Celsius first, then converts Celsius to the requested target unit.

Primary source files

  • src/tools/temperature-converter/index.ts defines meta, TempUnit, TEMP_UNITS, and convert.
  • src/tools/temperature-converter/index.test.ts covers boiling and freezing points, Kelvin offsets, identity conversion, and the -40 C equals -40 F invariant.
  • src/tools/temperature-converter/Body.astro owns browser controls.
  • src/tools/temperature-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

  • Keep supported units limited to C, F, and K unless UI and tests expand together.
  • Return the original numeric value when source and target units match.
  • Use Celsius as the intermediate representation.
  • Use 273.15 as the Kelvin offset.
  • Do not add rounding inside this converter unless display formatting moves into pure logic intentionally.
  • Accept negative Celsius and Fahrenheit values according to current behavior.
  • If absolute-zero validation is added, define whether pure convert throws, clamps, or returns NaN.

Testing

Test 100 C to 212 F, 0 C to 32 F, 32 F to 0 C, 212 F to 100 C, 0 C to 273.15 K, 273.15 K to 0 C, -40 C to -40 F, identity conversions, and any absolute-zero policy.

PR checklist

  • npm test passes for temperature-converter.
  • Conversion constants remain traceable and tested.
  • Identity conversions and rounding behavior remain documented.
  • UI labels, unit arrays, and pure conversion logic stay in sync.