astro-architectlisted
Install: claude install-skill ralvarez-ai/ralvaskills
# Astro Architecture
Targets **Astro 6+** with **TypeScript strict**, zero-JS-by-default output.
Builds on [ui-ux-architect](../../frontend/ui-ux-architect/SKILL.md) for design
tokens and a11y; this skill covers the Astro-specific layers — rendering model,
content collections, scripts, routing, forms, deployment. Concrete skeletons in
[RECIPES.md](RECIPES.md); pinned dependencies in [STACK.md](STACK.md).
## 1. The rendering model — the one rule that governs everything else
Astro components (`.astro`) render to HTML **at build time** and ship zero
JavaScript unless you explicitly opt in. This is the framework's whole thesis;
every rule below is downstream of it.
- **Default to `.astro` components.** Reach for a framework component only when
the interaction genuinely cannot be expressed as an event handler on the
server-rendered HTML.
- **Every `<script>` you write ships to the browser.** Astro bundles and dedupes
`<script>` tags, but it does not make them free. Two `onclick` attributes are
cheaper than one hydrated island.
- **Astro components can be islands themselves.** `<script>` inside a `.astro`
file is processed, bundled, hoisted, and deduplicated — it is not inline
markup. This is usually the cheapest interactivity available.
Skeleton: [RECIPES § Script processing](RECIPES.md#script-processing).
### Prefer these, in order
1. CSS `:checked` / `:target` / `:hover` — zero JS, zero hydration.
2. `<details>` / `<dialog>` — native, accessible, free.
3. A pr