AGENTS.md
Guidance for coding agents working on AlexandrAI Tools Fancy Text Generator in the alexandrai-tools project.
Project overview
This guide covers src/tools/fancy-text-generator/index.ts. The tool maps ASCII letters into several Unicode style families through code point offsets and exception maps, leaves non-letters unchanged for math styles, maps tiny text through an explicit table, and returns seven labeled variants for non-empty input.
Primary source files
- src/tools/fancy-text-generator/index.ts defines meta, FancyStyle, code point constants, exception maps, fromCodePoint, applyMath, style helpers, FancyVariant, and generateVariants.
- src/tools/fancy-text-generator/index.test.ts covers bold, italic, boldItalic, script exceptions, double-struck exceptions, tiny mapping, unchanged non-letters, variant count, empty input, and variant shape.
- src/tools/fancy-text-generator/Body.astro owns browser controls.
- src/tools/fancy-text-generator/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 code point offsets for mathematical alphanumeric styles.
- Keep script and double-struck exception maps explicit.
- Leave non-letter characters unchanged in math styles.
- Use TINY_MAP for tiny style rather than arithmetic offsets.
- Return an empty variant array for empty input.
- Return seven variants for non-empty input.
- If styles are added, update FancyStyle, generateVariants, labels, and tests together.
Testing
Test every style helper, uppercase and lowercase letters, exception characters, non-letter passthrough, tiny mapped and unmapped characters, empty input, variant count, variant labels, and copy/paste UI behavior.
PR checklist
- npm test passes for fancy-text-generator.
- Generated output shape, escaping, and invalid-input behavior remain documented.
- Browser-local generation stays free of hidden network calls.
- UI labels, metadata, and tests update together for behavior changes.