---
description: Astro conventions
globs: ["src/**/*.{astro,ts,tsx,md,mdx}"]
---

# Astro

- Ship zero JavaScript by default. Use `.astro` components for static UI; add a framework island (`client:visible`, `client:idle`) only when interactivity is required, and prefer `client:visible` over `client:load`.
- Content lives in content collections defined in `src/content.config.ts` with zod schemas; query with `getCollection`/`getEntry`, never by globbing files manually.
- Every page sets `<title>`, meta description and canonical through a shared `BaseLayout.astro` with typed `Props`.
- Images via `astro:assets` `<Image />` with explicit `alt`; put source images in `src/assets`, not `public/`.
- Dynamic routes export `getStaticPaths`. Keep `output: 'static'` unless an adapter is explicitly needed.
- Styles: scoped `<style>` in components or Tailwind, whichever the file already uses.
- Verify with `npm run astro check && npm run build` before finishing.
