提示词
如需完整文档索引,请参阅 llms.txt。文档页面的 Markdown 版本可通过在页面后追加
.md来获取 URL。
提示词是你告诉 ChatGPT 你想了解、创建或更改什么的方式。提示词 可以是一个问题、一条指令或一个目标。你不需要技术语法或 固定公式。用自己的话开始,查看回复,并使用后续 消息来调整结果。
简短的提示词通常就足够了。对于更大或更重要的任务,请包含 关键部分:
- 目标: 应该 ChatGPT 做什么?
- 上下文: 哪些信息或来源会有帮助?
- 输出: 你需要什么格式、长度或详细程度?
- 边界: 哪些内容必须保持不变?应该 ChatGPT 避免什么,或在行动前与你确认 什么?
只使用有帮助的部分。你不需要填完每一项,也不需要遵循 必需格式。
描述你需要的结果
Section titled “描述你需要的结果”从结果开始,而不是列出详细步骤。当受众或 格式会改变 ChatGPT 应生成的内容时,请包含这些细节。
Turn these meeting notes into a short update for the project team.Put the decisions and next steps first.这个提示词说明要创建什么以及谁会阅读。只有当 流程本身很重要时才描述流程。否则,留出 ChatGPT 搜索、比较 信息并调整方法的空间。
添加有用的上下文
Section titled “添加有用的上下文”分享可能改变结果的信息。只添加 重要来源,并说明 ChatGPT 应从每个来源提取什么。
- 附加文档、电子表格、演示文稿或 PDF 文件,当你想要 ChatGPT 总结、比较、转换或 创建供审阅的文件。
- 添加截图、图表或其他 图片输入 当 任务依赖视觉上下文时。指出重要区域,而不要 只依赖图片本身。
- 请求 ChatGPT 使用 网页搜索 当答案取决于 当前信息时,并在需要核查结果时要求提供来源。
- 使用 项目 当相关聊天应共享文件、 来源或本地文件夹时。
使用已连接的来源
Section titled “使用已连接的来源”当 ChatGPT 可以访问已连接来源时,请说明它应该在哪里查找以及 应该找到什么。你不需要描述它应执行的每一次搜索。
Use the latest project plan in Drive and relevant decisions and updates fromthe project's Slack channel to prepare a status update.已连接来源需要对应的插件,可用性也可能取决于 你的套餐和工作区设置。
插件为 ChatGPT 和 Codex 提供可复用的指令以及与工具的连接,
例如 Google Drive、Gmail、Slack 和 GitHub。两个产品都从同一个通用目录获取公共
插件。提出你需要的结果,并让
当前界面从可用工具中选择。在 ChatGPT中,在输入框输入 @
以选择特定插件。
[了解插件
交互内容: Plugin 的动态演示请参阅页面顶部的官方原文链接。
在 ChatGPT 和 Codex中查找、安装和使用插件。](/versions/2026-07-31/docs/plugins)个性化 ChatGPT
Section titled “个性化 ChatGPT”将应适用于所有聊天的偏好放在 设置 > 个性化 中作为自定义指令。只与当前聊天相关的细节保留在 提示词中。
[查看个性化设置
交互内容: Settings 的动态演示请参阅页面顶部的官方原文链接。
设置默认个性、自定义指令和其他应用偏好。](/versions/2026-07-31/docs/reference/settings#personalization)设置可避免实际问题的边界
Section titled “设置可避免实际问题的边界”边界是 ChatGPT 需要遵守的少数指令,用来避免产生额外工作 或执行你并未打算的操作。当改错某个细节 会让结果无法使用,或你希望在它 影响他人之前先审阅时,请添加边界。
- 保持已批准的日期和预算数字不变。
- 仅使用提供的来源。标记缺失的信息,不要猜测。
- 将建议控制在规定的预算内。
- 将消息准备为草稿。不要发送。
专注于最重要的一两个边界。你不需要控制 它执行的 ChatGPT 每一步。
让结果可以直接使用
Section titled “让结果可以直接使用”告诉 ChatGPT 你计划如何使用结果。这有助于它选择合适的 长度、详细程度和组织方式。
- 把它做成一页摘要,便于主管在会前快速浏览。先放 决策和后续步骤。
- 把这些笔记整理成一封跟进邮件,包含决策、负责人和截止 日期。
- 创建一个清晰表格,对比计划支出与实际支出,并突出显示任何 超过 10% 的差异。
对于重要工作,要求 ChatGPT 做最终检查,例如确认每个 行动项都有负责人和截止日期,或标出它无法 核实的信息。然后在使用或分享前自己审阅结果。
通过后续消息改进结果
Section titled “通过后续消息改进结果”你的第一个提示词不需要完美。查看结果,然后要求 你想要的具体修改。
Make the opening more direct, keep the evidence, and move the recommendationabove the background section.你可以添加缺失来源、纠正方向、要求另一个选项,或 更改详细程度,而无需重新开始。
当 Codex 已经在工作时,你可以不等待 当前运行完成就发送另一条消息:
- 引导 会将消息添加到当前运行中。用它来改变方向、补充 缺失的细节,或分享新信息。
- 排队 会保存消息供下一次运行使用。用于应该 等当前工作完成后再处理的后续事项。
在 ChatGPT 桌面应用中,在 设置 > 通用 > 跟进行为下选择默认值。 排队的消息会显示在输入框上方,你可以编辑、重新排序、发送或 删除它们。该设置还会显示使用另一种行为的快捷键, 用于单条消息且不更改默认设置。
在 Codex CLI中,按 Enter 当 Codex 正在工作时,以引导当前 轮次;或按 Tab 将消息排队到下一轮。详情请参阅 交互式快捷键 。
将各部分组合起来
Section titled “将各部分组合起来”对于使用已连接来源的项目更新,一个完整提示词可能 如下所示:
Prepare a one-page project status update for Monday's leadership meeting. Usethe latest project plan in Drive and relevant decisions and updates from theproject's Slack channel.
Lead with the decisions leadership needs to make and the next steps. Summarizeprogress, risks, owners, and due dates. Keep approved dates and budget figuresunchanged. Flag any conflicting or missing information, and don't send orpublish anything.
Before you finish, check that every next step has an owner and due date.这个提示词涵盖 目标、 上下文、 输出和 边界,然后 要求进行最终检查,而不列出每一步。
使用语音听写
Section titled “使用语音听写”在 ChatGPT 桌面应用中,按住 Ctrl+M 当输入框 可见时,然后开始说话。 ChatGPT 会将你的语音转写到输入框中,以便 你在发送提示词前查看和编辑。
交互内容: CodexScreenshot 的动态演示请参阅页面顶部的官方原文链接。
Chat 提示词示例
Section titled “Chat 提示词示例”用 Chat 处理问题、想法、草稿和日常决策。先从 你想要的结果开始,然后只在会改变答案时添加细节。
了解某个主题
Section titled “了解某个主题”Explain how compound interest works for someone who has never invested.Use one concrete example and define any financial terms you introduce.起草和完善文字
Section titled “起草和完善文字”Draft a friendly email declining this invitation because I will be traveling.Keep it under 120 words and leave the door open for a future event.Compare these two phone plans for one person who travels internationally twicea year. Show the important differences in a table, then recommend one and explainthe tradeoff.制定实用计划
Section titled “制定实用计划”Plan five weekday dinners that take less than 30 minutes. Avoid peanuts, reuseingredients across meals, and finish with one consolidated shopping list.ChatGPT Work 提示词
Section titled “ChatGPT Work 提示词”用 Chat 处理快速问题、短文本改写、头脑风暴和轻量 草稿。对于需要调用不同来源或工具、涉及 ChatGPT Work 一系列步骤、进行更改或生成更大交付物的任务,使用 。
在 ChatGPT Work中,描述你需要的结果,提供源材料,说明 受众,并解释你将如何审阅工作。要求 ChatGPT 制定计划、 收集所需信息、创建文件,并在完成前检查它们。
高效使用 ChatGPT Work
Section titled “高效使用 ChatGPT Work”ChatGPT Work 适用于耗时或重复性任务,或适用于你 可以复用的成品文件。如果任务能节省 时间、提升质量或帮助你做出重要决策,即使消耗更多额度也可能值得。
从一个可以审阅的结果开始:
- 只包含相关来源,并在适当时限制日期范围。
- 定义受众、输出格式和期望长度。
- 区分必需工作与可选改进或润色。
- 当方法很重要时,要求制定计划。在 ChatGPT 发送、发布或更改他人依赖的信息前,要求获得你的批准。
- 如果任务开始做你不再需要的工作,请缩小范围或停止任务。
审阅第一个结果,细化指令,并在 有效时复用该工作流。
将源材料转化为成品文件
Section titled “将源材料转化为成品文件”Use the attached quarterly reports to create a leadership brief and a six-slidepresentation.
The audience is the executive team. Lead with the three decisions they need tomake, distinguish reported facts from your analysis, cite each number to itssource file, and check that the brief and slides agree before you finish.研究一项决策
Section titled “研究一项决策”Research three customer-support platforms for a 50-person company. Comparepricing, security, integrations, and migration effort using current sources.Deliver a recommendation memo with links, assumptions, and the questions weshould answer before signing a contract.Create a launch plan for the attached product brief. Include the timeline,owners, dependencies, risks, announcement draft, customer FAQ, and a checklistfor launch day. Flag any missing decisions before producing the final files.对于重复性工作,先在普通聊天中细化提示词。当输出 可靠后, 在该聊天中安排任务。 如果每次计划运行都应启动 新聊天,则创建独立的计划任务。
提示 Codex
Section titled “提示 Codex”当你想让 Codex 处理代码、代码库或开发者工具时,使用 ChatGPT 。 一个有用的 Codex 提示词会说明你想要的行为,指向相关代码或 复现步骤,保留重要约束,并说明如何验证 更改。
对于多步骤任务,输入 /plan 到应用输入框中,当你希望 Codex 去
先调查并提出方法再编辑时。当 目标模式
可用时,使用 /goal 在计划之后设置持久目标。查看 应用斜杠
命令
以了解当前命令列表。
如何阅读这些示例
Section titled “如何阅读这些示例”每个工作流包括:
- 适用场景以及哪个 Codex 界面最合适(IDE、CLI 或 cloud)。
- 步骤以及用户提示词示例。
- 上下文说明:Codex 会自动看到哪些内容,以及你应附加哪些内容。
- 验证:如何检查输出。
注意: IDE extension 会自动将你打开的文件作为上下文。在 CLI 中,请明确提及路径,或使用
/mention和@路径自动补全来附加文件。
Codex 会在 沙箱 中运行本地命令,该沙箱会限制文件和网络访问。如果任务需要越过该边界, Codex 会在继续前遵循你的批准策略。
当你正在熟悉项目、接手服务,或试图理解协议、数据模型或请求流程时,可以使用此工作流。
IDE extension 工作流(本地探索最快)
Section titled “IDE extension 工作流(本地探索最快)”- 打开最相关的文件。
- 选择你关注的代码(可选但推荐)。
- 提示词 Codex:
Explain how the request flows through the selected code.
Include: - a short summary of the responsibilities of each module involved - what data is validated and where - one or two "gotchas" to watch for when changing this验证:
- 要求 Codex 提供一张你可以验证的图表或清单:
Summarize the request flow as a numbered list of steps. Then list the files involved.CLI 工作流(适合需要记录过程和 shell 命令时)
Section titled “CLI 工作流(适合需要记录过程和 shell 命令时)”- 启动一个交互式会话:
codex- 附加文件(可选)并输入提示词:
I need to understand the protocol used by this service. Read @foo.ts @schema.ts and explain the schema and request/response flow. Focus on required vs optional fields and backward compatibility rules.上下文说明:
- 你可以在输入框中使用
@从工作区插入文件路径,或使用/mention附加特定文件。
当你遇到可以在本地复现的失败行为时,可以使用此工作流。
CLI 工作流(包含复现和验证的紧密循环)
Section titled “CLI 工作流(包含复现和验证的紧密循环)”- 在仓库根目录启动 Codex :
codex- 给 Codex 复现步骤,以及你怀疑的 file(s) :
Bug: Clicking "Save" on the settings screen sometimes shows "Saved" but doesn't persist the change.
Repro: 1) Start the app: npm run dev 2) Go to /settings 3) Toggle "Enable alerts" 4) Click Save 5) Refresh the page: the toggle resets
Constraints: - Do not change the API shape. - Keep the fix minimal and add a regression test if feasible.
Start by reproducing the bug locally, then propose a patch and run checks.上下文说明:
- 由你提供:复现步骤和约束(这些内容比高层描述更重要)。
- 由 Codex 提供:命令输出、发现的调用点,以及它触发的任何堆栈跟踪。
验证:
- Codex 修复后应重新运行复现步骤。
- 如果你有标准检查流水线,请要求它运行:
After the fix, run lint + the smallest relevant test suite. Report the commands and results.IDE 扩展工作流
Section titled “IDE 扩展工作流”- 打开你认为 bug 所在的文件,以及离它最近的调用方。
- 提示 Codex:
Find the bug causing "Saved" to show without persisting changes. After proposing the fix, tell me how to verify it in the UI.当你希望定义要测试的确切范围时,可以使用此工作流。
IDE 扩展工作流(基于选区)
Section titled “IDE 扩展工作流(基于选区)”- 打开包含该函数的文件。
- 选择定义该函数的行。从命令面板选择“添加到 Codex 线程”,将这些行加入上下文。
- 提示 Codex:
Write a unit test for this function. Follow conventions used in other tests.上下文说明:
- “Add to Codex Thread”命令提供:选中的代码行(即“行号”范围),以及打开的文件。
CLI 工作流(在提示中描述路径和行范围)
Section titled “CLI 工作流(在提示中描述路径和行范围)”- 启动 Codex:
codex- 用函数名提示:
Add a test for the invert_list function in @transform.ts. Cover the happy path plus edge cases.根据截图制作原型
Section titled “根据截图制作原型”当你希望将设计稿、截图或 UI 参考转换为可运行的原型时,可以使用此工作流。
CLI 工作流(图片 + 提示)
Section titled “CLI 工作流(图片 + 提示)”- 将截图保存在本地(例如
./specs/ui.png)。 - 运行 Codex:
codex-
将图片文件拖入终端,以附加到提示中。
-
继续补充约束和结构:
Create a new dashboard based on this image.
Constraints: - Use react, vite, and tailwind. Write the code in typescript. - Match spacing, typography, and layout as closely as possible.
Outputs: - A new route/page that renders the UI - Any small components needed - README.md with instructions to run it locally上下文说明:
- 图片提供了视觉要求,但你仍需指定实现约束(框架、路由、组件样式)。
- 用文字说明图片未展示的行为,例如悬停状态、验证规则或键盘交互。
验证:
- 要求 Codex 运行开发服务器(如果允许),并准确告诉你应查看的位置:
Start the dev server and tell me the local URL/route to view the prototype.IDE 扩展工作流(图片 + 现有文件)
Section titled “IDE 扩展工作流(图片 + 现有文件)”- 在 Codex 聊天中附加图片(拖放或粘贴)。
- 提示 Codex:
Create a new settings page. Use the attached screenshot as the target UI. Follow design and visual patterns from other files in this project.当你希望在 Codex 编辑代码时,进行紧密的“设计 → 调整 → 刷新 → 调整”循环,可以使用此工作流。
CLI 工作流(运行 Vite,然后使用简短提示进行迭代)
Section titled “CLI 工作流(运行 Vite,然后使用简短提示进行迭代)”- 启动 Codex:
codex- 在单独的终端窗口启动开发服务器:
npm run dev- 提示 Codex 进行更改:
Propose 2-3 styling improvements for the landing page.- 选择一个方向,并用小而具体的提示进行迭代:
Go with option 2.
Change only the header: - make the typography more editorial - increase whitespace - ensure it still looks good on mobile- 使用聚焦的请求重复:
Next iteration: reduce visual noise. Keep the layout, but simplify colors and remove any redundant borders.验证:
- 在 Codex 更新代码时,在浏览器中查看更改。
- 提交你满意的更改,并还原你不满意的更改。
- 如果你还原或修改了某项编辑,请告知 Codex,以便它处理下一条提示时不会覆盖你的编辑。
将重构委托给云端
Section titled “将重构委托给云端”当你希望利用本地上下文设计方案,然后将长期实现委托给可以并行运行的云端聊天时,可以使用此工作流。
本地规划(IDE)
Section titled “本地规划(IDE)”- 确保当前工作已提交,或至少已储藏,以便干净地比较更改。
- 要求 Codex 生成重构计划。如果你有
$plan技能可用,请明确调用它:
$plan
We need to refactor the auth subsystem to: - split responsibilities (token parsing vs session loading vs permissions) - reduce circular imports - improve testability
Constraints: - No user-visible behavior changes - Keep public APIs stable - Include a step-by-step migration plan- 审阅计划并协商更改:
Revise the plan to: - specify exactly which files move in each milestone - include a rollback strategy上下文说明:
- 当 Codex 可以在本地扫描当前代码(入口点、模块边界和依赖图线索)时,规划效果最佳。
云端委托(IDE → Cloud)
Section titled “云端委托(IDE → Cloud)”- 如果还没有,请设置一个 Codex cloud 环境。
- 点击提示输入框下方的云图标,并选择你的云环境。
- 当你输入下一条提示时, Codex 会在云端创建一个新聊天,并带入现有聊天上下文(包括计划和任何本地源代码更改)。
Implement Milestone 1 from the plan.-
审阅云端 diff,必要时迭代。
-
直接从云端创建 PR ,或将更改拉取到本地进行测试并完成收尾。
-
继续迭代计划中的其他里程碑。
委托给云端的任务会在隔离环境中运行。除非你为该环境启用互联网访问,否则 在 Agent 阶段互联网访问处于关闭状态。了解更多 关于 云端互联网访问。
进行本地代码审查
Section titled “进行本地代码审查”当你希望在提交或创建 PR 前获得第二份审查意见时,可以使用此工作流。
CLI 工作流(审查工作树)
Section titled “CLI 工作流(审查工作树)”- 启动 Codex:
codex- 运行审查命令:
/review- 可选:提供自定义关注重点说明:
/review Focus on edge cases and security issues验证:
- 根据审查反馈应用修复,然后重新运行
/review,以确认问题已解决。
审查 GitHub pull request
Section titled “审查 GitHub pull request”当你希望在不将分支拉取到本地的情况下获得审查反馈时,可以使用此工作流。
在使用此功能之前,请在代码库中启用 Codex Code review。请参阅 Code review。
GitHub 工作流(基于评论)
Section titled “GitHub 工作流(基于评论)”- 在 GitHub上打开 pull request。
- 留下一条评论并标记 Codex ,明确说明关注领域:
@codex review- 可选:提供更明确的说明。
@codex review for security vulnerabilities and security concerns当你需要进行准确、清晰的文档更改时,可以使用此工作流。
IDE 或 CLI 工作流(本地编辑 + 本地验证)
Section titled “IDE 或 CLI 工作流(本地编辑 + 本地验证)”- 确定要更改的文档 file(s) 并打开它们(IDE)或
@提及它们(IDE 或 CLI)。 - 提示 Codex 并说明范围和验证要求:
Update the "advanced features" documentation to provide authentication troubleshooting guidance. Verify that all links are valid.- 在 Codex 起草更改后,查看文档并根据需要迭代。
验证:
- 阅读渲染后的页面。