AGENTS.md
Guidance for coding agents working on alexandrai-tools. This project is a static Astro site of fast, no-signup, single-purpose browser tools.
Project Overview
The site is mostly client-side and should not upload user input to a backend. Tools are self-contained, auto-discovered, and surfaced through SEO metadata, sitemap output, and the tools hub.
Each tool should keep pure logic separate from DOM wiring:
src/tools/:/index.ts metaplus pure logic.src/tools/: Vitest coverage for the pure logic./index.test.ts src/pages/tools/: thin page using shared layout/chrome and inline browser wiring..astro
Setup Commands
bashnpm install
npm run dev
npm test
npm run typecheck
npm run build
npm run preview
Deployment is production-only and uses ./deploy.sh. Do not run deploy commands unless the user explicitly asks for production release work.
Add A Tool
- Copy an existing simple tool such as
json-formatteras a structural reference. - Create
src/tools/with/index.ts metaand pure functions only. - Add
src/tools/before or alongside implementation./index.test.ts - Add
src/pages/tools/as a thin UI wrapper..astro - Keep tool-specific styling minimal; reuse
src/styles/global.cssand shared helpers.
The meta.description should stay concise enough for search snippets, and meta.keywords should be real search terms rather than filler.
SEO And Static Output
- Use existing helpers under
src/lib/seo.ts. - Preserve canonical URLs, Open Graph metadata,
SoftwareApplicationJSON-LD, sitemap generation, and robots output. - Do not hand-maintain the hub or sitemap when the existing
import.meta.globdiscovery path already covers the tool.
Code Style
- Keep browser tools deterministic and side-effect-light.
- Do not add a backend route for a task that can run locally in the browser.
- Keep parsing, formatting, validation, and conversion logic testable without DOM APIs.
- Use
src/lib/dom.tshelpers for page wiring when possible. - Avoid per-tool dependency additions unless the tool genuinely needs a library already approved for client-side use.
Testing
Use:
bashnpm test
npm run typecheck
npm run build
For a changed tool, run or add its index.test.ts. If metadata, routing, or sitemap logic changes, build the whole site.
Privacy And Safety
- Assume pasted content can be sensitive.
- Do not send tool input to remote services.
- Avoid logging user input.
- Do not publish ad slot changes, analytics changes, or production deploy steps unless requested.
Commit And PR Rules
- One tool per small change is preferred.
- Keep logic, tests, and UI page together for new tools.
- Summaries should name the exact tool slug and verification commands run.