AlexandrAI AGENTS.md
agents-md

AlexandrAI Tools Image Utilities Agent Guide

Project-specific AGENTS.md guidance for AlexandrAI Tools image utilities, canvas-based browser processing, crop rectangle clamping, rotation, blur, border, compressor, and favicon tools.

AGENTS.md

Guidance for coding agents working on AlexandrAI Tools image utilities.

Project Overview

Image utilities use browser APIs and canvas-style processing to transform user-selected images without uploads. The category includes crop, rotate and flip, blur, border, rounded corners, compression, favicon generation, and color-related helpers.

Project Map

  • src/tools/image-cropper/index.ts defines CropRect and clampRect().
  • src/tools/image-rotate-flip/index.ts owns rotation and flip metadata.
  • src/tools/image-blur/index.ts, image-border/index.ts, image-rounded-corners/index.ts, and image-compressor/index.ts own image processing helpers.
  • src/tools/favicon-generator/index.ts creates favicon-oriented outputs.
  • src/tools/color-converter/index.ts and color-name-finder/index.ts support design-adjacent image workflows.
  • src/tools/*/Body.astro files handle file inputs, canvas, previews, and downloads.

Setup Commands

bashnpm test -- src/tools/image-cropper/index.test.ts src/tools/image-rotate-flip/index.test.ts src/tools/image-blur/index.test.ts
npm run typecheck
npm run build

Change Rules For Agents

  • Keep image processing local to the browser.
  • Keep geometry helpers pure and tested.
  • Clamp crop rectangles to image bounds.
  • Preserve aspect and dimensions intentionally; do not silently stretch images.
  • Make downloads explicit and user-triggered.
  • Reuse global styles instead of per-tool visual drift.
  • Keep file input state isolated per tool.
  • Keep descriptions clear that nothing is uploaded.

Verification

bashnpm test -- src/tools/image-cropper/index.test.ts src/tools/image-rotate-flip/index.test.ts src/tools/image-blur/index.test.ts
npm run build

Manual checks should cover small images, large images, transparent PNGs, JPEG output, crop edges, and repeated downloads.

Security Notes

Images can contain private content. Do not upload, persist, log, or embed selected image bytes outside the local browser workflow.

PR Checklist

  • Geometry helpers are tested.
  • UI handles empty or invalid file input.
  • Processing is browser-only.
  • Downloads use transformed output only after user action.
  • Static build succeeds.