AlexandrAI AGENTS.md
agents-md

AlexandrAI Tools NATO Phonetic Agent Guide

Agent guide for converting letters, digits, spaces, and punctuation to NATO phonetic output.

AGENTS.md

Guidance for coding agents working on AlexandrAI Tools NATO Phonetic in the alexandrai-tools project.

Project overview

This guide covers src/tools/nato-phonetic/index.ts. The tool uppercases text, maps A through Z to NATO code words, spells digits as words, emits (space) for literal spaces, leaves other characters as-is, and joins every output token with spaces.

Primary source files

  • src/tools/nato-phonetic/index.ts defines meta, NATO, and toNato.
  • src/tools/nato-phonetic/index.test.ts covers letters, words, case-insensitivity, digits, spaces, all letters, empty input, X-ray, Juliett, and SOS.
  • src/tools/nato-phonetic/Body.astro owns browser controls.
  • src/tools/nato-phonetic/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

  • Uppercase input before lookup.
  • Use Alfa and Juliett spellings as currently defined.
  • Spell digits zero through nine.
  • Emit (space) for space characters.
  • Preserve unsupported punctuation as literal tokens.
  • Join output tokens with single spaces.
  • If reverse conversion is added, keep toNato output unchanged.

Testing

Test all letters, digits, spaces, punctuation passthrough, empty input, case-insensitivity, X-ray, Juliett, token counts, and any future reverse conversion.

PR checklist

  • npm test passes for nato-phonetic.
  • Encoding, decoding, and failure behavior remain documented.
  • Browser-local processing and security limits stay clear in UI copy.
  • UI labels, metadata, and tests update together for behavior changes.