Codex SEO workspace structure:`AGENTS.md`、site context、data map、reports 与 approval gate。
实际成果
Codex SEO workspace 不只是一个放满 prompts 的 folder。它是一个让 Codex 可以读 durable instructions、inspect site files、run safe checks,并产出可 review 的 SEO/GEO artifacts 的 project。这个 setup 的中心是 AGENTS.md:一份 project instruction file,告诉 Codex 在 repository 里应该如何行动。
当你希望 Codex 在不同 sessions 里记住 SEO rules,而不是每次都贴一个巨大 prompt 时,就使用这个 workflow。把稳定规则放进 AGENTS.md;把会变动的 data 放进 seo/ files;把一次性 requests 放在 chat 里。
这个 workflow 让读者把实作方式连到真实 Codex surface,而不是只看概念。
AGENTS.md 应该放什么
AGENTS.md 应该具体到足以引导 Codex,但不要大到变成第二个 CMS。请聚焦在 operating rules。
| Section | 应该包含什么 | 不应该包含什么 |
|---|---|---|
| Role | Codex 是 SEO/GEO operator,不是 autopublisher | 很长的 brand philosophy paragraphs |
| Workspace paths | exports、reports、screenshots 与 queues 的位置 | Raw API keys 或 secrets |
| Safety rules | 没有 approval 不 publish、不 submit URL、不改 canonical/robots | 模糊的「be careful」instructions |
| Output formats | Briefs、tickets、tables、QA memos | 无法 review 的 free-form summaries |
| Verification | Commands、checks、expected evidence | Unsupported ranking guarantees |
建立 workspace structure
从干净的 project folder 开始:
codex-seo-workspace/
AGENTS.md
seo/
site-context.md
data-map.md
prompt-map.csv
monitored-urls.csv
action-queue.md
reports/
exports/
screenshots/
接著先要求 Codex inspect folder,不要立刻做 SEO 工作:
Read AGENTS.md and the files under seo/. Do not change any production file.
Summarize what data is available, what is missing, and what SEO/GEO tasks are safe to run.
SEO/GEO starter AGENTS.md
# Codex SEO/GEO Operator Instructions
You are assisting with SEO and GEO operations for this site.
## Allowed work
- Read public site files and exported analytics data.
- Create briefs, reports, tickets, and review checklists.
- Propose changes with evidence.
- Run local validation commands when they are safe.
## Blocked work without explicit approval
- Publishing CMS content.
- Submitting URLs to search engines.
- Editing robots.txt, redirects, canonicals, schema, sitemap files, or production config.
- Changing account settings or using write-enabled API keys.
## Required outputs
Every recommendation must include:
- evidence source
- affected URL
- confidence
- risk level
- next action
- whether human approval is required
## File conventions
- Store exports in seo/exports/.
- Store reports in seo/reports/.
- Append approved tasks to seo/action-queue.md.
- Keep raw snapshots separate from summaries.
问 strategy 前先加入 site context
Codex 在能读 facts 时,比靠猜测表现更好。先建立 seo/site-context.md:
# Site Context
Brand:
Primary audience:
Main product or service:
Priority markets:
Important URLs:
Known competitors:
Conversion paths:
Topics we should avoid:
接著建立 seo/data-map.md:
# Data Map
| Source | File or connector | What it proves | Freshness | Limitations |
| --- | --- | --- | --- | --- |
| GSC | seo/exports/gsc-queries.csv | queries, clicks, impressions, CTR | weekly | Google only |
| Bing | seo/exports/bing-pages.csv | Bing clicks and crawl hints | weekly | smaller volume |
| GA4 | seo/exports/landing-pages.csv | engagement and conversion | weekly | attribution limits |
第一个 task 该跑什么
不要从「do SEO」开始。先跑 inventory task:
Using AGENTS.md, site-context.md, and data-map.md, create a first-week SEO/GEO action plan.
Do not write final copy. Do not change files outside seo/reports/.
Return:
1. missing data
2. top safe checks
3. pages to inspect
4. risks
5. approval needed before any edits
好输出长什么样
有用的 Codex output 应该命名 files、evidence 与 next steps:
| Finding | Evidence | Safe next action | Approval |
|---|---|---|---|
| Setup guide gets impressions but low CTR |
| 在 brief 里 draft title/meta options | Editorial |
| GEO prompt map has no target URL for comparison prompts |
| 新增 target URL column 与 page mapping | SEO lead |
| Robots rule may block an AI crawler |
| 建立 technical ticket,不要直接 edit | Engineering + SEO |
常见错误
- 把 temporary data 放进
AGENTS.md,而不是放在seo/底下的 files。 - Approval gate 前就要求 Codex publish 或 submit URLs。
- 用一个巨大 prompt 取代 durable workspace files。
- Codex 还没有 evidence 就让它 rewrite page。
- 忘记记录 recommendation 为什么被 accepted 或 rejected。
FAQ
AGENTS.md 跟 prompt 一样吗?
不一样。请把它当成 durable project guidance。它适合放那些应该在 workspace 里重复套用的 rules。
我应该把 API keys 放进 AGENTS.md 吗?
不要。Secrets 应留在你平常的 secure environment。AGENTS.md 应描述 allowed data sources 与 safety rules,不应放 credentials。
Beginner 不用 MCP 也可以吗?
可以。先从 GSC、Bing Webmaster Tools、GA4 或 keyword tools 的 CSV exports 开始。等 workflow 证明有用后,再加入 MCP。
Codex SEO/GEO learning path
这篇文章是 Codex SEO/GEO operator series 的一部分。如果你要从零建立 workflow,建议照这个顺序读:
- 如何在 2026 年用 Codex 做自动化 GEO
- 如何用 Codex 做自动化 SEO
- 如何用 AGENTS.md 建立 Codex SEO Workspace
- 如何用 MCP 把 Codex 接上 SEO Data
- 2026 年最佳 Codex GEO Skill
- 如何建立 Codex Keyword Clustering Skill
- 如何用 Codex Subagents 做 SERP、内容与技术 SEO
- 如何用 Codex 修 Technical SEO 且不破坏 Production
- 如何用 Codex Automations 跑每日 SEO/GEO Monitoring
- Codex SEO/GEO Quality Gates:Diff、Evidence、Tests 与 Human Approval
下一步
- 上一篇: 如何用 Codex 做自动化 SEO
- 下一篇: 如何用 MCP 把 Codex 接上 SEO Data
- 相关: Codex SEO/GEO Quality Gates:Diff、Evidence、Tests 与 Human Approval
Sources and notes
请以 OpenAI 官方 Codex documentation 作为 current syntax 与 product behavior 的准确来源:
- Codex CLI: https://developers.openai.com/codex/cli
- AGENTS.md: https://developers.openai.com/codex/guides/agents-md
- Codex Skills: https://developers.openai.com/codex/skills
- Codex MCP: https://developers.openai.com/codex/mcp
- Codex subagents: https://developers.openai.com/codex/subagents
- Codex configuration: https://developers.openai.com/codex/config-reference
Author: Camille Rhodes, Auspia 300+ AI Content Workflows 架构师。Camille 撰写 AI-assisted content systems、automation 与 growth teams 的 editorial quality control。