Astro 6 Expert
Production-ready web framework for content-driven sites with unified dev runtime and Islands Architecture.
Agent Workflow (MANDATORY)
Before ANY implementation, use TeamCreate to spawn 3 agents:
- fuse-ai-pilot:explore-codebase - Analyze existing routes, layouts, and config
- fuse-ai-pilot:research-expert - Verify latest Astro 6 docs via Context7/Exa
- mcp__context7__query-docs - Check breaking changes v5→v6
After implementation, run fuse-ai-pilot:sniper for validation.
Overview
When to Use
- Building new content-driven websites or blogs
- Migrating from Astro 5 to version 6
- 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 6
| Feature |
Benefit |
| Unified Dev Runtime |
Dev matches production — fewer "works in dev, breaks in prod" bugs |
| Vite Environment API |
Exact production runtime during development |
| Rust Compiler |
Faster .astro file compilation, replaces Go compiler |
| Live Content Collections |
Real-time data from external sources |
| Built-in Fonts API |
Zero-config font loading with performance optimization |
| CSP Support |
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 6 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
- Opt into Rust compiler — Faster builds on large sites
- CSP nonces — Use built-in support instead of custom headers
1---
2name: astro-6
3description: Expert Astro 6 framework — routing, output modes, middleware, Vite Environment API, Rust compiler, Content Security Policy, Live Collections, Fonts API. Use when building Astro sites, configuring output, or upgrading from Astro 5.
4versions:
5 astro: 6
6 node: "22+"
7 vite: 6
8user-invocable: true
9references: references/installation.md, references/routing.md, references/output-modes.md, references/middleware.md, references/config.md, references/new-features.md, references/templates/basic-setup.md, references/templates/config-example.md
10related-skills: astro-content, astro-actions, astro-islands, astro-integrations, astro-deployment
11metadata:
12 source: https://skillmd.com/skills/aibot88/astro-6
13---
14
15# Astro 6 Expert
16
17Production-ready web framework for content-driven sites with unified dev runtime and Islands Architecture.
18
19## Agent Workflow (MANDATORY)
20
21Before ANY implementation, use `TeamCreate` to spawn 3 agents:
22
231. **fuse-ai-pilot:explore-codebase** - Analyze existing routes, layouts, and config
242. **fuse-ai-pilot:research-expert** - Verify latest Astro 6 docs via Context7/Exa
253. **mcp__context7__query-docs** - Check breaking changes v5→v6
26
27After implementation, run **fuse-ai-pilot:sniper** for validation.
28
29---
30
31## Overview
32
33### When to Use
34
35- Building new content-driven websites or blogs
36- Migrating from Astro 5 to version 6
37- Configuring static, server, or hybrid output modes
38- Setting up middleware for auth or redirects
39- Leveraging the new Rust compiler for large sites
40- Implementing Content Security Policy (CSP) headers
41
42### Why Astro 6
43
44| Feature | Benefit |
45|---------|---------|
46| Unified Dev Runtime | Dev matches production — fewer "works in dev, breaks in prod" bugs |
47| Vite Environment API | Exact production runtime during development |
48| Rust Compiler | Faster `.astro` file compilation, replaces Go compiler |
49| Live Content Collections | Real-time data from external sources |
50| Built-in Fonts API | Zero-config font loading with performance optimization |
51| CSP Support | Built-in Content Security Policy nonce management |
52| Cloudflare Workers | First-class support with workerd runtime in dev |
53
54---
55
56## Core Concepts
57
58### Output Modes
59
60| Mode | Description | Use Case |
61|------|-------------|----------|
62| `static` (default) | All pages prerendered at build | Blogs, docs, marketing |
63| `server` | All pages rendered on demand | Apps, dashboards, auth |
64| `hybrid` | Mix static + on-demand | Most production sites |
65
66### Routing
67
68- **File-based routing** — `src/pages/` maps directly to URLs
69- **Dynamic routes** — `[slug].astro`, `[...all].astro`
70- **Per-route prerender** — `export const prerender = false/true`
71- **Endpoints** — `.ts`/`.js` files in `src/pages/` for API routes
72
73---
74
75## Reference Guide
76
77| Need | Reference |
78|------|-----------|
79| Initial setup | [installation.md](references/installation.md) |
80| Routing patterns | [routing.md](references/routing.md) |
81| Output configuration | [output-modes.md](references/output-modes.md) |
82| Middleware setup | [middleware.md](references/middleware.md) |
83| astro.config.ts | [config.md](references/config.md) |
84| New Astro 6 features | [new-features.md](references/new-features.md) |
85| Full project setup | [templates/basic-setup.md](references/templates/basic-setup.md) |
86| Config examples | [templates/config-example.md](references/templates/config-example.md) |
87
88---
89
90## Best Practices
91
921. **Use `output: 'static'` by default** — Add server only when needed
932. **Per-route `prerender`** — Fine-grained control in hybrid mode
943. **Middleware for cross-cutting concerns** — Auth, redirects, headers
954. **Opt into Rust compiler** — Faster builds on large sites
965. **CSP nonces** — Use built-in support instead of custom headers