astro

Builds Astro sites with islands, content collections, and server rendering.

22|Updated Sep 10, 2026
One-click install
npx skills add https://github.com/Lynricsy/HyperSkills --skill astro-lynricsy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: astro
Source: https://github.com/Lynricsy/HyperSkills/tree/main/skills/astro
Command: npx skills add https://github.com/Lynricsy/HyperSkills --skill astro-lynricsy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Astro code written from memory is often a correct Astro 4 or 5 answer that fails at build time in Astro 7, and pages silently ship hundreds of kilobytes of unnecessary JavaScript through misused hydration directives. This Skill provides version-accurate guidance for Astro 7.3 covering islands, content collections, actions, middleware, and migrations, with explicit removed-API tables and audit workflows. ## Core Features & Use Cases - Island and hydration audits: Reviews client:* directives, island boundaries, prop serialisation, and server:defer usage to cut shipped JavaScript and fix broken cross-island state. - Content collections and routing: Defines loaders and Zod 4 schemas in src/content.config.ts, handles getStaticPaths constraints, output modes, adapters, and live collections. - Forms, actions, and middleware: Wires zero-JS form submissions through astro:actions with field-error rendering, authorization inside handlers, sessions, and typed astro:env configuration. - Use Case: A project upgraded to Astro 7 fails its build on legacy collections and a signup form whose action never runs; the Skill identifies output: 'hybrid' removal, the missing adapter, the missing accept: 'form', and produces corrected files. ## Quick Start Use the astro skill to review my Astro 7 product page and tell me which hydration directives to change and why the cart state never updates.

Frequently Asked Questions about astro

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce JavaScript shipped by an Astro page?

Delete client:* directives from components with no event handlers or state, since an undirected framework component renders to static HTML with zero JavaScript. Then move below-the-fold components to client:visible, replace toggle-only islands with a plain script tag, and narrow props to the fields actually read.

How do I migrate Astro content collections to the content layer?

Move the config from src/content/config.ts to src/content.config.ts, replace type: 'content'/'data' with a required loader such as glob() or file(), and import z from astro/zod. Replace entry.slug with entry.id, post.render() with the standalone render(post), and run astro sync to regenerate types.

Why does my Astro form action never run?

A form action needs four things together: export const prerender = false on the page, accept: 'form' on the action, method="POST" with action={actions.name}, and enctype="multipart/form-data" when a file input is validated. Each one fails silently on its own, and an adapter must be installed for on-demand rendering.

Does Astro support React context across islands?

No. Each client:* directive creates a separate island root, so a context provider cannot reach a consumer in another island. Hydrate one subtree containing both provider and consumers, or share state through URL params, a framework-agnostic store module, or custom events.

What replaced output: 'hybrid' in Astro 7?

The output option now accepts only 'static' or 'server'. The mixed site is the default 'static' mode plus export const prerender = false on the individual routes that need a server, and any on-demand rendering requires an installed adapter.

Why does my Astro page work in dev but break in production?

Prerendering, adapters, route caching, sessions, and asset hashing behave differently in a build, and cache.enabled is always false in dev. Verify with astro build && astro preview, and check whether a prerendered route is reading cookies or request data at build time and baking the answer into static HTML.