AGENTS.md
Guidance for coding agents working on AlexandrAI Tools Zodiac Sign in the alexandrai-tools project.
Project overview
This guide covers src/tools/zodiac-sign. getZodiacSign maps month and day thresholds to Western zodiac sign strings. zodiacFromDate accepts either YYYY-MM-DD or MM-DD input, extracts month and day, returns null when parsing fails, and otherwise delegates to getZodiacSign.
Primary source files
- src/tools/zodiac-sign/index.ts defines meta, ZodiacSign, getZodiacSign, and zodiacFromDate.
- src/tools/zodiac-sign/index.test.ts covers YYYY-MM-DD parsing, MM-DD parsing, cusp boundaries, invalid strings, and all months producing a sign.
- src/tools/zodiac-sign/Body.astro owns date input and result display.
- src/tools/zodiac-sign/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
- Support both YYYY-MM-DD and MM-DD input shapes.
- Return null for inputs that do not split into two or three date parts.
- Return null when month or day cannot be parsed as numbers.
- Keep cusp thresholds centralized in getZodiacSign.
- Do not make year affect Western zodiac output.
- Add tests for every changed cusp date.
- Keep astrology framing entertainment-oriented.
Testing
Test both input shapes, invalid strings, month and day parsing, every cusp boundary, every month, out-of-range UI validation if added, and result copy.
PR checklist
- npm test passes for zodiac-sign.
- Date, random, or hash behavior is documented exactly as implemented.
- Health outputs remain framed as estimates, not medical decisions.
- UI labels, validation, and pure helper tests stay aligned.