如何用 Windsurf PR Comments 修复 SEO/GEO 问题

用 Windsurf 在 pull request 中检查 SEO/GEO regressions、证据、diff 与 approval。

你会建立什么

这篇教学会示范如何用 Windsurf 修 SEO/GEO pull request comments,而且不让一则 comment 变成大范围重写。初学者安全规则很简单:一则 PR comment、一个 classification、一个 scoped fix、一份 validation note。

你会建立:

.windsurf/workflows/pr-seo-geo-comment-fix.md
seo-geo/pr-comments/
unresolved.md
fix-log.md
validation.md

Windsurf 处理 SEO/GEO PR comments:分类、限定修复、验证与回复

图说:每次只处理一则 comment,避免 PR drift 和未核准的大范围修改。

这个 workflow 适合 metadata、schema、internal links、content claims、indexing、templates、analytics 与 page quality 的 review comments。

步骤 1:建立 workflow

mkdir -p .windsurf/workflows seo-geo/pr-comments
cat > .windsurf/workflows/pr-seo-geo-comment-fix.md <<'EOF2'
# PR SEO/GEO Comment Fix

Goal: address one approved SEO/GEO review comment without unrelated edits.

Inputs:
- PR comment text
- referenced file and line if available
- branch name
- reviewer priority

Steps:
1. Read only the selected PR comment and referenced file area.
2. Classify the issue: metadata, schema, internal link, content claim, indexing, template, analytics, localization, or page quality.
3. Decide whether it is safe to fix or requires approval.
4. Write the plan to `seo-geo/pr-comments/fix-log.md`.
5. Stop for approval if the comment touches high-risk areas.
6. Apply only the scoped fix.
7. Run available validation.
8. Write `seo-geo/pr-comments/validation.md`.
9. Draft a reviewer reply, but do not resolve the GitHub conversation automatically.

High-risk areas requiring approval:
- pricing
- legal, medical, or financial claims
- customer proof
- robots/noindex
- canonicals
- redirects
- sitemap generation
- analytics/GTM/GA4
- shared templates
- localization canonical/hreflang policy

Forbidden:
- do not edit unrelated files
- do not address multiple comments at once
- do not publish or deploy
- do not invent proof
EOF2

步骤 2:整理 unresolved comments

如果你没有 GitHub CLI access,可以手动贴 comments:

cat > seo-geo/pr-comments/unresolved.md <<'EOF2'
# Unresolved SEO/GEO PR Comments

## Comment 1
File: `src/pages/features/reporting.astro`
Reviewer:请改善 meta description。目前对 reporting automation query 来说太 generic。

## Comment 2
File: src/lib/seo.ts
Reviewer:这个 canonical change 可能影响 localized pages。Merge 前请先 verify。
EOF2

如果你使用 GitHub CLI,也可以另外 export PR discussion data,但不要把 secrets 或 private customer data 贴进 workflow。

步骤 3:一次只处理一则 comment

打开 Windsurf,执行:

Run /pr-seo-geo-comment-fix for Comment 1 in `seo-geo/pr-comments/unresolved.md`.

Process only Comment 1.
Do not touch Comment 2.
Do not edit unrelated files.
First classify the comment and write the plan to `seo-geo/pr-comments/fix-log.md`.
Stop before editing.

好的 plan 会像这样:

Comment:Comment 1
分类:metadata
风险:低
参考档案:`src/pages/features/reporting.astro`
建议修复:根据现有页面内容,把 generic meta description 改成更符合 query 的 description
要修改的档案:`src/pages/features/reporting.astro`
验证:执行 `npm run build`
需要核准:需要,编辑前先核准

步骤 4:使用 classification table

Comment 类型

安全的第一步

核准等级

缺少 meta description

提出单页修改

一般核准

Duplicate H1

先检查 page template

一般核准

Invalid schema field

确认 source data 存在

一般核准

Internal link 太弱

只加入相关连结

一般核准

Canonical 错误

诊断受影响 URLs

明确核准

Pricing claim

标成 TODO 或询问 business owner

明确核准

Fake proof

移除或标成 TODO

有 source 前先阻挡

Robots/noindex

只做诊断

明确核准

Analytics change

不要在 content PR 里修改

明确核准

不要让 Windsurf 把 canonical comment 当成 copy edit。Classification 就是安全门槛。

步骤 5:核准并套用最小修复

看完 fix-log.md 后,狭义核准:

Approved:只修 Comment 1。
允许修改的档案:
- `src/pages/features/reporting.astro`

未核准:
- schema edits
- canonical edits
- analytics edits
- shared template edits
- unrelated copy rewrites

Apply the smallest fix, run validation, and write `seo-geo/pr-comments/validation.md`.

修改后检查:

git diff --name-only
git diff --stat

Changed files 应该和你的 approval 一致。

步骤 6:草拟 PR reply

请 Windsurf:

Draft a reply for the reviewer.
Include:
- comment addressed
- files changed
- validation run
- risks still open
- anything that still needs human review
Do not resolve the comment automatically.

好的 reply:

已处理 src/pages/features/reporting.astro 里过于 generic 的 meta description。这次修改只限于该页面档案,没有碰 schema/canonical helpers。已成功执行 npm run build。请在 resolve 前确认 description 符合已核准 positioning。

弱的 reply:

Fixed SEO.

步骤 7:第一则完成后才处理下一则

Comment 2 要开新的 workflow invocation。不要和 Comment 1 绑在一起。

Now run /pr-seo-geo-comment-fix for Comment 2 only. This touches canonical logic, so diagnose and stop before editing.

这可以防止 PR drift。

FAQ

Cascade 应该自动 resolve comments 吗?

不要。让它准备 fix 与 summary。GitHub conversation 应该由 human reviewer resolve。

这可以用在 content PRs 吗?

可以,只要 workflow 会阻挡 unsupported proof,并避免大范围重写。

如果一则 comment 需要多个 files 怎么办?

要求 Windsurf 列出明确 file list 与原因。如果一则 comment 的修复会影响 shared template,就把它当成高风险处理。

AI coding agents for SEO/GEO 学习路径

Windsurf track:

  1. Cursor vs Windsurf vs Gemini CLI:SEO/GEO 自动化怎么选
  2. 如何建立 Windsurf Cascade Workflows 做 SEO/GEO
  3. 如何把 Windsurf Rules and Memories 用在 SEO/GEO Projects
  4. 如何用 Windsurf 把 Keyword Research 变成 Content Briefs
  5. 如何用 Windsurf 处理 SEO/GEO PR Comments
  6. Cursor、Windsurf、Gemini CLI、Codex、Claude Code 的 SEO/GEO 营运模型

Sources and notes

Author: Tessa Clarke, Auspia 120+ Editorial Systems Content Governance Lead。Tessa 撰写 review systems、publishing standards 与 safe AI-assisted content operations。

探索此主题

继续阅读同一增长脉络