$npx -y skills add fusengine/agents --skill astro-seoSEO for Astro sites — meta tags, Open Graph, Twitter Cards, JSON-LD structured data, sitemap, RSS, robots.txt, canonical URLs, hreflang, Core Web Vitals. Use when optimizing search engine visibility or social sharing.
| 1 | # Astro SEO |
| 2 | |
| 3 | Complete SEO strategy for Astro 7 sites — zero JS by default makes Astro naturally SEO-friendly. |
| 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 existing layouts, head components, and metadata |
| 10 | 2. **fuse-ai-pilot:research-expert** - Verify latest SEO best practices via Context7/Exa |
| 11 | 3. **mcp__context7__query-docs** - Check Astro 7 sitemap/RSS integration docs |
| 12 | |
| 13 | After implementation, run **fuse-ai-pilot:sniper** for validation. |
| 14 | |
| 15 | --- |
| 16 | |
| 17 | ## Overview |
| 18 | |
| 19 | ### When to Use |
| 20 | |
| 21 | - Adding meta tags and Open Graph to any Astro page |
| 22 | - Generating JSON-LD structured data for rich snippets |
| 23 | - Setting up @astrojs/sitemap for search indexing |
| 24 | - Configuring RSS feeds with @astrojs/rss |
| 25 | - Creating robots.txt and canonical URL patterns |
| 26 | - Adding hreflang for multilingual SEO |
| 27 | - Measuring and improving Core Web Vitals |
| 28 | |
| 29 | ### Why Astro for SEO |
| 30 | |
| 31 | | Feature | Benefit | |
| 32 | |---------|---------| |
| 33 | | Zero JS by default | Pure HTML for crawlers, instant indexing | |
| 34 | | Static output | Sub-second TTFB, top Core Web Vitals | |
| 35 | | `Astro.site` | Canonical URL construction built-in | |
| 36 | | Islands Architecture | Only hydrate interactive parts | |
| 37 | |
| 38 | --- |
| 39 | |
| 40 | ## Core Concepts |
| 41 | |
| 42 | ### Head Component Pattern |
| 43 | |
| 44 | Create a reusable `<SEO />` or `<Head />` component accepting `title`, `description`, `og`, `canonical` props. Place in all layouts. Use `Astro.site` for absolute URL construction. |
| 45 | |
| 46 | ### Canonical URLs |
| 47 | |
| 48 | Always construct canonicals with `Astro.site`: |
| 49 | ```ts |
| 50 | const canonical = new URL(Astro.url.pathname, Astro.site); |
| 51 | ``` |
| 52 | |
| 53 | ### Structured Data |
| 54 | |
| 55 | Inject JSON-LD via `<script type="application/ld+json" set:html={JSON.stringify(schema)} />`. Use `set:html` to avoid XSS — never template string interpolation. |
| 56 | |
| 57 | --- |
| 58 | |
| 59 | ## Reference Guide |
| 60 | |
| 61 | ### Concepts |
| 62 | |
| 63 | | Topic | Reference | When to Consult | |
| 64 | |-------|-----------|-----------------| |
| 65 | | **Meta Tags & OG** | [meta-tags.md](references/meta-tags.md) | Setting up head metadata | |
| 66 | | **JSON-LD** | [structured-data.md](references/structured-data.md) | Rich snippets, schema.org | |
| 67 | | **Sitemap & RSS** | [sitemap-rss.md](references/sitemap-rss.md) | Search indexing, feeds | |
| 68 | | **Canonical & hreflang** | [canonical-hreflang.md](references/canonical-hreflang.md) | Duplicate content, i18n | |
| 69 | | **Core Web Vitals** | [core-web-vitals.md](references/core-web-vitals.md) | LCP, CLS, FID optimization | |
| 70 | |
| 71 | ### Templates |
| 72 | |
| 73 | | Template | When to Use | |
| 74 | |----------|-------------| |
| 75 | | [seo-head.md](references/templates/seo-head.md) | Reusable SEO head component | |
| 76 | | [json-ld.md](references/templates/json-ld.md) | JSON-LD BlogPosting, WebSite schemas | |
| 77 | |
| 78 | --- |
| 79 | |
| 80 | ## Best Practices |
| 81 | |
| 82 | 1. **One Head component** - Centralize all meta in a reusable component |
| 83 | 2. **Absolute URLs** - Use `Astro.site` for og:image and canonicals |
| 84 | 3. **`set:html` for JSON-LD** - Prevents XSS vulnerabilities |
| 85 | 4. **sitemap + robots.txt** - Always configure both for crawlability |
| 86 | 5. **hreflang on all locales** - Include x-default for language variants |