A good prompt is half words, half context. What a prompt actually is, what makes one good, and a structure you can copy for bigger tasks.
By the end of this page, you should be able to write a prompt that gets you the result you actually wanted, often on the first or second try, and understand what separates a good prompt from a bad one.
Prompting is not just the text you give the AI. It is also the context you give it: the files you attach, the examples you show it, the instructions for how you want the work done, and the data and apps it can reach. The words matter, but they are only half of it.
To write this guide, we analyzed about 2,800 of my real prompts to Codex and Claude from the past ten months. Everything in here is a mix of how I actually prompt every day and the best practices from the leading AI companies.
A prompt is how you point the AI at what you want: your request, plus any instructions for how to get there. OpenAI's official guide keeps the definition loose: a prompt "can be a question, an instruction, or a goal." There is no one-size-fits-all formula.
A prompt can be seen as three components that shape what you get back:
That is why two people can type the same words and get completely different results. One asked the AI to "review my budget" with nothing attached. The other attached the spreadsheet, or just said where to find it. Same words, completely different prompt.
The three big AI companies each published a prompting guide (OpenAI, Anthropic, Google), and what they agree on at the core is what a good prompt is made of:
Not everything needs a long, carefully built prompt though. It depends on the ask. Asking your AI to check your email inbox for unread emails can be a one-liner, but bigger, more important tasks should use the components above.
Anthropic's guide recommends treating your AI like a brilliant but new employee. It is smart, but it is new, so it does not know your norms, your clients, or how you like things done unless you say so.
Before you send your prompt, ask yourself: would a colleague reading this with no other context know what to do? If not, the AI will not either.
Also, skip the tricks. Researchers at Wharton tested them: "act as an expert" personas did not improve factual accuracy, and politeness, tips, and threats washed out to noise.
Here is the difference in practice, with a task someone at a nonprofit might face. The vague version:
"Write a thank-you email to the sponsor."
The AI has to guess which sponsor, what they did, what you want next, and how your organization sounds. You get something generic, then spend three messages fixing it.
The strong version:
"Write a thank-you email to the company that sponsored our fundraiser dinner last night. My notes from the event are attached. Thank them for the $5,000 sponsorship, mention that we hosted about 200 guests, and invite their team to visit one of our programs this fall. Keep it under 150 words, warm but professional. Don't ask about next year's sponsorship yet."
Same task. What changed:
To make this easier, here is a helpful structure. When we analyzed our real prompts, this same skeleton kept showing up in our bigger asks, and it lines up with the parts OpenAI, Anthropic, and Google teach. Below is not a checklist, just the shape of a good prompt (skip any line that does not apply).
When you are giving the AI a longer or more complicated task, copy it and fill in the parts. It takes 30 seconds and should save you from having to correct the AI three times later.
What I want: [the task and the outcome, in one or two sentences] What you need to see: [attach the files, paste the notes, or name the source the AI should use] What done looks like: [format, length, audience, and anything that must be included] What to avoid: [anything off-limits, plus mistakes you have seen AI make on this before] Before you act: [for big or risky tasks: "show me a plan first and wait for my go-ahead"]
Want to take this to the next level? Notice when you keep repeating yourself: the same background, the same preferences, the same setup before every ask. That is the signal to turn a prompt into something reusable. Every major AI tool gives you layers for this:
My rule: the third time I type the same preference, it moves up a layer. A phrasing I keep reusing becomes a custom instruction. A client's background becomes a project. The prompt gets shorter because the context is already loaded.
You can even make the AI do this housekeeping: ask it to look back at your recent chats, spot what you keep repeating, and suggest what should become a saved instruction.
Chat tools answer you once. But AI agents, like Codex and Claude in their agent modes, can open files, use tools, and keep working for minutes or even hours. That is where context becomes a necessity: the agent needs the right information to make the right decisions. Three techniques show up over and over in my real prompts:
/plan command and Claude's agents have a plan mode, or you can simply say it in the prompt.OpenAI's guide has a line worth framing: "Your first prompt doesn't need to be perfect." When the output misses, do not start over and re-explain everything. Name the specific thing that is wrong and trust the AI to keep the rest: "The tone is right, but cut the second paragraph, it repeats the first."
And know when to fold. If two or three corrections have not fixed a problem, more arguing rarely does. I start a fresh chat with a better brief, or ask the AI to summarize the task so I can hand it to a new session. A clean start with a sharper prompt beats round eight of a fight.