astro-seo

Implements SEO metadata, structured data, sitemaps, and hreflang for Astro sites.

1|Updated Jul 29, 2026
One-click install
npx skills add https://github.com/fusengine/kimi-code --skill astro-seo-fusengine
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: astro-seo
Source: https://github.com/fusengine/kimi-code/tree/main/plugins/astro-expert/skills/astro-seo
Command: npx skills add https://github.com/fusengine/kimi-code --skill astro-seo-fusengine

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @astrojs/sitemap, @astrojs/rss, and includes references (resource) components.

What problem does it solve? Astro sites need correct meta tags, Open Graph previews, JSON-LD structured data, sitemaps, and canonical URLs to rank in search engines, but wiring all of this consistently across pages is repetitive and error-prone. ## Core Features & Use Cases - Reusable SEO Head Component: Centralizes title, description, Open Graph, Twitter Cards, favicons, and canonical URLs built with Astro.site. - JSON-LD Structured Data: Injects BlogPosting, WebSite, Organization, FAQ, and BreadcrumbList schemas via set:html to prevent XSS. - Sitemap, RSS & robots.txt: Configures @astrojs/sitemap and @astrojs/rss for indexing and content feeds. - International SEO & Performance: Adds hreflang with x-default for multilingual sites and optimizes Core Web Vitals (LCP, CLS, INP) using Astro's zero-JS output. - Use Case: When launching an Astro blog, generate a complete SEO setup — head component, BlogPosting schema, sitemap, RSS feed, and hreflang tags — in one pass. ## Quick Start Ask the agent to add complete SEO to your Astro site, including a reusable SEO head component, JSON-LD structured data, sitemap, RSS feed, and canonical URLs.

Frequently Asked Questions about astro-seo

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add SEO meta tags to an Astro site?▼

Create a reusable SEO.astro component accepting title, description, and image props, then place it in every layout's head. Build canonical and og:image URLs with Astro.site so all URLs are absolute.

How to add JSON-LD structured data in Astro?▼

Inject JSON-LD using a script tag with type application/ld+json and the set:html directive passing JSON.stringify(schema). Never use template string interpolation, as it creates an XSS vulnerability.

Does Astro support sitemap and RSS feed generation?▼

Yes, @astrojs/sitemap generates sitemap-index.xml at build time and requires the site option in astro.config.mjs. @astrojs/rss creates RSS feeds from content collections via an endpoint file like src/pages/rss.xml.ts.

How do I set up hreflang for a multilingual Astro site?▼

Render link rel=alternate tags with absolute URLs for each locale in the head, and always include an x-default entry pointing to the default language page. Each locale must include a self-referencing hreflang tag.

Why is my Astro JSON-LD structured data a security risk?▼

Interpolating JSON directly into a script tag allows injected content to break out and execute arbitrary code. Using set:html with JSON.stringify ensures the payload is rendered as inert data, preventing XSS.

What SEO topics does this skill not cover?▼

It excludes locale routing mechanics beyond hreflang tags, Content Layer schema design, and image optimization with the Image or Picture components. Those belong to the astro-i18n, astro-content, and astro-assets skills respectively.