SEO 修復 Agent|SEO Fix & Content Enable
這份文件包含兩個 Agent 模式:fix-p0(修復 Google 無法正常抓取的技術問題)和 content-enable(讓內容頁可被索引)。兩者都是在 audit 完成後才執行。
完整的 audit / bootstrap / post-deploy 模式請參考 Nuxt SEO Engineering Agent。
fix-p0 模式
修復會讓 Google 無法正常抓取、理解、收錄的技術問題。只改 audit 指出的項目,不做無關重構。
P0 問題分類
- Production
site.url錯誤或混用 www / non-www - sitemap index 200,但 child sitemap 無法擷取
- sitemap route 回 HTML / 404 / 500 / Cloudflare challenge
- robots production
Disallow: / - sitemap 包含 noindex 頁、付款頁、會員頁、offline、API
- 重要公開頁 noindex
- canonical 指到錯誤網域、錯誤語系、會 redirect 的 URL
- Nuxt Content 內容頁在 sitemap 中,但直進 SSR 顯示「找不到」
- PWA offline fallback 攔截公開 SEO 頁
修復優先順序
- Canonical domain — 統一
site.url、runtimeConfig.public.siteUrl、fallback - Robots — production 允許公開頁,指向 canonical sitemap
- Sitemap accessibility — sitemap index / child sitemap route 200 XML
- Sitemap quality — 排除 noindex / private / payment / offline,加入公開 content routes
- Indexability contradictions — sitemap URL 不可 noindex,noindex 頁不可進 sitemap
- i18n hreflang — 按實際路由產生 alternate,補 x-default 和 locale alias redirects
- Nuxt Content direct-entry — 正規化 catch-all slug,尾斜線與無尾斜線都可查到 content
- PWA offline fallback —
/offlinenoindex/nofollow,公開 SEO 頁加入navigateFallbackDenylist
Fix-P0 Prompt
Prompt
Nuxt SEO Fix-P0
請依照前一份 SEO Audit 報告,按以下順序修復 P0 問題:
- 統一 canonical domain(site.url / runtimeConfig / fallback / JSON-LD / OG / sitemap)
- 修 robots production 允許抓取,指向 canonical sitemap
- 修 sitemap index / child sitemap route 可 200 XML
- sitemap 排除 noindex / private / payment / offline / API,加入公開 content routes
- 移除 sitemap / noindex 矛盾
- 修 i18n hreflang 按實際路由產生,補 x-default 和 locale alias redirects
- Nuxt Content slug 正規化,尾斜線 / 無尾斜線都能查到
- PWA navigateFallbackDenylist 排除公開 SEO 頁
限制:
- 只修 audit 指出的 P0 項目,不做無關重構
- 不改付款、訂閱、webhook、會員資料流程
- 不把互動主流程硬改 SSR
- 修完跑 build 驗證
請輸出:
- 修改檔案清單與變更摘要
- 每個 P0 問題的修復方式
- Build / test 結果
- Sitemap 修正前後差異
- 尚未處理或需要人工操作的項目
- 部署後 GSC 操作建議
content-enable 模式
讓內容頁可被搜尋引擎正常索引,進 sitemap,有完整 metadata。
內容頁最低需求
每篇公開內容的 frontmatter 至少要有:
---title: ""description: ""publishedAt: "YYYY-MM-DD"updatedAt: "YYYY-MM-DD"seoKeywords: []ogImage: "/og/path.jpg"---建議擴充:
draft: falseprivate: falsecategory: ""series: ""author: ""Content-Enable Prompt
Prompt
Nuxt Content SEO Enable
請讓 Nuxt Content 內容頁可被搜尋引擎正常索引。
請檢查:
- content.config.ts 的 collections 定義
- 公開內容路由(如 /cards/, /learn/, /guide/, /blog/)
- 列表頁與詳情頁是否都可 SSR
- 詳情頁是否用 content frontmatter 設定 title / description / canonical / OG
- sitemap source 是否會讀 content collection
- draft / private / disabled 是否被正確過濾
- lastmod 是否帶入 updatedAt / publishedAt
- 直接貼 URL 進入時,raw HTML 是否有主要內容
請輸出:
- 修改檔案清單
- 內容欄位待補清單(哪些檔案缺哪些 frontmatter)
- 可優先建立的內容方向
- 內部連結建議
- 驗證結果
修復後驗證
cd frontendnpm run buildnpm run verify:seo若本機 build 因 Sentry sourcemap upload 或網路限制失敗,必須說明失敗點、是否已完成 Nuxt client/server/prerender、是否和 SEO 修改無關。
完成標準
Checklist
SEO Fix 完成檢查
- 已依照 audit 報告修復,未做無關重構
- canonical domain 全站統一
- sitemap 不含 noindex / private / offline 頁
- sitemap URL 都回 200,不回 3xx / 4xx
- robots production 允許抓取
- build 通過(或已記錄非 SEO 相關失敗原因)
- 內容頁進 sitemap,draft/private 排除
- 部署後 GSC 操作清單已列出