AlexandrAI AGENTS.md
agents-md

AlexandrAI Tools CSS Border Radius Generator Agent Guide

Agent guide for optimized CSS border-radius shorthand generation from four corner values.

AGENTS.md

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

Project overview

This guide covers src/tools/css-border-radius-generator. buildBorderRadius collapses four equal corner values to one value, collapses matching top-left/bottom-right and top-right/bottom-left pairs to two values, and otherwise emits four values. borderRadiusCss wraps the generated value in a property declaration.

Primary source files

  • src/tools/css-border-radius-generator/index.ts defines meta, BorderRadiusParams, buildBorderRadius, and borderRadiusCss.
  • src/tools/css-border-radius-generator/index.test.ts covers single-value collapse, zero collapse, four-value output, two-value shorthand, one-corner difference, and declaration wrapping.
  • src/tools/css-border-radius-generator/Body.astro owns corner controls, preview update, CSS output, and copy behavior.
  • src/tools/css-border-radius-generator/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

  • Emit one value when all four corners match.
  • Emit two values when top-left equals bottom-right and top-right equals bottom-left.
  • Emit four values otherwise.
  • Always append px units.
  • Wrap generated values as border-radius declarations in borderRadiusCss.
  • Keep preview and output using the same helper.
  • Add tests if percentage or elliptical radii are introduced.

Testing

Test all shorthand branches, zero values, negative UI guards if added, large radii, declaration output, preview style synchronization, copy behavior, and future unit support.

PR checklist

  • npm test passes for css-border-radius-generator.
  • Pure helper behavior and browser UI behavior are aligned.
  • Generated CSS, Markdown, JSON, or image output remains browser-local.
  • Invalid input, copy behavior, and privacy expectations are covered.