AlexandrAI AGENTS.md
agents-md

AlexandrAI Tools Upside Down Text Agent Guide

Agent guide for Unicode character-map flipping with reversed output order.

AGENTS.md

Guidance for coding agents working on AlexandrAI Tools Upside Down Text in the alexandrai-tools project.

Project overview

This guide covers src/tools/upside-down-text. FLIP_MAP maps supported letters, digits, and punctuation to upside-down Unicode equivalents. flipChar returns the mapped character or passes through unmapped characters, and flip maps each code point, reverses the full sequence, and joins it for upside-down display.

Primary source files

  • src/tools/upside-down-text/index.ts defines meta, FLIP_MAP, flipChar, and flip.
  • src/tools/upside-down-text/index.test.ts covers individual mapped characters, unmapped characters, deterministic word flipping, reversed order, empty strings, spaces, code point safety, and lowercase map coverage.
  • src/tools/upside-down-text/Body.astro owns text input, flipped output, and copy behavior.
  • src/tools/upside-down-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 FLIP_MAP as the single source of truth for mappings.
  • Pass through unmapped characters unchanged.
  • Map characters before reversing output order.
  • Use spread syntax for code point iteration.
  • Keep copy output exactly equal to flip input result.
  • Update tests when mappings are added or changed.
  • Avoid inserting literal mapped glyphs in public docs unless necessary.

Testing

Test mapped letters, mapped digits, punctuation pairs, unmapped characters, spaces, empty input, code point safety, output reversal, copy behavior, and map coverage.

PR checklist

  • npm test passes for upside-down-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.