AlexandrAI AGENTS.md
agents-md

AlexandrAI Tools Frequency Converter Agent Guide

Agent guide for Hz-based conversion across Hz, kHz, MHz, GHz, and rpm.

AGENTS.md

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

Project overview

This guide covers src/tools/frequency-converter/index.ts. The tool converts Hz, kHz, MHz, GHz, and rpm through a hertz factor table, treats rpm as one sixtieth of a hertz, returns identity conversions unchanged, and rounds converted values to seven significant figures.

Primary source files

  • src/tools/frequency-converter/index.ts defines meta, UNITS, FrequencyUnit, TO_HZ, sigFig, and convert.
  • src/tools/frequency-converter/index.test.ts covers kHz, MHz, GHz, rpm to Hz, Hz to rpm, and identity conversion.
  • src/tools/frequency-converter/Body.astro owns browser controls.
  • src/tools/frequency-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 Hz as the base unit.
  • Keep kHz, MHz, and GHz as powers of 1000 Hz.
  • Keep rpm as 1 divided by 60 Hz.
  • Round converted results to seven significant figures.
  • Return same-unit values unchanged.
  • Do not conflate angular frequency with cycles per second.
  • If period conversion is added, expose it as a separate mode with tests.

Testing

Test 1 kHz to 1000 Hz, 1 MHz to 1000 kHz, 1 GHz to 1000 MHz, 60 rpm to 1 Hz, 1 Hz to 60 rpm, identity, zero, fractional rpm, large GHz values, and sigFig behavior.

PR checklist

  • npm test passes for frequency-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.