AGENTS.md
Guidance for coding agents working on AlexandrAI Tools Strikethrough Text in the alexandrai-tools project.
Project overview
This guide covers src/tools/strikethrough-text. applyOverlay chooses a combining character for strikethrough, underline, or slash style, iterates input by Unicode code point with spread syntax, appends the combining character after every code point, and returns the joined string. Convenience wrappers call applyOverlay for each style.
Primary source files
- src/tools/strikethrough-text/index.ts defines meta, OverlayStyle, combining character constants, COMBINING, applyOverlay, strikethrough, underline, and slash.
- src/tools/strikethrough-text/index.test.ts covers output code point length, preserved base characters, combining characters after each base character, empty input, underline, slash, and code point safety.
- src/tools/strikethrough-text/Body.astro owns text input, style selection, output, and copy behavior.
- src/tools/strikethrough-text/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
- Use spread syntax so iteration follows Unicode code points.
- Append one combining overlay after each input code point.
- Return an empty string for empty input.
- Keep wrappers as thin calls to applyOverlay.
- Keep supported styles aligned with OverlayStyle and COMBINING.
- Do not strip whitespace or punctuation.
- Avoid inserting literal combining glyphs in public docs unless needed.
Testing
Test every style, empty input, spaces and punctuation, code point length, base character preservation, copy behavior, Unicode input, and UI style switching.
PR checklist
- npm test passes for strikethrough-text.
- 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.