AlexandrAI AGENTS.md
agents-md

AlexandrAI Tools Favicon Generator Agent Guide

Agent guide for standard favicon size metadata used by browser-side image generation.

AGENTS.md

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

Project overview

This guide covers src/tools/favicon-generator/index.ts. The tool exposes the standard favicon size list used by the UI: 16, 32, 48, 180, 192, and 512 pixels. The pure module is intentionally metadata-focused, while image resizing behavior belongs in the browser component.

Primary source files

  • src/tools/favicon-generator/index.ts defines meta, FAVICON_SIZES, and FaviconSize.
  • src/tools/favicon-generator/index.test.ts covers every expected size and the exact size count.
  • src/tools/favicon-generator/Body.astro owns browser image processing.
  • src/tools/favicon-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

  • Keep FAVICON_SIZES as the source of truth for generated sizes.
  • Include 16, 32, and 48 pixel legacy favicon sizes.
  • Include 180 for Apple touch icons.
  • Include 192 and 512 for Android and PWA usage.
  • Update tests when adding or removing sizes.
  • Keep binary image work out of the metadata module.
  • If ICO generation is added, document whether it is single-size or multi-size.

Testing

Test every listed size, exact array length, order if UI depends on it, Body.astro canvas resizing, file naming, transparent input images, and any future ICO or manifest output.

PR checklist

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