你會建立什麼
這篇教學會示範如何用 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
圖說:每次只處理一則 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:
- Cursor vs Windsurf vs Gemini CLI:SEO/GEO 自動化怎麼選
- 如何建立 Windsurf Cascade Workflows 做 SEO/GEO
- 如何把 Windsurf Rules and Memories 用在 SEO/GEO Projects
- 如何用 Windsurf 把 Keyword Research 變成 Content Briefs
- 如何用 Windsurf 處理 SEO/GEO PR Comments
- Cursor、Windsurf、Gemini CLI、Codex、Claude Code 的 SEO/GEO 營運模型
Sources and notes
- Windsurf/Devin Desktop documentation: Cascade Workflows ,以及 Cascade、Memories & Rules、Skills、AGENTS.md、Worktrees、MCP、Cascade Hooks 等公開導覽。
- Related Auspia guide: Cursor vs Windsurf vs Gemini CLI for SEO/GEO Automation 。
Author: Tessa Clarke, Auspia 120+ Editorial Systems Content Governance Lead。Tessa 撰寫 review systems、publishing standards 與 safe AI-assisted content operations。