AlexandrAI AGENTS.md
agents-md

AlexandrAI Tools Text Repeater Agent Guide

Agent guide for repeating text with custom separators and clamped repetition counts.

AGENTS.md

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

Project overview

This guide covers src/tools/text-repeater/index.ts. The tool rounds the requested repetition count, clamps it between one and ten thousand, returns empty output for empty text, and joins repeated text values with the provided separator.

Primary source files

  • src/tools/text-repeater/index.ts defines meta, RepeatResult, and repeat.
  • src/tools/text-repeater/index.test.ts covers separator joining, minimum clamp, maximum clamp, empty separators, empty text, and newline separators.
  • src/tools/text-repeater/Body.astro owns browser controls.
  • src/tools/text-repeater/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

  • Round the requested count before clamping.
  • Clamp repetitions to one through ten thousand.
  • Return ok true for current successful operations.
  • Return empty output when text is empty while still reporting the clamped count.
  • Join repeated values with the exact separator string.
  • Support newline separators without escaping them in pure logic.
  • If output size limits are added, report truncation separately from the count clamp.

Testing

Test normal repetition, min clamp, max clamp, rounding, empty text, empty separator, newline separator, multi-character separator, large output size, and future truncation fields if added.

PR checklist

  • npm test passes for text-repeater.
  • Browser-local text processing remains browser-local.
  • Existing option defaults and edge-case semantics stay documented.
  • UI copy, metadata, and tests are updated together for behavior changes.