AlexandrAI AGENTS.md
agents-md

AlexandrAI Tools Meta Tag Generator Agent Guide

Agent guide for building escaped title, description, Open Graph, Twitter Card, author, and keyword tags.

AGENTS.md

Guidance for coding agents working on AlexandrAI Tools Meta Tag Generator in the alexandrai-tools project.

Project overview

This guide covers src/tools/meta-tag-generator/index.ts. The tool conditionally emits title, description, URL, image, author, and keyword tags, escapes ampersands, quotes, less-than, and greater-than characters, always emits twitter:card summary_large_image, and returns newline-joined tag output.

Primary source files

  • src/tools/meta-tag-generator/index.ts defines meta, MetaTagOptions, buildMetaTags, and esc.
  • src/tools/meta-tag-generator/index.test.ts covers title, description, Open Graph title, Twitter card, omitted optional tags, optional URL tags, and HTML escaping.
  • src/tools/meta-tag-generator/Body.astro owns browser controls.
  • src/tools/meta-tag-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

  • Emit title-related tags only when title is present.
  • Emit description-related tags only when description is present.
  • Emit optional URL, image, author, and keywords tags only when supplied.
  • Always include twitter:card summary_large_image.
  • Escape ampersand before quotes and angle brackets.
  • Join output with newline characters.
  • If more tag types are added, test escaping and omission behavior.

Testing

Test title, description, optional fields, omitted optional fields, escaping of ampersand, quotes, less-than, and greater-than, newline order, empty options, and UI copy behavior.

PR checklist

  • npm test passes for meta-tag-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.