$npx -y skills add fusengine/agents --skill astro-deploymentDeploying Astro 7 apps — @astrojs/cloudflare (Workers, D1, KV, R2), @astrojs/vercel (Serverless/Edge, Image CDN), @astrojs/netlify (Edge Functions), @astrojs/node (standalone), ISR patterns, edge middleware, skew protection. Use for any deployment configuration.
| 1 | # Astro Deployment |
| 2 | |
| 3 | Production deployment for Astro 7 across all major platforms — Cloudflare, Vercel, Netlify, and Node.js. |
| 4 | |
| 5 | ## Agent Workflow (MANDATORY) |
| 6 | |
| 7 | Before ANY implementation, use `TeamCreate` to spawn 3 agents: |
| 8 | |
| 9 | 1. **fuse-ai-pilot:explore-codebase** - Analyze astro.config.mjs, output mode, and existing adapter |
| 10 | 2. **fuse-ai-pilot:research-expert** - Verify adapter docs via Context7/Exa for target platform |
| 11 | 3. **mcp__context7__query-docs** - Check Astro 7 adapter compatibility and breaking changes |
| 12 | |
| 13 | After implementation, run **fuse-ai-pilot:sniper** for validation. |
| 14 | |
| 15 | --- |
| 16 | |
| 17 | ## Overview |
| 18 | |
| 19 | ### When to Use |
| 20 | |
| 21 | - Deploying Astro to Cloudflare Workers with D1/KV/R2 bindings |
| 22 | - Configuring Vercel Serverless or Edge runtime with image CDN |
| 23 | - Setting up Netlify Edge Functions |
| 24 | - Running Astro as standalone Node.js server |
| 25 | - Implementing ISR (Incremental Static Regeneration) patterns |
| 26 | - Configuring edge middleware for auth/redirects |
| 27 | |
| 28 | ### Adapter Matrix |
| 29 | |
| 30 | | Platform | Package | Runtime | Notes | |
| 31 | |----------|---------|---------|-------| |
| 32 | | Cloudflare | `@astrojs/cloudflare` v13+ | workerd | Astro 6: `astro dev` runs on workerd | |
| 33 | | Vercel | `@astrojs/vercel` | Node/Edge | Image CDN built-in | |
| 34 | | Netlify | `@astrojs/netlify` | Edge | Deno-based edge functions | |
| 35 | | Node.js | `@astrojs/node` | Node | Standalone server mode | |
| 36 | |
| 37 | --- |
| 38 | |
| 39 | ## Core Concepts |
| 40 | |
| 41 | ### Output Modes |
| 42 | |
| 43 | - `output: 'static'` — Full SSG, no adapter needed |
| 44 | - `output: 'server'` — Full SSR, adapter required |
| 45 | - Per-page: Mix with `export const prerender = true/false` |
| 46 | |
| 47 | ### Cloudflare Astro |
| 48 | |
| 49 | Astro 6 runs `astro dev` on workerd — same runtime as production. Enables D1, KV, R2 bindings in local dev via `platformProxy`. No more simulation gaps. Requires `@astrojs/cloudflare` v13+ and Node.js 22+. |
| 50 | |
| 51 | ### ISR Pattern |
| 52 | |
| 53 | Astro has no native ISR. Implement with platform caching: Cloudflare KV as cache layer, or Vercel's `Cache-Control` with `stale-while-revalidate`. |
| 54 | |
| 55 | ### Skew Protection |
| 56 | |
| 57 | On Vercel, enable skew protection to prevent asset mismatches between old client and new server during deployments. |
| 58 | |
| 59 | --- |
| 60 | |
| 61 | ## Reference Guide |
| 62 | |
| 63 | ### Concepts |
| 64 | |
| 65 | | Topic | Reference | When to Consult | |
| 66 | |-------|-----------|-----------------| |
| 67 | | **Cloudflare** | [cloudflare-adapter.md](references/cloudflare-adapter.md) | Workers, D1, KV, R2, wrangler | |
| 68 | | **Vercel** | [vercel-adapter.md](references/vercel-adapter.md) | Serverless, Edge, Image CDN | |
| 69 | | **Netlify** | [netlify-adapter.md](references/netlify-adapter.md) | Edge Functions, forms | |
| 70 | | **Node.js** | [node-adapter.md](references/node-adapter.md) | Standalone, Express integration | |
| 71 | | **ISR Patterns** | [isr-patterns.md](references/isr-patterns.md) | Cache strategies, revalidation | |
| 72 | | **Edge Middleware** | [edge-middleware.md](references/edge-middleware.md) | Auth, redirects, A/B testing | |
| 73 | |
| 74 | ### Templates |
| 75 | |
| 76 | | Template | When to Use | |
| 77 | |----------|-------------| |
| 78 | | [cloudflare-setup.md](references/templates/cloudflare-setup.md) | Full Cloudflare config with bindings | |
| 79 | | [vercel-setup.md](references/templates/vercel-setup.md) | Vercel config with Edge/Image CDN | |
| 80 | |
| 81 | --- |
| 82 | |
| 83 | ## Best Practices |
| 84 | |
| 85 | 1. **Match adapter to platform early** - Switching adapters mid-project is painful |
| 86 | 2. **Cloudflare: use v13+ for Astro 7** - Required for workerd local dev |
| 87 | 3. **Node.js 22+ for Astro 7** - Drops Node 18/20 support |
| 88 | 4. **Per-page prerender** - Mix static and SSR for optimal performance |
| 89 | 5. **Test bindings locally** - Cloudflare platformProxy enables local D1/KV/R2 |