原文核对:2026-10-13 · 中文正文 · 英文提示词与演示
场景定位
对照代码变化、公开文档、发布说明和 PR 背景,起草范围明确的文档更新,并在发布前验证。
- 难度
- 入门
- 时间跨度
- 30 分钟
适合用于
- 需要跟进频繁行为变化的开发文档、README、操作手册、示例和迁移说明。
- 维护技术产品文档的团队。
相关工具
GitHub 是问题来源时,读取 issue、PR、评论、审查会话和失败检查。
GitHub ↗起步提示词
英文原文 · 可复制后按实际材料修改
Update the [product/feature] documentation based on the following sources:
- the changed source files in [this repo/source linked repo]
- the existing docs pages that mention a new behavior
- any linked issue, PR, release note, or public reference I provide below
Then:
- identify what is user-facing
- update only the docs that need to change
- keep unpublished roadmap, private customer details, and internal-only context out of public docs
- preserve the existing docs structure, terminology, and cross-links
- run the docs checks that fit the change
Before finalizing, summarize what changed, what you verified, and any claims you could not prove from trusted sources.
[link release notes or other references here]简介
与源码变化同步更新文档最容易保持准确。Codex 可检查代码、测试、发布说明、关联 issue 和 PR 背景,按既有结构起草局部更新。
适用于开发文档、README、变更日志草稿、迁移说明、操作手册等经常变化的材料。
使用步骤
- 提供需记录的分支、PR、提交、issue 或文件。公开文档应明确排除未发布路线图、私人客户资料和仅限内部的背景。
- 先搜索已有文档中的功能名、配置键、命令、示例和相关术语,定位受影响页面。
- 做最小而有用的更新:保留结构、术语、交叉链接和 frontmatter;简短说明或局部示例足够时,不做大范围重写。
- 运行适合仓库的格式和文档检查,并说明每项用户可见主张的证据。
提供哪些材料
| 来源 | 作用 |
|---|---|
| 变化的代码和测试 | 依据真实行为起草聚焦更新。 |
| 公开发布说明或产品文档 | 匹配公开术语、可用性和功能状态。 |
| PR 或 issue 背景 | 说明变更原因与重要的用户可见行为。 |
| 本地文档检查 | 在发布前提供明确完成标准。 |
补充公开发布说明等背景,有助于避免包含私人信息或尚未公开的更新。
让流程可复用
将仓库通用文档要求写入 AGENTS.md,例如:
## Documentation
- When user-facing behavior changes, check whether docs, examples, or changelogs need updates.
- Public docs must only include public information or behavior visible in this repo.
- Preserve existing terminology and frontmatter.
- Run the docs formatting and build checks before final handoff.步骤较多时可封装成技能,复用来源核验、起草和验证循环,详见“将工作流保存为技能”。
也可以在当前对话中安排定时任务,例如每周获取近期 GitHub PR 并更新文档:
官方提示词
英文原文 · 可复制后按实际材料修改
Schedule a task for the workflow above from this chat. Fetch all the recent PRs in [this repo/linked repo] and update docs based on the changes.展开英文原文对照
Use Codex to compare source code changes, public docs, release notes, and PR context, then draft focused documentation updates with verification steps before publishing.
Introduction
Documentation is easiest to keep current when it is updated alongside source changes, not weeks later. Codex can inspect changed code, tests, release notes, linked issues, and pull request context, then draft a scoped docs update that matches the existing structure.
Use this workflow for developer docs, README updates, changelog drafts, migration notes, runbooks, or anything else that needs to track behavior that changes frequently.
How to use
- Start from the change you need to document. Share the branch, pull request, commit, issue, or files. If the docs are public, say explicitly that unpublished roadmap, private customer details, and internal-only context should stay out.
- Ask Codex to map the affected docs. Have it search existing docs for feature names, config keys, commands, examples, and related terms before drafting.
- Update the smallest useful docs surface. Codex should preserve the current page structure, terminology, cross-links, and frontmatter. It should avoid broad rewrites when a precise note, example, or section update is enough.
- Verify the changes. Ask Codex to run formatting and docs checks that fit the repo, then summarize the evidence behind each user-facing claim.
What to give Codex
| Source | Why it helps |
|---|---|
| Changed code and tests | Lets Codex analyze actual behavior to draft focused documentation updates. |
| Public release notes or product docs | Helps Codex match public terminology, availability, and feature status. |
| Pull request or issue context | Explains why the change happened and which user-facing behavior matters. |
| Local docs checks | Gives Codex a concrete definition of done before the docs are published. |
Adding more context such as public release notes lets Codex avoid including private context or updates that are not yet public.
Make the workflow repeatable
For a repo-wide convention, add documentation expectations to AGENTS.md. For example:
## Documentation
- When user-facing behavior changes, check whether docs, examples, or changelogs need updates.
- Public docs must only include public information or behavior visible in this repo.
- Preserve existing terminology and frontmatter.
- Run the docs formatting and build checks before final handoff.If the process has more steps, turn it into a skill so future Codex tasks can follow the same source-checking, drafting, and verification loop. See Save workflows as skills for more details on this pattern.
You can also schedule a task for this workflow from the current chat. For example, ask Codex to fetch recent GitHub pull requests and keep the docs current every week:
官方提示词
英文原文 · 可复制后按实际材料修改
Schedule a task for the workflow above from this chat. Fetch all the recent PRs in [this repo/linked repo] and update docs based on the changes.