Covers initial project setup and migration from Astro 5/6, including breaking changes and Node 22.12+ requirements. Does not cover Content Layer API details (astro-content), Server Actions (astro-actions), Islands hydration directives (astro-islands), UI framework integrations (astro-integrations), or deployment adapters (astro-deployment) — those live in their own skills.
Astro 7 Expert
Production-ready web framework for content-driven sites with unified dev runtime and Islands Architecture.
Agent Workflow (MANDATORY)
Before ANY implementation, spawn 3 agents in parallel, one Agent call each with a name:
- fuse-ai-pilot:explore-codebase - Analyze existing routes, layouts, and config
- fuse-ai-pilot:research-expert - Verify latest Astro 7 docs via Context7/Exa
- mcp__context7__query-docs - Check breaking changes v6→v7
After implementation, run fuse-ai-pilot:sniper for validation.
Overview
When to Use
- Building new content-driven websites or blogs
- Migrating from Astro 6 to version 7
- Configuring static, server, or hybrid output modes
- Setting up middleware for auth or redirects
- Leveraging the new Rust compiler for large sites
- Implementing Content Security Policy (CSP) headers
Why Astro 7
| Feature |
Benefit |
| Unified Dev Runtime |
Dev matches production — fewer "works in dev, breaks in prod" bugs |
| Vite Environment API (Vite 8) |
Exact production runtime during development |
| Single Rust Compiler |
Go compiler removed — one Rust compiler for .astro files, with strict HTML parsing (unclosed tags now error instead of being silently auto-corrected) |
| Live Content Collections |
Real-time data from external sources |
| Built-in Fonts API (stable) |
Zero-config font loading with performance optimization |
| CSP Support (stable) |
Built-in Content Security Policy nonce management |
| Cloudflare Workers |
First-class support with workerd runtime in dev |
Core Concepts
Output Modes
| Mode |
Description |
Use Case |
static (default) |
All pages prerendered at build |
Blogs, docs, marketing |
server |
All pages rendered on demand |
Apps, dashboards, auth |
hybrid |
Mix static + on-demand |
Most production sites |
Routing
- File-based routing —
src/pages/ maps directly to URLs
- Dynamic routes —
[slug].astro, [...all].astro
- Per-route prerender —
export const prerender = false/true
- Endpoints —
.ts/.js files in src/pages/ for API routes
Reference Guide
| Need |
Reference |
| Initial setup |
installation.md |
| Routing patterns |
routing.md |
| Output configuration |
output-modes.md |
| Middleware setup |
middleware.md |
| astro.config.ts |
config.md |
| New Astro 7 features |
new-features.md |
| Full project setup |
templates/basic-setup.md |
| Config examples |
templates/config-example.md |
Best Practices
- Use
output: 'static' by default — Add server only when needed
- Per-route
prerender — Fine-grained control in hybrid mode
- Middleware for cross-cutting concerns — Auth, redirects, headers
- No compiler flag needed — the Rust compiler is the only compiler now (Go removed); watch for strict HTML parsing errors on unclosed tags
- CSP nonces — Use built-in stable support instead of custom headers
- Node 22.12+ required — odd-numbered Node versions are unsupported; stay on stable TypeScript tooling, the native
tsgo compiler can make astro check/typecheck fail opaquely (see installation.md)
1---2name: astro-73description: Use when building Astro 7 sites, choosing an output mode (static/server/hybrid), configuring middleware, or upgrading from Astro 5/6.4---56<objective>7Configures and explains Astro 7 (stable, 7.0.9) core framework mechanics: file-based routing, the three output modes (static/server/hybrid) and per-route `prerender`, middleware for auth/redirects/headers, the Vite Environment API, the single Rust compiler (Go compiler removed, strict HTML parsing), stable Content Security Policy, Live Content Collections, and the built-in Fonts API.89Covers initial project setup and migration from Astro 5/6, including breaking changes and Node 22.12+ requirements. Does not cover Content Layer API details (astro-content), Server Actions (astro-actions), Islands hydration directives (astro-islands), UI framework integrations (astro-integrations), or deployment adapters (astro-deployment) — those live in their own skills.10</objective>1112# Astro 7 Expert1314Production-ready web framework for content-driven sites with unified dev runtime and Islands Architecture.1516## Agent Workflow (MANDATORY)1718Before ANY implementation, spawn 3 agents in parallel, one `Agent` call each with a `name`:19201. **fuse-ai-pilot:explore-codebase** - Analyze existing routes, layouts, and config212. **fuse-ai-pilot:research-expert** - Verify latest Astro 7 docs via Context7/Exa223. **mcp__context7__query-docs** - Check breaking changes v6→v72324After implementation, run **fuse-ai-pilot:sniper** for validation.2526---2728## Overview2930### When to Use3132- Building new content-driven websites or blogs33- Migrating from Astro 6 to version 734- Configuring static, server, or hybrid output modes35- Setting up middleware for auth or redirects36- Leveraging the new Rust compiler for large sites37- Implementing Content Security Policy (CSP) headers3839### Why Astro 74041| Feature | Benefit |42|---------|---------|43| Unified Dev Runtime | Dev matches production — fewer "works in dev, breaks in prod" bugs |44| Vite Environment API (Vite 8) | Exact production runtime during development |45| Single Rust Compiler | Go compiler removed — one Rust compiler for `.astro` files, with strict HTML parsing (unclosed tags now error instead of being silently auto-corrected) |46| Live Content Collections | Real-time data from external sources |47| Built-in Fonts API (stable) | Zero-config font loading with performance optimization |48| CSP Support (stable) | Built-in Content Security Policy nonce management |49| Cloudflare Workers | First-class support with workerd runtime in dev |5051---5253## Core Concepts5455### Output Modes5657| Mode | Description | Use Case |58|------|-------------|----------|59| `static` (default) | All pages prerendered at build | Blogs, docs, marketing |60| `server` | All pages rendered on demand | Apps, dashboards, auth |61| `hybrid` | Mix static + on-demand | Most production sites |6263### Routing6465- **File-based routing** — `src/pages/` maps directly to URLs66- **Dynamic routes** — `[slug].astro`, `[...all].astro`67- **Per-route prerender** — `export const prerender = false/true`68- **Endpoints** — `.ts`/`.js` files in `src/pages/` for API routes6970---7172## Reference Guide7374| Need | Reference |75|------|-----------|76| Initial setup | [installation.md](references/installation.md) |77| Routing patterns | [routing.md](references/routing.md) |78| Output configuration | [output-modes.md](references/output-modes.md) |79| Middleware setup | [middleware.md](references/middleware.md) |80| astro.config.ts | [config.md](references/config.md) |81| New Astro 7 features | [new-features.md](references/new-features.md) |82| Full project setup | [templates/basic-setup.md](references/templates/basic-setup.md) |83| Config examples | [templates/config-example.md](references/templates/config-example.md) |8485---8687## Best Practices88891. **Use `output: 'static'` by default** — Add server only when needed902. **Per-route `prerender`** — Fine-grained control in hybrid mode913. **Middleware for cross-cutting concerns** — Auth, redirects, headers924. **No compiler flag needed** — the Rust compiler is the only compiler now (Go removed); watch for strict HTML parsing errors on unclosed tags935. **CSP nonces** — Use built-in stable support instead of custom headers946. **Node 22.12+ required** — odd-numbered Node versions are unsupported; stay on stable TypeScript tooling, the native `tsgo` compiler can make `astro check`/typecheck fail opaquely (see installation.md)