Deep Dive · XiaoHu Explains

OpenAI's Official Guide: 9 Copy-Ready Codex Prompt Workflows for Fixing Bugs, Turning Screenshots into Prototypes, and Cloud Refactors

OpenAI rolled the prompting tips scattered across its product pages into one framework: goal, context, output, boundaries — plus workflow examples built specifically for Codex.
Quick take
  • ChatGPT's official prompting guide covers three surfaces: Chat, Work, and Codex.
  • The core is a four-element framework: goal, context, output, boundaries. Use what you need — you don't have to fill in every element.
  • For Codex, it gives 9 concrete workflows: understanding a codebase, fixing bugs, writing tests, turning a screenshot into a prototype, iterating on UI with live preview, delegating refactors to the cloud, two paths for code review, and updating docs — each with a copy-paste-ready prompt.
  • While Codex is running, you can send follow-up messages: steer to redirect the current task mid-run, or queue to save it for the next turn.
  • A refactor plan you worked out locally in your IDE can carry its full context straight over to a cloud environment to keep executing.
This is an official OpenAI document (learn.chatgpt.com) on prompting methodology. The methods and examples below all come from OpenAI's official material, and every prompt example is preserved exactly as written for you to copy directly.
1Framework

No template to memorize: four elements, fill in only what matters

OpenAI's team published an official prompting guide at learn.chatgpt.com laying out exactly how to write prompts across three surfaces: Chat, Work, and Codex.

Its core is a four-element framework: goal, context, output, boundaries. You don't need to memorize a fixed syntax, and you don't need to fill in every element — just write the ones that will actually change the result.
🎯

One set of principles unifies how you write for Chat, Work, and Codex, and pairs it with 9 command-level, copy-ready workflows for Codex. A short task just needs a sentence; only big tasks need the full set of elements.

4
Optional framework elements: goal / context / output / boundaries
3
Surfaces covered: Chat / Work / Codex
9
Concrete Codex workflow examples given
Goal GOAL what to achieve Context CONTEXT what info to give it Output OUTPUT format / length / detail Boundaries BOUNDARIES what not to touch Assembles into one complete, ready-to-use prompt Use as needed · a short task is one sentence · big tasks need the full set
Four blocks assembled as needed: goal is mandatory; context, output, and boundaries get filled in only when they'd change the result

Say what result you want first — don't jump to listing steps

Start from the result you want, spell out the audience and format, and leave the rest — how to search, compare, and adjust — to ChatGPT. Only describe the process itself when the process actually matters.

Goal example · one sentence for what and for whom
Turn these meeting notes into a short update for the project team.
Put the decisions and next steps first.

Say what the result is for, and it'll pick the right length and detail on its own

The trick with the "output" element: tell ChatGPT how you plan to use the result, and it can choose the right length, level of detail, and structure on its own. For anything that matters, you can also ask for a final check at the end — say, confirming every action item has an owner and a deadline, or flagging anything it couldn't verify — and then review it yourself.

Output example · three ways to spell out "what it's for"
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%.

Last is the element in the four that's easiest to forget: boundaries.

Boundaries · the one most often skipped

Boundaries are the instructions that stop ChatGPT from making things worse or acting on its own. The rule of thumb is simple: add one whenever "getting a single detail wrong would make the result unusable," or when "an action affects someone else and you want to review it first." Nail down the one or two that matter most — you don't need to lock down every step.

Boundaries example · four phrases that save you the most often
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.
2Context

Feeding it the right context: files, screenshots, web search, connected apps

"Context" is any information that would change the result. The rule is: give it only relevant sources, and say clearly what to pull from each one. Here are the main ways to feed it context:

MethodWhen to use it
Upload docs / spreadsheets / slides / PDFsWhen you want it to summarize, compare, rewrite, or produce a file you can review
Screenshots / diagrams / imagesWhen the task depends on visual information. Add a sentence pointing to the specific part of the image — don't just drop an image with nothing else
Web searchWhen the answer depends on current information. If you need to verify results, also ask it to cite its sources
Connected data sources (Drive / Slack, etc.)Name where to look and what to find — no need to describe every single lookup
Connected data source example · name where to look and what to pull
Use the latest project plan in Drive and relevant decisions and updates from
the project's Slack channel to prepare a status update.