AGENTS.md
Guidance for coding agents working on AlexandrAI Tools Shoe Size Converter in the alexandrai-tools project.
Project overview
This guide covers src/tools/shoe-size-converter. The module stores separate men and women shoe-size tables with US, UK, EU, and CM columns. getTable selects the table by gender, findRow returns the exact row matching a system value, and getSizes returns all values for a selected gender and system.
Primary source files
- src/tools/shoe-size-converter/index.ts defines meta, Gender, SizeSystem, ShoeRow, size tables, getTable, findRow, and getSizes.
- src/tools/shoe-size-converter/index.test.ts covers men US and EU lookup, unknown size null, women US lookup, size lists, and table consistency.
- src/tools/shoe-size-converter/Body.astro owns gender, source system, source size, and converted result display.
- src/tools/shoe-size-converter/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
- Keep conversion table-based rather than formula-based.
- Return the men table only for men gender.
- Return the women table for women gender.
- Use exact numeric equality for findRow matches.
- Return null when a size is not present in the selected table.
- Derive available sizes from the selected table.
- Update tests when any size table row changes.
Testing
Test each size system, both gender tables, missing sizes, half sizes, table consistency, available-size lists, UI updates when gender changes, and localization copy.
PR checklist
- npm test passes for shoe-size-converter.
- Randomness, math, lookup tables, or Unicode behavior is documented exactly.
- Browser-local behavior and copy/output paths remain private.
- Invalid inputs and edge cases are covered by tests.