astro-seo
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAstro SEO
Astro SEO
Audits and improves the SEO setup of an Astro site against the full stack described in Astro SEO: the definitive guide. The skill covers nine areas — technical foundation, structured data, content, site structure, performance, sitemaps and indexing, agent discovery, redirects, and analytics — and produces drop-in code for anything missing or weak.
The opinionated spine of this skill is . Most of the fixes route through it. If the project doesn't use it yet, installing it is the first recommendation.
@jdevalk/astro-seo-graphCode recipes live in — read it when you need to implement a specific fix. This file has the workflow and audit checklist.
AGENTS.md根据《Astro SEO:权威指南》(https://joost.blog/astro-seo-complete-guide/)中描述的完整体系,审核并优化Astro站点的SEO配置。本工具涵盖九大领域——技术基础、结构化数据、内容、站点结构、性能、站点地图与索引、Agent发现、重定向和分析,并针对缺失或薄弱环节生成可直接嵌入的代码。
本工具的核心依赖是 。大多数修复方案都基于该包实现。如果项目尚未安装该包,第一步就是建议安装它。
@jdevalk/astro-seo-graph代码示例位于 ——当你需要实现特定修复时请查阅该文件。本文件包含工作流程和审核清单。
AGENTS.mdWorkflow
工作流程
- Detect the project — confirm this is an Astro site and understand its shape.
- Audit — score nine categories and produce actionable findings.
- Improve — generate or modify files to close the gaps. Recipes are in .
AGENTS.md - Metadata pass — invoke on every short string the skill generated (titles, descriptions, schema
metadata-checkfields, FAQ answers, frontmatter excerpts).description - Verify — run the build, check validations pass, remind the user about non-file tasks (Search Console, Bing Webmaster Tools, IndexNow key verification).
- 项目检测 — 确认这是一个Astro站点并了解其结构。
- 审核 — 对九个类别进行评分,并生成可执行的检测结果。
- 优化 — 生成或修改文件以填补漏洞。具体示例见。
AGENTS.md - 元数据校验 — 对本工具生成的所有短字符串(标题、描述、Schema 字段、FAQ答案、前置内容摘要)调用
description工具。metadata-check - 验证 — 执行构建,检查验证是否通过,提醒用户完成非文件类任务(Search Console、Bing Webmaster Tools、IndexNow密钥验证)。
Phase 0: Detect the project
阶段0:项目检测
Confirm the basics before auditing:
- /
astro.config.mjsexists.astro.config.ts - has
package.jsonas a dependency.astro - is set in
site:— canonicals, sitemaps, and OG image URLs all derive from this. If it's missing, empty, orastro.config, flag it as a blocking issue before anything else. This is the single most common misconfiguration.http://localhost - Content collections in (or legacy
src/content/markdown).src/pages/ - Deployment target — read ,
package.json,vercel.json,netlify.toml, orwrangler.tomlto determine the host. This drives redirect and header syntax in Phase 2.public/_headers - Is already installed? If yes, record the version and which features are wired (grep for
@jdevalk/astro-seo-graph,<Seo,seoGraph(,createSchemaEndpoint,createSchemaMap,FuzzyRedirect,createIndexNowKeyRoute,createMarkdownEndpoint,createApiCatalog). Check the installed version against the latest on npm withgitLastmod. If the project is behind, recommend an upgrade in Phase 2 before auditing feature gaps — the package ships new defaults and fixes regularly, and an outdated version is a plausible cause for any audit finding. Phase 2 branches on this.npm view @jdevalk/astro-seo-graph version - Is the site multilingual? Check for in
i18nor multiple locale directories underastro.config. If yes, hreflang matters; if no, skip it.src/content/
Ask only what you can't detect. Don't ask the user what the site is about — read and the homepage content.
astro.config.mjs审核前先确认基础信息:
- 存在/
astro.config.mjs文件。astro.config.ts - 中包含
package.json依赖。astro - 中已设置
astro.config— 规范URL、站点地图和OG图片URL均由此派生。如果缺失、为空或设为site:,需将其标记为阻塞问题优先处理。这是最常见的配置错误。http://localhost - 中存在内容集合(或旧版
src/content/中的markdown文件)。src/pages/ - 部署目标 — 读取、
package.json、vercel.json、netlify.toml或wrangler.toml以确定托管平台。这将决定阶段2中的重定向和头部语法。public/_headers - 是否已安装? 如果已安装,记录其版本及已启用的功能(搜索
@jdevalk/astro-seo-graph、<Seo、seoGraph(、createSchemaEndpoint、createSchemaMap、FuzzyRedirect、createIndexNowKeyRoute、createMarkdownEndpoint、createApiCatalog)。使用gitLastmod检查已安装版本是否为npm上的最新版本。如果项目版本落后,在阶段2审核功能漏洞前建议先升级——该包会定期更新默认配置和修复问题,过时版本可能是审核发现问题的原因。阶段2会根据此结果分支处理。npm view @jdevalk/astro-seo-graph version - 站点是否为多语言? 检查中是否有
astro.config配置,或i18n下是否有多个语言环境目录。如果是,hreflang配置很重要;如果不是,则跳过。src/content/
仅询问无法自动检测的信息。不要询问用户站点的主题——直接读取和首页内容即可。
astro.config.mjsPhase 1: Audit
阶段1:审核
Score each category out of 10. For each, give 2–4 specific findings that quote the actual code or config. Within each category, checks are tiered:
- Must — ship blockers. A failure here causes visible SEO regression.
- Should — standard practice. Skipping costs reach.
- Nice — forward-looking or situational. Useful but not baseline for every site.
Skip Nice checks for small personal blogs unless the user asks for the full treatment.
每个类别按10分制评分。每个类别需给出2-4个引用实际代码或配置的具体检测结果。每个类别内的检查分为三个层级:
- 必须 — 上线阻塞项。此处失败会导致明显的SEO倒退。
- 应该 — 标准实践。忽略会影响覆盖范围。
- 建议 — 前瞻性或场景化配置。有用但并非所有站点的基线要求。
对于小型个人博客,除非用户要求全面检查,否则跳过建议层级的检查。
1. <Seo>
component and head metadata (/10)
<Seo>1. <Seo>
组件与头部元数据 (/10)
<Seo>- Must — single component for all head metadata (not scattered across layouts).
- Must — in
site:is set to the production origin.astro.config - Must — canonical URLs derived from config with tracking params stripped.
site - Must — canonical omitted when is true (per Google's recommendation).
noindex - Must — fallback chain for missing SEO fields: ;
seo.title → title → siteName. Pages with blank titles or descriptions are the most common symptom of a broken fallback.seo.description → excerpt → first paragraph - Should — meta includes
robots,max-snippet:-1,max-image-preview:large.max-video-preview:-1 - Should — Twitter tags suppressed when they duplicate Open Graph (Twitter falls back automatically).
- Should — alternates present on multilingual sites. Skip if monolingual.
hreflang - Nice — uses 's
@jdevalk/astro-seo-graphcomponent rather than hand-rolled. (Hand-rolled that covers everything above is fine; this skill nudges toward the package because it handles the fallback chain and robots rules by default.)<Seo>
- 必须 — 使用单个组件管理所有头部元数据(而非分散在多个布局中)。
- 必须 — 中的
astro.config已设置为生产环境源地址。site: - 必须 — 规范URL由配置派生,并去除跟踪参数。
site - 必须 — 当为true时省略规范URL(遵循Google建议)。
noindex - 必须 — 缺失SEO字段的回退链:;
seo.title → title → siteName。页面标题或描述为空是回退链失效的最常见症状。seo.description → excerpt → 第一段内容 - 应该 — 元标签包含
robots、max-snippet:-1、max-image-preview:large。max-video-preview:-1 - 应该 — 当Twitter标签与Open Graph重复时禁用Twitter标签(Twitter会自动回退到Open Graph)。
- 应该 — 多语言站点包含替代链接。单语言站点跳过。
hreflang - 建议 — 使用提供的
@jdevalk/astro-seo-graph组件而非手动实现。(如果手动实现已覆盖上述所有要求也可;本工具倾向于使用该包,因为它默认处理回退链和robots规则。)<Seo>
2. Structured data / JSON-LD graph (/10)
2. 结构化数据 / JSON-LD图谱 (/10)
- Single flat object, or a linked
Articlewith multiple entities?@graph - Entities wired with references?
@id - ,
WebSite/Blog,WebPage/Person,Organization/BlogPosting,Article,BreadcrumbListall present where relevant?ImageObject - Trust signals: ,
publishingPrinciples,copyrightHolder,copyrightYear,knowsAbout?SearchAction - Validates in Rich Results Test and ClassySchema?
- 使用单个扁平对象,还是包含多个实体的关联
Article?@graph - 实体是否通过引用关联?
@id - 相关场景下是否存在、
WebSite/Blog、WebPage/Person、Organization/BlogPosting、Article、BreadcrumbList?ImageObject - 是否包含信任信号:、
publishingPrinciples、copyrightHolder、copyrightYear、knowsAbout?SearchAction - 是否通过富结果测试和ClassySchema验证?
3. Content collections and SEO schema (/10)
3. 内容集合与SEO Schema (/10)
- Content collections defined with Zod schemas?
- from
seoSchemaenforcing title (5–120) and description (15–160) lengths?@jdevalk/astro-seo-graph - Required fields (,
publishDate,title) enforced at build time?excerpt - Markdown-stripped exposed in schema endpoints (up to 10K chars)?
articleBody
- 内容集合是否使用Zod Schema定义?
- 是否使用的
@jdevalk/astro-seo-graph强制标题(5-120字符)和描述(15-160字符)长度?seoSchema - 是否在构建时强制要求必填字段(、
publishDate、title)?excerpt - Schema端点是否暴露去除Markdown格式的(最多10000字符)?
articleBody
4. Open Graph images (/10)
4. Open Graph图片 (/10)
- Every page has an OG image, or many missing?
- 1200×675 (Google Discover minimum 1200px wide, 16:9 ratio)?
- Generated at build time via satori + sharp, or manual?
- JPEG (social platforms don't reliably support WebP/AVIF)?
- Route derives OG URL from the slug automatically?
- Every in rendered HTML has an
<img>attribute (oralt/alt=""for decorative images)?role="presentation"onvalidateImageAltcatches this at build time in ≥ 1.1.0.seoGraph()
- 是否每个页面都有OG图片,还是大量缺失?
- 尺寸是否为1200×675(Google Discover要求最小宽度1200px,16:9比例)?
- 是否在构建时通过satori + sharp生成,还是手动制作?
- 是否为JPEG格式(社交平台无法可靠支持WebP/AVIF)?
- 是否自动根据slug派生OG图片URL?
- 渲染后的HTML中每个是否都有
<img>属性(装饰性图片使用alt/alt="")?role="presentation"中的seoGraph()在≥1.1.0版本中会在构建时检测此问题。validateImageAlt
5. Sitemaps and indexing (/10)
5. 站点地图与索引 (/10)
- Must — installed, sitemap index reachable.
@astrojs/sitemap - Must — references the sitemap index.
robots.txt - Must — RSS feed exists (), advertised via
@astrojs/rss, contains full post content (not truncated excerpts).<link rel="alternate" type="application/rss+xml"> - Should — split per-collection via option (
chunks, etc.) — much easier to debug indexing in GSC.sitemap-posts-0.xml - Should — populated from git commit timestamps, not frontmatter dates or CI file timestamps.
lastmod≥ 1.4.0 exports@jdevalk/astro-seo-graphfor this — it returns the committer date of the most recent non-excluded commit that touched the file, orgitLastmod(filePath, { excludeCommits, depth })if git is unavailable. Wire it into the sitemapnullcallback. If the codebase has a hand-rolledserializehelper, replace it with the package export — the export handles bulk-commit exclusion (imports, reformats) which a naïveexecSync('git log ...')lookup can't.-1 - Should — IndexNow integrated and submitting on each build, with key verification route at . ≥ 1.0.1 excludes
/[key].txtfrom submissions by default. Gate submission on the production host (e.g./404,process.env.CF_PAGES === '1' && CF_PAGES_BRANCH === 'main',VERCEL_ENV === 'production'). Unconditional submission pings the endpoint on every localCONTEXT === 'production'and preview deploy with URLs the production host hasn't served yet, which gets the key marked invalid (403) and forces rotation.npm run build
- 必须 — 已安装,站点地图索引可访问。
@astrojs/sitemap - 必须 — 引用站点地图索引。
robots.txt - 必须 — 存在RSS订阅源(),通过
@astrojs/rss声明,包含完整文章内容(而非截断摘要)。<link rel="alternate" type="application/rss+xml"> - 应该 — 通过选项按集合拆分(如
chunks等)——在GSC中调试索引问题会更简单。sitemap-posts-0.xml - 应该 — 从git提交时间戳获取,而非前置内容日期或CI文件时间戳。
lastmod≥1.4.0版本导出@jdevalk/astro-seo-graph用于此功能——它返回最近一次非排除提交的提交者日期,如果git不可用则返回gitLastmod(filePath, { excludeCommits, depth })。将其接入站点地图的null回调。如果代码库中有手动实现的serialize工具,替换为该包的导出函数——该导出函数可批量排除提交(如导入、格式化),而简单的execSync('git log ...')查询无法实现此功能。-1 - 应该 — 集成IndexNow并在每次构建时提交,在处设置密钥验证路由。≥1.0.1版本默认排除
/[key].txt页面的提交。仅在生产环境触发提交(例如/404、process.env.CF_PAGES === '1' && CF_PAGES_BRANCH === 'main'、VERCEL_ENV === 'production')。无条件提交会在每次本地CONTEXT === 'production'和预览部署时向端点发送请求,而这些URL尚未在生产环境上线,会导致密钥被标记为无效(403)并需要轮换。npm run build
6. Agent discovery (/10)
6. Agent发现 (/10)
- Should — schema endpoints () exposing corpus-wide JSON-LD.
/schema/*.json - Should — schema map () listing all endpoints, with
/schemamap.xmldirective inSchemamap:.robots.txt - Should — at the site root listing pages (title + description) for LLM consumers.
llms.txt≥ 0.9.0 generates this via the@jdevalk/astro-seo-graphintegration option.llmsTxt - Should — markdown-alternate URLs (next to
/blog/post.md) serving clean markdown with YAML frontmatter for AI agents to consume without HTML parsing./blog/post/≥ 1.2.0 ships@jdevalk/astro-seo-graphfor the route and acreateMarkdownEndpointintegration option that emitsmarkdownAlternate: trueon every page. ≥ 1.3.0 adds post-build verification: the integration walks the build output and strips any link whose<link rel="alternate" type="text/markdown">target isn't on disk (with a.mdper occurrence) — so a misconfigured endpoint surfaces as a build warning instead of a shipped 404. Pair with a Cloudflare Transform Rule (URL rewrite viawarn, nowildcard_replaceheader — CF strips custom Vary values) for content negotiation onVary: Acceptwithout needing SSR.Accept: text/markdown - Should — API catalog at per RFC 9727.
/.well-known/api-catalog≥ 1.4.0 ships@jdevalk/astro-seo-graph, which auto-types schema endpoints to theircreateApiCatalogURLs and absolutizes paths againsthttps://schema.org/<Type>. List the schema endpoints, schemamap, and any site-specific APIs (siteUrl,/ask, etc.). The RFC is finalized so the format is stable; adoption is early but the cost is one route file./feed.xml - Should — Content Signals directive in (e.g.
robots.txt). Declares preferences for AI training, search grounding, and AI input use independently of crawl access. The spec is an IETF draft and adoption is early, but it's one line in a file every site already has.Content-Signal: ai-train=yes, search=yes, ai-input=yes - Should — header on
Linkpointing to discovery files (sitemap, llms.txt, api-catalog, schemamap, and any MCP / A2A cards the site publishes). Agents reading response headers find them without parsing HTML. On Cloudflare Pages / Netlify this is/*; on Vercel it'spublic/_headers.vercel.json - Nice — MCP server card at (SEP-1649) and / or A2A agent card at
/.well-known/mcp/server-card.json(A2A protocol). Only relevant when the site actually exposes an MCP server or A2A agent. Both are static JSON files declaring the endpoint, capabilities, and skills. Skip otherwise./.well-known/agent-card.json - Nice — pointing to a conversational endpoint. NLWeb is early; the tag is one line and worth having, but it's not a scoring blocker in 2026.
<link rel="nlweb">
- 应该 — 提供Schema端点()暴露全站JSON-LD数据。
/schema/*.json - 应该 — 提供Schema映射()列出所有端点,并在
/schemamap.xml中添加robots.txt指令。Schemamap: - 应该 — 在站点根目录放置,列出供LLM消费的页面(标题+描述)。
llms.txt≥0.9.0版本可通过@jdevalk/astro-seo-graph集成选项生成该文件。llmsTxt - 应该 — 提供Markdown替代URL(与
/blog/post.md并存),提供带有YAML前置内容的纯净Markdown,供AI Agent无需解析HTML即可消费。/blog/post/≥1.2.0版本提供@jdevalk/astro-seo-graph用于创建该路由,并提供createMarkdownEndpoint集成选项,在每个页面添加markdownAlternate: true标签。≥1.3.0版本添加了构建后验证:集成工具会遍历构建输出,删除目标<link rel="alternate" type="text/markdown">文件不存在的链接(每个缺失链接会发出.md警告)——这样配置错误的端点会在构建时发出警告,而非上线后出现404错误。可配合Cloudflare转换规则(通过warn重写URL,无需wildcard_replace头——CF会移除自定义Vary值),在无需SSR的情况下实现Vary: Accept的内容协商。Accept: text/markdown - 应该 — 根据RFC 9727在提供API目录。
/.well-known/api-catalog≥1.4.0版本提供@jdevalk/astro-seo-graph,可自动将Schema端点与createApiCatalogURL关联,并根据https://schema.org/<Type>绝对化路径。列出Schema端点、Schema映射和任何站点特定API(如siteUrl、/ask等)。该RFC已定稿,格式稳定;目前采用率较低,但实现成本仅需一个路由文件。/feed.xml - 应该 — 在中添加Content Signals指令(例如
robots.txt)。独立于爬取权限,声明AI训练、搜索 grounding和AI输入使用的偏好。该规范是IETF草案,目前采用率较低,但仅需在每个站点都已有的文件中添加一行。Content-Signal: ai-train=yes, search=yes, ai-input=yes - 应该 — 在路径添加
/*头指向发现文件(站点地图、llms.txt、api-catalog、schemamap,以及站点发布的任何MCP / A2A卡片)。读取响应头的Agent无需解析HTML即可找到这些文件。在Cloudflare Pages / Netlify上可通过Link实现;在Vercel上可通过public/_headers实现。vercel.json - 建议 — 在添加MCP服务器卡片(SEP-1649)和/或在
/.well-known/mcp/server-card.json添加A2A Agent卡片(A2A协议)。仅当站点实际暴露MCP服务器或A2A Agent时才需要。两者均为静态JSON文件,声明端点、功能和工具。否则跳过。/.well-known/agent-card.json - 建议 — 添加指向对话端点。NLWeb尚处于早期阶段;该标签仅需一行代码,值得添加,但在2026年不会作为评分阻塞项。
<link rel="nlweb">
7. Performance (/10)
7. 性能 (/10)
- Static output by default (no SSR on pages that don't need it)?
- Zero client-side JS unless an island requires it?
- Astro component used for all content images (responsive srcset, WebP, lazy, async)?
<Image> - Primary web font preloaded in woff2?
- with
<ClientRouter />for prefetch?defaultStrategy: 'viewport' - Hashed assets under serve
/_astro/?Cache-Control: public, max-age=31536000, immutable - response header stripping UTM parameters from cache key?
No-Vary-Search
- 默认是否为静态输出(不需要SSR的页面不使用SSR)?
- 是否仅在需要时才引入客户端JS?
- 所有内容图片是否使用Astro 组件(响应式srcset、WebP、懒加载、异步)?
<Image> - 主网页字体是否以woff2格式预加载?
- 是否使用的
defaultStrategy: 'viewport'进行预取?<ClientRouter /> - 下的哈希资源是否设置
/_astro/?Cache-Control: public, max-age=31536000, immutable - 是否设置响应头从缓存键中去除UTM参数?
No-Vary-Search
8. Redirects and error handling (/10)
8. 重定向与错误处理 (/10)
- (or equivalent) maintained for every URL that ever existed and moved?
public/_redirects - 301 not 302 for permanent moves?
- component from
FuzzyRedirectwired into the 404 page?@jdevalk/astro-seo-graph - 404 page itself returns a 404 status, not 200?
- 是否为所有已变更的历史URL维护(或等效文件)?
public/_redirects - 永久移动是否使用301而非302?
- 404页面是否接入的
@jdevalk/astro-seo-graph组件?FuzzyRedirect - 404页面本身是否返回404状态码,而非200?
9. Build-time validation and content quality (/10)
9. 构建时验证与内容质量 (/10)
- Must — integration running on each build with
seoGraph()andvalidateH1enabled. For JSON-LD validation, passvalidateUniqueMetadatatowarnOnDanglingReferences: trueinassembleGraph()— that's the assembly-time check, not an integration option.seo-graph-core - Should — ,
validateImageAlt, andvalidateMetadataLengthenabled onvalidateInternalLinks(all defaultseoGraph()in ≥ 1.1.0). They catch missing alt text, titles or descriptions outside SERP bounds (defaults: title 30–65, description 70–200), and internal links that 404 or hit a trailing-slash mismatch. Upgrade to ≥ 1.1.1 if the project is on 1.1.0 — that patch release fixes two validator bugs:truenow recognisesvalidateInternalLinksassets as valid targets (no more false positives onpublic/or/images/*), and/fonts/*no longer truncates descriptions containing a raw apostrophe. UsevalidateMetadataLengthonly for SSR-only routes, wildcards, andskipparams.[slug] - Should — broken link checker in CI for external links. A lychee GitHub Action on every push to content files catches dead links before they go live; a weekly scheduled run catches link rot as external sites move or disappear. Broken outbound links are a bad UX and a negative trust signal. Internal links are covered by at build time; lychee handles everything else.
validateInternalLinks - Should — SEO strings (titles, descriptions, FAQ answers) audited for metadata quality — front-loading, concreteness, truncation fit, no title/description duplication. Phase 2.5 chains this in via . Individual post prose can be audited separately via
metadata-check.readability-check
- 必须 — 每次构建时运行集成,并启用
seoGraph()和validateH1。对于JSON-LD验证,在validateUniqueMetadata的seo-graph-core中传入assembleGraph()——这是组装时的检查,而非集成选项。warnOnDanglingReferences: true - 应该 — 在上启用
seoGraph()、validateImageAlt和validateMetadataLength(≥1.1.0版本默认均为validateInternalLinks)。它们会检测缺失的alt文本、超出SERP范围的标题或描述(默认:标题30-65字符,描述70-200字符),以及指向404或尾部斜杠不匹配的内部链接。如果项目使用1.1.0版本,建议升级到≥1.1.1版本——该补丁修复了两个验证器bug:true现在会将validateInternalLinks资源识别为有效目标(不再对public/或/images/*产生误报),/fonts/*不再截断包含原始撇号的描述。仅对仅SSR路由、通配符和validateMetadataLength参数使用[slug]。skip - 应该 — 在CI中使用断链检查工具检测外部链接。每次推送到内容文件时运行lychee GitHub Action,可在上线前发现死链;每周定时运行可检测外部站点变更或消失导致的链接失效。失效的外部链接会影响用户体验,并传递负面信任信号。内部链接已在构建时由覆盖;lychee处理其他所有链接。
validateInternalLinks - 应该 — 审核SEO字符串(标题、描述、FAQ答案)的元数据质量——前置关键词、具体性、截断适配、标题/描述不重复。阶段2.5通过工具关联此检查。单篇文章的 prose 质量可单独通过
metadata-check工具审核。readability-check
Phase 2: Improve
阶段2:优化
Based on the audit, produce the concrete code. Always ask before overwriting. Read for detailed recipes.
AGENTS.mdBranch on the Phase 0 findings. If is already installed, skip the install step and focus on wiring the features the audit flagged as missing (IndexNow, FuzzyRedirect, schema endpoints, build validation). If the user has a hand-rolled setup that already satisfies the Must checks in category 1, don't rip it out — add only what's missing. Replacement is a last resort, not the default.
@jdevalk/astro-seo-graphAGENTS.md根据审核结果生成具体代码。覆盖文件前务必先询问用户。详细示例请查阅。
AGENTS.md根据阶段0的检测结果分支处理。如果已安装,跳过安装步骤,专注于接入审核中标记为缺失的功能(IndexNow、FuzzyRedirect、Schema端点、构建验证)。如果用户的手动实现已满足类别1中的必须检查项,不要替换它——仅添加缺失的内容。替换是最后的手段,而非默认操作。
@jdevalk/astro-seo-graphAGENTS.mdPhase 2.5: Metadata and readability pass
阶段2.5:元数据与可读性校验
Invoke the skill on every short string the skill generated or modified: page titles, meta descriptions, schema fields, FAQ answers, and any blog post frontmatter values you wrote. It checks front-loading, concreteness, filler, active voice, title/description duplication, difficult words, SERP-truncation fit (title 30–65, description 70–200 — the same bounds enforces), and one-idea-per-field. Apply the fixes directly. Skip the pass entirely for technical strings (URLs, schema values, enum values).
metadata-checkdescriptionexcerptvalidateMetadataLength@idIf the project has a blog or docs content collection, mention to the user as a follow-up that the skill can audit individual posts for multi-paragraph prose quality — but don't audit the entire content corpus yourself.
readability-check对本工具生成或修改的所有短字符串调用工具:页面标题、元描述、Schema 字段、FAQ答案,以及你编写的任何博客文章前置内容值。该工具会检查前置关键词、具体性、冗余内容、主动语态、标题/描述重复、难词、SERP截断适配(标题30-65字符,描述70-200字符——与强制执行的范围一致),以及每个字段单一主题。直接应用修复方案。技术字符串(URL、Schema 值、枚举值)可跳过此校验。
metadata-checkdescriptionexcerptvalidateMetadataLength@id如果项目包含博客或文档内容集合,后续可提醒用户工具可审核单篇文章的多段落prose质量——但不要自行审核整个内容库。
readability-checkPhase 3: Verify
阶段3:验证
- Run . If
npm run buildis wired, this also runs H1 validation, duplicate-meta detection, and schema validation — surface any warnings.seoGraph() - Spot-check the built HTML: one page's should now be clean, canonical correct, JSON-LD graph present and linked.
<head> - Run the homepage through Rich Results Test and ClassySchema.
- Confirm exists and references per-collection sitemaps.
/sitemap-index.xml - If IndexNow is wired, confirm the key verification route returns the key at .
/[key].txt - Remind the user about tasks that can't be automated:
- Register the site in Google Search Console and Bing Webmaster Tools.
- Submit the sitemap index in both.
- Generate an IndexNow key and commit it to config.
- Install Plausible or equivalent privacy-friendly analytics.
- 执行。如果已接入
npm run build,构建时还会运行H1验证、重复元数据检测和Schema验证——展示所有警告信息。seoGraph() - 抽查构建后的HTML:某一页的应简洁规范,规范URL正确,JSON-LD图谱存在且关联正确。
<head> - 将首页通过富结果测试和ClassySchema验证。
- 确认存在并引用按集合拆分的站点地图。
/sitemap-index.xml - 如果已接入IndexNow,确认密钥验证路由返回密钥。
/[key].txt - 提醒用户完成无法自动化的任务:
- 在Google Search Console和Bing Webmaster Tools注册站点。
- 在两者中提交站点地图索引。
- 生成IndexNow密钥并提交到配置中。
- 安装Plausible或其他隐私友好型分析工具。
Output format
输出格式
markdown
undefinedmarkdown
undefinedAstro SEO audit: [site name]
Astro SEO审核报告: [站点名称]
Score
评分
| Category | Score |
|---|---|
1. | x/10 |
| 2. Structured data / JSON-LD graph | x/10 |
| 3. Content collections and schema | x/10 |
| 4. Open Graph images | x/10 |
| 5. Sitemaps and indexing | x/10 |
| 6. Agent discovery | x/10 |
| 7. Performance | x/10 |
| 8. Redirects and error handling | x/10 |
| 9. Build-time validation and content | x/10 |
| Total | xx/90 |
| 类别 | 得分 |
|---|---|
1. | x/10 |
| 2. 结构化数据 / JSON-LD图谱 | x/10 |
| 3. 内容集合与Schema | x/10 |
| 4. Open Graph图片 | x/10 |
| 5. 站点地图与索引 | x/10 |
| 6. Agent发现 | x/10 |
| 7. 性能 | x/10 |
| 8. 重定向与错误处理 | x/10 |
| 9. 构建时验证与内容质量 | x/10 |
| 总分 | xx/90 |
Findings
检测结果
[Grouped by category. Quote actual code/config. Be specific.]
[按类别分组。引用实际代码/配置。内容需具体。]
Files generated or changed
生成或修改的文件
[List with short description of each.]
[列出每个文件及简短描述。]
Next steps
后续步骤
[Non-file tasks: GSC, Bing Webmaster Tools, IndexNow key generation, analytics.]
---[非文件类任务:GSC、Bing Webmaster Tools、IndexNow密钥生成、分析工具。]
---Key principles
核心原则
- Opinionated defaults over optionality. The guide picks a stack; this skill applies it. Don't offer five alternatives when one works.
- is the spine. Route the
@jdevalk/astro-seo-graphcomponent, schema endpoints, IndexNow, FuzzyRedirect, and build validation through it unless the user has a strong reason to hand-roll.<Seo> - Topics, not keyphrases. When reviewing content, focus on topical coverage and readability, not keyword density.
- Static, CDN-served HTML is the baseline. Don't add SSR to solve problems static builds already don't have.
- Agent discovery matters now. Schema endpoints, schema map, NLWeb tags — the crawler is no longer the only consumer.
- 优先使用预设默认值而非可选配置。指南已选定技术栈;本工具直接应用该栈。当一种方案可行时,不要提供五种替代选项。
- 是核心依赖。
@jdevalk/astro-seo-graph组件、Schema端点、IndexNow、FuzzyRedirect和构建验证均通过该包实现,除非用户有充分理由手动实现。<Seo> - 关注主题而非关键词。审核内容时,聚焦主题覆盖范围和可读性,而非关键词密度。
- 静态CDN托管HTML是基线。不要为静态构建已解决的问题添加SSR。
- Agent发现至关重要。Schema端点、Schema映射、NLWeb标签——爬虫不再是唯一的消费者。