AGENTS.md
Guidance for coding agents working on AlexandrAI Tools SEO and routing.
Project Overview
SEO and routing bind each utility's metadata to static Astro pages. Dynamic routes discover Body.astro modules, load localized strings, compute canonical and alternate links, add structured data, and render the shared tool shell.
Project Map
- src/pages/tools/[slug].astro defines English dynamic tool pages.
- src/pages/[lang]/tools/[slug].astro defines localized dynamic tool pages.
- src/layouts/BaseLayout.astro owns document head metadata.
- src/lib/seo.ts defines fullTitle(), canonicalFor(), breadcrumbJsonLd(), softwareAppJsonLd(), extractFaq(), and faqPageJsonLd().
- src/lib/i18n.ts defines alternatesFor(), localePath(), and supported locale ids.
- src/tools/*/i18n.ts files provide title, description, lede, and about HTML.
- src/tools/*/Body.astro files opt tools into dynamic routing.
Setup Commands
bashnpm run typecheck
npm run build
Change Rules For Agents
- Keep getStaticPaths() tied to Body.astro discovery.
- Keep each route using getTool(slug) for canonical metadata.
- Keep title and description sourced from localized strings when available.
- Keep SoftwareApplication structured data aligned with the visible tool page.
- Extract FAQ data only from the intended about section.
- Keep hreflang alternates generated from the locale list.
- Do not hardcode one-off routes for converted tools.
- Keep canonical and breadcrumb helpers centralized in src/lib/seo.ts.
Verification
bashnpm run typecheck
npm run build
Inspect a generated tool route and a localized route after metadata changes. Confirm title, description, canonical, alternates, breadcrumbs, and FAQ data agree with the visible page.
Security Notes
Structured data is public search metadata. Do not leak private campaign names, internal paths, user data, or unreviewed claims in JSON-LD fields.
PR Checklist
- Dynamic routes build for every Body.astro.
- Canonical metadata is centralized.
- JSON-LD matches page content.
- FAQ extraction does not parse unrelated prose.
- Localized pages have alternates.