Prompting overview提示词概述
Prompting is how you tell ChatGPT what you want to know, make, or change. A prompt can be a question, an instruction, or a goal. You don’t need technical syntax or a rigid formula. Start in your own words, review the response, and use follow-up messages to shape the result.提示词是您告诉 ChatGPT 您想要了解、创建或更改内容的方式。提示词可以是问题、指令或目标。您无需使用技术语法或死板的公式。请用自己的话开始,查看回复,然后通过后续消息来优化结果。
A short prompt is often enough. For larger or more important tasks, include the parts that matter:简短的提示词通常就足够了。对于更大或更重要的任务,请包含以下关键要素:
- Goal: What should ChatGPT do?目标:ChatGPT 应该做什么?
- Context: What information or sources will help?背景:哪些信息或来源会有所帮助?
- Output: What format, length, or level of detail do you need?输出:您需要什么格式、长度或详细程度?
- Boundaries: What must stay unchanged? What should ChatGPT avoid or check with you before it acts?边界:哪些内容必须保持不变?ChatGPT 在执行前应避免什么或需要与您确认什么?
Use only the parts that help. You don’t need to fill in every item or follow a required format.仅使用有帮助的部分。您不必填写每一项或遵循特定的格式。
Describe the result you need描述您需要的结果
Start with the result, not a detailed list of steps. Include the audience or format when those details change what ChatGPT should produce.从结果开始,而不是列出详细的步骤清单。当受众或格式会影响 ChatGPT 的产出时,请将其包含在内。
Turn these meeting notes into a short update for the project team.
Put the decisions and next steps first.
This prompt explains what to create and who will read it. Describe a process when the process itself matters. Otherwise, leave ChatGPT room to search, compare information, and adjust its approach.此提示词说明了要创建的内容以及谁会阅读它。如果流程本身很重要,请描述该流程。否则,请留给 ChatGPT 搜索、比较信息并调整其方法的空间。
Add useful context添加有用的背景信息
Share the information that could change the result. Add only the sources that matter, and explain what ChatGPT should take from each one.分享可能改变结果的信息。仅添加相关的来源,并说明 ChatGPT 应从每个来源中提取什么内容。
- Attach documents, spreadsheets, presentations, or PDF files when you want ChatGPT to summarize, compare, transform, or create files for review.当您希望 ChatGPT 进行总结、比较、转换或创建文件以供审阅时,请附加文档、电子表格、演示文稿或 PDF 文件。
- Add a screenshot, diagram, or other image input when the task depends on visual context. Point out the area that matters instead of relying on the image alone.当任务依赖于视觉背景时,请添加截图、图表或其他图像输入。指出关键区域,而不是仅仅依赖图像本身。
- Ask ChatGPT to use web search when the answer depends on current information, and ask for sources when you need to check the result.当答案取决于当前信息时,请要求 ChatGPT 使用网络搜索;当您需要核实结果时,请要求其提供来源。
- Use a project when related chats or tasks should share files, sources, or a local folder.当相关的对话或任务需要共享文件、来源或本地文件夹时,请使用项目功能。
Use connected sources使用已连接的来源
When ChatGPT has access to connected sources, name where it should look and what it should find. You don’t need to describe every search it should run.当 ChatGPT 有权访问已连接的来源时,请指明它应该在哪里查找以及应该找到什么。您无需描述它应运行的每一次搜索。
Use the latest project plan in Drive and relevant decisions and updates from
the project's Slack channel to prepare a status update.
Connected sources require the matching plugin, and availability can depend on your plan and workspace settings.已连接的来源需要匹配的插件,其可用性可能取决于您的方案和工作区设置。
Use plugins使用插件
Plugins give ChatGPT reusable instructions and connections to tools such as
Google Drive, Gmail, Slack, and GitHub. Ask for the result you need and let
ChatGPT choose from the tools available to it. To choose a specific plugin, type
@ in the composer.插件为 ChatGPT 提供可重复使用的指令以及与 Google Drive、Gmail、Slack 和 GitHub 等工具的连接。只需说明您需要的结果,让 ChatGPT 从可用工具中进行选择。要选择特定插件,请在输入框中输入 @。
Find, install, and use plugins in ChatGPT.在 ChatGPT 中查找、安装和使用插件。
Personalize ChatGPT个性化 ChatGPT
Put preferences that should apply across chats and tasks in Settings > Personalization as custom instructions. Keep details that matter only to the current task in the prompt.将适用于所有对话和任务的偏好设置放入“设置”>“个性化”中作为自定义指令。仅将与当前任务相关的细节保留在提示词中。
Set a default personality, custom instructions, and other app preferences.设置默认个性、自定义指令和其他应用偏好。
Set boundaries that prevent real problems设置边界以防止实际问题
Boundaries are the few instructions ChatGPT needs to avoid creating extra work or taking an action you didn’t intend. Add one when changing the wrong detail would make the result unusable, or when you want to review something before it affects other people.边界是 ChatGPT 需要遵循的少数指令,旨在避免产生额外工作或执行您未预期的操作。当更改错误的细节会导致结果无法使用,或者您希望在影响他人之前先进行审核时,请添加边界。
- Keep the approved dates and budget figures unchanged.保持批准的日期和预算数字不变。
- Use only the supplied sources. Flag missing information instead of guessing.仅使用提供的来源。如果信息缺失,请进行标记,不要随意猜测。
- Keep recommendations within the stated budget.将建议保持在规定预算内。
- Prepare the message as a draft. Don’t send it.将消息准备为草稿,不要直接发送。
Focus on the one or two boundaries that matter most. You don’t need to control every step ChatGPT takes.专注于最重要的一两个边界。您无需控制 ChatGPT 采取的每一步。
Make the result ready to use让结果随时可用
Tell ChatGPT how you plan to use the result. This helps it choose the right length, level of detail, and organization.告诉 ChatGPT 您计划如何使用该结果。这有助于它选择合适的长度、详细程度和组织方式。
- Make this a one-page summary a director can scan before the meeting. Put the decision and next steps first.将其制作成一份主管可以在会议前快速浏览的单页摘要。将决策和后续步骤放在最前面。
- Turn these notes into a follow-up email with the decisions, owners, and due dates.将这些笔记整理成一封后续邮件,包含决策、负责人和截止日期。
- Create a clear table of planned versus actual spending and highlight any difference over 10%.创建一个清晰的表格,对比计划支出与实际支出,并突出显示任何超过 10% 的差异。
For important work, ask ChatGPT for a final check, such as confirming every action item has an owner and due date or flagging information it couldn’t verify. Then review the result yourself before you use or share it.对于重要工作,请要求 ChatGPT 进行最终检查,例如确认每个行动项都有负责人和截止日期,或者标记它无法验证的信息。在您使用或分享之前,请务必亲自查看结果。
Improve the result with follow-up messages通过后续消息改进结果
Your first prompt doesn’t need to be perfect. Review the result, then ask for the specific change you want.您的第一个提示词不必完美。查看结果后,再要求进行您想要的具体更改。
Make the opening more direct, keep the evidence, and move the recommendation
above the background section.
You can add a missing source, correct the direction, ask for another option, or change the level of detail without starting over.您可以添加缺失的来源、纠正方向、要求其他选项或更改详细程度,而无需从头开始。
Steering and queuing引导和排队
When Codex is already working, you can send another message without waiting for the current run to finish:当 Codex 已经在工作时,您可以发送另一条消息,而无需等待当前运行结束:
- Steer adds the message to the current run. Use it to change direction, add a missing detail, or share new information.引导 (Steer):将消息添加到当前运行中。使用此功能更改方向、添加缺失的细节或分享新信息。
- Queue saves the message for the next run. Use it for a follow-up that should wait until the current work finishes.排队 (Queue):将消息保存到下一次运行。使用此功能处理需要等待当前工作完成后再执行的后续操作。
In the ChatGPT desktop app, choose the default under Settings > General > Follow-up behavior. Queued messages appear above the composer, where you can edit, reorder, send, or delete them. The setting also shows the shortcut for using the other behavior for one message without changing your default.在 ChatGPT 桌面应用中,在“设置”>“常规”>“后续行为”下选择默认设置。排队的消息会出现在输入框上方,您可以在此处进行编辑、重新排序、发送或删除它们。该设置还会显示在不更改默认设置的情况下,针对单条消息使用另一种行为的快捷方式。
In Codex CLI, press Enter while Codex is working to steer the current turn, or press Tab to queue the message for the next turn. See the interactive shortcuts for details.在 Codex CLI 中,当 Codex 正在工作时按 Enter 键可引导当前轮次,或按 Tab 键可将消息排队到下一轮次。有关详细信息,请参阅交互式快捷键。
Put the pieces together整合各项要素
For a project update that uses connected sources, a complete prompt might look like this:对于使用已连接来源的项目更新,完整的提示词可能如下所示:
Prepare a one-page project status update for Monday's leadership meeting. Use
the latest project plan in Drive and relevant decisions and updates from the
project's Slack channel.
Lead with the decisions leadership needs to make and the next steps. Summarize
progress, risks, owners, and due dates. Keep approved dates and budget figures
unchanged. Flag any conflicting or missing information, and don't send or
publish anything.
Before you finish, check that every next step has an owner and due date.
This prompt covers the Goal, Context, Output, and Boundaries, then asks for a final check without spelling out every step.此提示词涵盖了目标、背景、输出和边界,然后要求进行最终检查,而无需详细说明每一步。
Use voice dictation使用语音听写
In the ChatGPT desktop app, hold Ctrl+M while the composer is visible, then start talking. ChatGPT transcribes your speech into the composer so you can review and edit it before sending the prompt.在 ChatGPT 桌面应用中,在输入框可见时按住 Ctrl+M,然后开始说话。ChatGPT 会将您的语音转录到输入框中,以便您在发送提示词前进行查看和编辑。
Prompting examples for ChatChat 提示词示例
Use Chat for questions, ideas, drafts, and everyday decisions. Start with the outcome you want, then add detail only when it changes the answer.使用 Chat 进行提问、构思、起草和日常决策。从您想要的结果开始,仅在细节会改变答案时才添加补充信息。
Understand a topic理解主题
Explain how compound interest works for someone who has never invested.
Use one concrete example and define any financial terms you introduce.
Draft and refine writing起草和润色写作
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 options比较选项
Compare these two phone plans for one person who travels internationally twice
a year. Show the important differences in a table, then recommend one and explain
the tradeoff.
Make a practical plan制定实用计划
Plan five weekday dinners that take less than 30 minutes. Avoid peanuts, reuse
ingredients across meals, and finish with one consolidated shopping list.
Prompting for WorkWork 提示词
Use Chat for quick questions, short rewrites, brainstorming, and lightweight drafts. Use Work for tasks that draw on different sources or tools, involve a sequence of steps, make changes, or produce a larger deliverable.使用 Chat 进行快速提问、简短重写、头脑风暴和轻量级草稿。使用 Work 处理那些需要利用不同来源或工具、涉及一系列步骤、进行更改或产生较大交付成果的任务。
For Work tasks, describe the result you need, provide the source material, name the audience, and explain how you’ll review the work. Ask ChatGPT to plan, gather the needed information, create files, and check them before it finishes.对于 Work 任务,请描述您需要的结果、提供源材料、指明受众,并说明您将如何审阅工作。要求 ChatGPT 进行规划、收集所需信息、创建文件并在完成前进行检查。
Use Work efficiently高效使用 Work
Work is useful for time-consuming or recurring tasks, or for finished files you can reuse. A task that uses more credits can still be worthwhile if it saves time, improves quality, or helps you make an important decision.Work 对于耗时或重复性任务,或者您可以重复使用的成品文件非常有用。如果某项任务可以节省时间、提高质量或帮助您做出重要决策,那么即使它消耗更多额度也是值得的。
Start with one result you can review:从一个您可以审阅的结果开始:
- Include only relevant sources and limit the date range when appropriate.仅包含相关来源,并在适当的时候限制日期范围。
- Define the audience, output format, and desired length.定义受众、输出格式和期望长度。
- Separate required work from optional improvements or polish.将必要的工作与可选的改进或润色分开。
- Ask for a plan when the approach matters. Require your approval before ChatGPT sends, publishes, or changes information other people rely on.当方法很重要时,要求提供计划。在 ChatGPT 发送、发布或更改他人依赖的信息之前,要求其获得您的批准。
- Narrow or stop the task if it starts doing work you no longer need.如果任务开始执行您不再需要的工作,请缩小范围或停止任务。
Review the first result, refine the instructions, and reuse the workflow when it works.查看第一个结果,优化指令,并在工作流程顺畅时重复使用。
Turn source material into finished files将源材料转化为成品文件
Use the attached quarterly reports to create a leadership brief and a six-slide
presentation.
The audience is the executive team. Lead with the three decisions they need to
make, distinguish reported facts from your analysis, cite each number to its
source file, and check that the brief and slides agree before you finish.
Research a decision研究决策
Research three customer-support platforms for a 50-person company. Compare
pricing, security, integrations, and migration effort using current sources.
Deliver a recommendation memo with links, assumptions, and the questions we
should answer before signing a contract.
Coordinate a launch协调发布
Create a launch plan for the attached product brief. Include the timeline,
owners, dependencies, risks, announcement draft, customer FAQ, and a checklist
for launch day. Flag any missing decisions before producing the final files.
For recurring work, first refine the prompt in a normal task. After the output is reliable, schedule work from that task. Create a standalone scheduled task instead when each scheduled run should start a new task.对于重复性工作,请先在普通任务中优化提示词。在输出可靠后,安排该任务的定期运行。如果每次定时运行都应开启一个新任务,则创建一个独立的定时任务。
Prompting CodexCodex 提示词
Use Codex when you want ChatGPT to work with code, a codebase, or developer tools. A useful Codex prompt names the behavior you want, points to the relevant code or reproduction steps, preserves important constraints, and says how to verify the change.当您希望 ChatGPT 处理代码、代码库或开发者工具时,请使用 Codex。一个实用的 Codex 提示词会指明您想要的行为、指向相关的代码或复现步骤、保留重要的约束条件,并说明如何验证更改。
For a multi-step task, enter /plan in the app composer when you want Codex to
investigate and propose an approach before editing. When Goal mode
is available, use /goal after the plan to set a persistent goal. See the app slash
commands
for the current command list.对于多步骤任务,当您希望 Codex 在编辑前进行调查并提出方法时,请在应用输入框中输入 /plan。当目标模式 (Goal mode) 可用时,请在计划后使用 /goal 来设置持久目标。有关当前命令列表,请参阅应用斜杠命令。
How to read these examples如何阅读这些示例
Each workflow includes:每个工作流程包括:
- When to use it and which Codex surface fits best (IDE, CLI, or cloud).何时使用它以及哪种 Codex 界面最适合(IDE、CLI 或云端)。
- Steps with example user prompts.带有用户提示词示例的步骤。
- Context notes: what Codex automatically sees vs what you should attach.背景说明:Codex 自动看到的内容与您应该附加的内容。
- Verification: how to check the output.验证:如何检查输出。
Note: The IDE extension automatically includes your open files as context. In the CLI, mention paths explicitly, or attach files with
/mentionand@path autocomplete.注意:IDE 扩展会自动将您打开的文件作为背景。在 CLI 中,请明确提及路径,或使用 /mention 和 @ 路径自动补全来附加文件。
Codex runs local commands inside a sandbox that limits file and network access. If a task needs to cross that boundary, Codex follows your approval policy before continuing.Codex 在沙盒中运行本地命令,这限制了文件和网络访问。如果任务需要跨越该边界,Codex 会在继续之前遵循您的批准策略。
Explain a codebase解释代码库
Use this when you are onboarding, inheriting a service, or trying to reason about a protocol, data model, or request flow.当您入职、接手服务或试图推导协议、数据模型或请求流程时,请使用此功能。
IDE extension workflow (fastest for local exploration)IDE 扩展工作流程(本地探索最快)
-
Open the most relevant files.打开最相关的文件。
-
Select the code you care about (optional but recommended).选择您关心的代码(可选,但推荐)。
-
Prompt Codex:提示 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
Verification:验证:
- Ask for a diagram or checklist you can verify:要求提供您可以验证的图表或清单:
Summarize the request flow as a numbered list of steps. Then list the files involved.
CLI workflow (good when you want a transcript + shell commands)CLI 工作流程(当您需要记录 + shell 命令时很有用)
-
Start an interactive session:启动交互式会话:
codex -
Attach the files (optional) and prompt:附加文件(可选)并提示:
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.
Context notes:背景说明:
- You can use
@in the composer to insert file paths from the workspace, or/mentionto attach a specific file.您可以在输入框中使用 @ 插入工作区中的文件路径,或使用 /mention 附加特定文件。
Fix a bug修复 Bug
Use this when you have a failing behavior you can reproduce locally.当您有可以在本地复现的故障行为时,请使用此功能。
CLI workflow (tight loop with reproduction and verification)CLI 工作流程(包含复现和验证的紧密循环)
-
Start Codex at the repo root:在仓库根目录启动 Codex:
codex -
Give Codex a reproduction recipe, plus the file(s) you suspect:为 Codex 提供复现配方,以及您怀疑的文件:
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.
Context notes:
- Supplied by you: the repro steps and constraints (these matter more than a high-level description).由您提供:复现步骤和约束条件(这些比高层描述更重要)。
- Supplied by Codex: command output, discovered call sites, and any stack traces it triggers.由 Codex 提供:命令输出、发现的调用点以及它触发的任何堆栈跟踪。
Verification:
- Codex should re-run the repro steps after the fix.Codex 应在修复后重新运行复现步骤。
- If you have a standard check pipeline, ask it to run it:如果您有标准的检查流水线,请要求它运行:
After the fix, run lint + the smallest relevant test suite. Report the commands and results.
IDE extension workflowIDE 扩展工作流程
-
Open the file where you think the bug lives, plus its nearest caller.打开您认为 Bug 所在的文件,以及它最近的调用者。
-
Prompt Codex:
Find the bug causing "Saved" to show without persisting changes. After proposing the fix, tell me how to verify it in the UI.
Write a test编写测试
Use this when you want to define the exact scope to test.当您想定义测试的确切范围时,请使用此功能。
IDE extension workflow (selection-based)IDE 扩展工作流程(基于选择)
-
Open the file with the function.打开包含函数的代码文件。
-
Select the lines that define the function. Choose “Add to Codex Thread” from command palette to add these lines to the context.选择定义函数的行。从命令面板中选择“Add to Codex Thread”将这些行添加到上下文中。
-
Prompt Codex:
Write a unit test for this function. Follow conventions used in other tests.
Context notes:
- Supplied by “Add to Codex Thread” command: the selected lines (this is the “line number” scope), plus open files.由“Add to Codex Thread”命令提供:所选行(这是“行号”范围),以及打开的文件。
CLI workflow (path + line range described in prompt)CLI 工作流程(提示词中描述路径 + 行范围)
-
Start Codex:启动 Codex:
codex -
Prompt with a function name:用函数名进行提示:
Add a test for the invert_list function in @transform.ts. Cover the happy path plus edge cases.
Prototype from a screenshot根据截图进行原型设计
Use this when you want to turn a design mock, screenshot, or UI reference into a working prototype.当您想将设计稿、截图或 UI 参考转化为工作原型时,请使用此功能。
CLI workflow (image + prompt)CLI 工作流程(图像 + 提示词)
-
Save your screenshot locally (for example
./specs/ui.png).在本地保存您的截图(例如 ./specs/ui.png)。 -
Run Codex:运行 Codex:
codex -
Drag the image file into the terminal to attach it to the prompt.将图像文件拖入终端以将其附加到提示词中。
-
Follow up with constraints and structure:后续跟进约束条件和结构:
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
Context notes:
- The image provides visual requirements, but you still need to specify the implementation constraints (framework, routing, component style).图像提供了视觉需求,但您仍需指定实现约束(框架、路由、组件样式)。
- Include behavior the image doesn’t show in text, such as hover states, validation rules, or keyboard interactions.在文本中包含图像未显示的交互行为,例如悬停状态、验证规则或键盘交互。
Verification:
- Ask Codex to run the dev server (if allowed) and tell you exactly where to look:要求 Codex 运行开发服务器(如果允许)并告诉您确切查看位置:
Start the dev server and tell me the local URL/route to view the prototype.
IDE extension workflow (image + existing files)IDE 扩展工作流程(图像 + 现有文件)
-
Attach the image in the Codex task (drag-and-drop or paste).在 Codex 任务中附加图像(拖放或粘贴)。
-
Prompt 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.
Iterate on UI with live updates通过实时更新迭代 UI
Use this when you want a tight “design → tweak → refresh → tweak” loop while Codex edits code.当您希望在 Codex 编辑代码时拥有紧密的“设计 → 调整 → 刷新 → 调整”循环时,请使用此功能。
CLI workflow (run Vite, then iterate with small prompts)CLI 工作流程(运行 Vite,然后用简短提示词进行迭代)
-
Start Codex:
codex -
Start the dev server in a separate terminal window:在单独的终端窗口中启动开发服务器:
npm run dev -
Prompt Codex to make changes:提示 Codex 进行更改:
Propose 2-3 styling improvements for the landing page. -
Pick a direction and iterate with small, specific prompts:选择一个方向并使用简短、具体的提示词进行迭代:
Go with option 2. Change only the header: - make the typography more editorial - increase whitespace - ensure it still looks good on mobile -
Repeat with focused requests:通过重点请求进行重复:
Next iteration: reduce visual noise. Keep the layout, but simplify colors and remove any redundant borders.
Verification:
- Review changes in the browser as Codex updates the code.随着 Codex 更新代码,在浏览器中查看更改。
- Commit changes that you like and revert those that you don’t.提交您喜欢的更改,并还原您不喜欢的更改。
- If you revert or change an edit, tell Codex so it doesn’t overwrite your edit when it works on the next prompt.如果您还原或更改了编辑内容,请告知 Codex,以免它在处理下一个提示词时覆盖您的修改。
Delegate refactor to the cloud将重构委托给云端
Use this when you want to design an approach with local context, then delegate the long implementation to a cloud task that can run in parallel.当您想通过本地上下文设计方法,然后将漫长的实现过程委托给可以并行运行的云端任务时,请使用此功能。
Local planning (IDE)本地规划 (IDE)
-
Make sure your current work is committed or at least stashed so you can compare changes cleanly.确保您当前的工作已提交或至少已暂存,以便您可以干净地比较更改。
-
Ask Codex to produce a refactor plan. If you have the
$planskill available, invoke it explicitly:要求 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 -
Review the plan and negotiate changes:审查计划并协商更改:
Revise the plan to: - specify exactly which files move in each milestone - include a rollback strategy
Context notes:
- Planning works best when Codex can scan the current code locally (entrypoints, module boundaries, dependency graph hints).当 Codex 可以在本地扫描当前代码(入口点、模块边界、依赖图提示)时,规划效果最好。
Cloud delegation (IDE → Cloud)云端委托 (IDE → Cloud)
-
If you haven’t already done so, set up a Codex cloud environment.如果您尚未设置,请配置 Codex 云环境。
-
Click on the cloud icon beneath the prompt composer and select your cloud environment.点击提示词输入框下方的云图标,选择您的云环境。
-
When you enter the next prompt, Codex creates a new task in the cloud that carries over the existing task context (including the plan and any local source changes).当您输入下一个提示词时,Codex 会在云端创建一个新任务,该任务会继承现有的任务上下文(包括计划和任何本地源代码更改)。
Implement Milestone 1 from the plan. -
Review the cloud diff, iterate if needed.查看云端差异,如有需要进行迭代。
-
Create a PR directly from the cloud or pull changes locally to test and finish up.直接从云端创建 PR,或将更改拉取到本地进行测试和收尾。
-
Iterate on additional milestones of the plan.针对计划的额外里程碑进行迭代。
Tasks delegated to the cloud run in isolated environments. Internet access is off during the agent phase unless you enable it for the environment. Learn more about cloud internet access.委托给云端的任务在隔离环境中运行。除非您为该环境启用了互联网访问,否则在代理阶段互联网访问是关闭的。了解更多关于云端互联网访问的信息。
Do a local code review进行本地代码审查
Use this when you want a second set of eyes before committing or creating a PR.当您在提交或创建 PR 之前需要第二双眼睛时,请使用此功能。
CLI workflow (review your working tree)CLI 工作流程(审查您的工作树)
-
Start Codex:
codex -
Run the review command:运行审查命令:
/review -
Optional: provide custom focus instructions:可选:提供自定义重点指令:
/review Focus on edge cases and security issues
Verification:
- Apply fixes based on review feedback, then rerun
/reviewto confirm you resolved the issues.根据审查反馈应用修复,然后重新运行 /review 以确认您已解决问题。
Review a GitHub pull request审查 GitHub Pull Request
Use this when you want review feedback without pulling the branch locally.当您想要审查反馈而无需在本地拉取分支时,请使用此功能。
Before you can use this, enable Codex Code review on your repository. See Code review.在使用此功能之前,请在您的仓库中启用 Codex 代码审查。请参阅代码审查。
GitHub workflow (comment-driven)GitHub 工作流程(评论驱动)
-
Open the pull request on GitHub.在 GitHub 上打开 Pull Request。
-
Leave a comment that tags Codex with explicit focus areas:留下评论并标记 Codex,注明明确的重点领域:
@codex review -
Optional: Provide more explicit instructions.可选:提供更明确的指令。
@codex review for security vulnerabilities and security concerns
Update documentation更新文档
Use this when you need an accurate, clear documentation change.当您需要准确、清晰的文档更改时,请使用此功能。
IDE or CLI workflow (local edits + local validation)IDE 或 CLI 工作流程(本地编辑 + 本地验证)
-
Identify the doc file(s) to change and open them (IDE) or
@mention them (IDE or CLI).确定要更改的文档文件并打开它们(IDE)或 @ 提及它们(IDE 或 CLI)。 -
Prompt Codex with scope and validation requirements:提示 Codex 明确范围和验证要求:
Update the "advanced features" documentation to provide authentication troubleshooting guidance. Verify that all links are valid. -
After Codex drafts the changes, review the documentation and iterate as needed.在 Codex 起草更改后,查看文档并根据需要进行迭代。
Verification:
- Read the rendered page.阅读渲染后的页面。