astro-6
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.
What this skill does
# 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: 1. **fuse-ai-pilot:explore-codebase** - Analyze existing routes, layouts, and config 2. **fuse-ai-pilot:research-expert** - Verify latest Astro 6 docs via Context7/Exa 3. **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](references/installation.md) | | Routing patterns | [routing.md](references/routing.md) | | Output configuration | [output-modes.md](references/output-modes.md) | | Middleware setup | [middleware.md](references/middleware.md) | | astro.config.ts | [config.md](references/config.md) | | New Astro 6 features | [new-features.md](references/new-features.md) | | Full project setup | [templates/basic-setup.md](references/templates/basic-setup.md) | | Config examples | [templates/config-example.md](references/templates/config-example.md) | --- ## Best Practices 1. **Use `output: 'static'` by default** — Add server only when needed 2. **Per-route `prerender`** — Fine-grained control in hybrid mode 3. **Middleware for cross-cutting concerns** — Auth, redirects, headers 4. **Opt into Rust compiler** — Faster builds on large sites 5. **CSP nonces** — Use built-in support instead of custom headers
Related in Web Dev
generating-lwc-components
IncludedLightning Web Components with PICKLES methodology and 165-point scoring. Use this skill when the user creates or edits LWC components, builds wire service patterns, or writes Jest tests for LWC. TRIGGER when: user creates/edits LWC components, touches lwc/**/*.js, .html, .css, .js-meta.xml files, or asks about wire service, SLDS, or Jest LWC tests. DO NOT TRIGGER when: Apex classes (use generating-apex), Aura components, or Visualforce.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Set up queries with useQuery, mutations with useMutation, configure QueryClient caching strategies, implement optimistic updates, and handle infinite scroll with useInfiniteQuery. Use when: setting up data fetching in React projects, migrating from v4 to v5, or fixing object syntax required errors, query callbacks removed issues, cacheTime renamed to gcTime, isPending vs isLoading confusion, keepPreviousData removed problems.
document-processor-api
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
nutrient-document-processing
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Covers useMutationState, simplified optimistic updates, throwOnError, network mode (offline/PWA), and infiniteQueryOptions. Use when setting up data fetching, fixing v4→v5 migration errors (object syntax, gcTime, isPending, keepPreviousData), or debugging SSR/hydration issues with streaming server components.
accelint-nextjs-best-practices
IncludedNext.js performance optimization and best practices. Use when writing Next.js code (App Router or Pages Router); implementing Server Components, Server Actions, or API routes; optimizing RSC serialization, data fetching, or server-side rendering; reviewing Next.js code for performance issues; fixing authentication in Server Actions; or implementing Suspense boundaries, parallel data fetching, or request deduplication.