Prompting and practice · Read 7 min

How to write a good prompt: the structure that almost always works

The difference between a mediocre answer and a useful one is not the model. It is how you asked. Here is the recipe.

You type "write me an email to my boss" and get back something generic, lukewarm, with too many exclamation marks. You delete it. You type again, this time with details: who you are, what happened, the tone you want, how many lines. And this time it lands. The answer is usable. You did not switch models between one attempt and the next. You changed the prompt.

Almost everyone blames the AI when the answer falls flat. And sometimes they are right. But far more often the problem is that we ask the way someone shouts an order from another room: fast, incomplete, expecting the other person to guess the rest. The model does not guess. It fills gaps with whatever is most likely, which tends to be the blandest option.

01 · the problemWhy a vague prompt gives a vague answer

A language model does not know you, did not see what you saw, and has no idea what you need the answer for. All it has are the words you typed. If those words are few and ambiguous, the model has to assume nearly everything: who is speaking, to whom, with what intent, in what format. And when it assumes, it takes the most worn out path.

Think of "how to write a good prompt" as giving instructions to someone very capable but brand new, who does not share your context. To a colleague of many years you say "the usual report" and it comes out right. To someone on their first day you have to say which report, for whom, with what data, and in what format. The model is always the person on their first day.

The model does not read your mind. It reads your words. Everything you leave out, it invents.

That is why the fix is not "writing more elegantly" but writing more completely. And so you do not have to rely on inspiration, it helps to have a fixed structure you can fill in the same way every time.

02 · the recipeRole, context, task, format, and example

There is a template that shows up, under different names, in almost every serious prompting guide. The community sometimes shortens it to "RTF" or "CRAFT"; what matters is not the acronym but the five pieces. I list them in the order you should write them.

Figura 1 · las cinco piezas de un prompt completo
Role · who the model should be Context · what it should know first Task · what it has to do, exactly Format · how you want the output Example · a sample of what you expect
You do not need all five every time. But whenever an answer comes out wrong, one of these pieces was almost certainly missing. Source of the diagram: OpenAI's prompting strategies guide [1].

Role. Tell the model which role it should answer from. "Act as a demanding style editor" produces a very different text from "act as a friend cheering me on". The role sets the tone, the vocabulary, and even what counts as relevant.

Context. This is the piece most people forget and the one that changes the result the most. Here goes what the model cannot know: who you are, who you are addressing, what happened before, what constraints you have. "I am writing to a busy boss who already knows the project" keeps it from handing you three paragraphs of introduction no one will read.

Task. The concrete verb. Not "help me with the email" but "write an email that requests a two day extension and proposes a new date". A clear verb and a measurable goal cut ambiguity down to almost zero.

Format. How you want the output: length, structure, tone. "In no more than 5 lines, no long greetings, cordial but direct tone." If you do not ask, the model chooses for you, and it usually chooses too much.

Example. Optional but powerful. Showing a sample of what you expect (an email you actually liked, a table in the right format) guides the model better than many sentences of instruction. Teaching by example is known as few-shot prompting, and the researchers behind these models themselves showed that a few samples are enough to change the answer a lot [2].

In 2020, the team led by Tom Brown showed with GPT-3 that a large model could solve new tasks just by seeing a few examples inside the prompt itself, without retraining it [2]. That finding is why something as simple as pasting "here are three emails I liked, write a similar one" works today.

Pocket trick for when you are in a hurry

If you are not going to write all five pieces, write at least two: context and format. They are the ones most people skip and the ones that fix the answer the most. Role and example add value; context and format prevent disasters.

03 · before and afterThe same request, two results

Theory lands better with a case. Suppose you need to explain a delay to a client. Compare how you ask.

Figura 2 · prompt pobre vs. prompt con estructura
Table 1 · How the request changes when you add role, context, task, and format. Illustrative example by the author.
PiecePoor promptStructured prompt
RoleunspecifiedAct as an account manager.
ContextunspecifiedThe client's order arrives 3 days late because of a supplier problem; it is a long standing client.
Task"write an apology email"Write an email that reports the delay, explains the cause without long excuses, and offers compensation.
FormatunspecifiedNo more than 6 lines, professional and warm tone, with a concrete action at the end.
The right column is not "longer for the sake of it": each line removes an assumption from the model. Fewer assumptions, a more useful answer.

The poor prompt will give you a correct but generic email, the kind that fits any delay at any company. The structured one will give you one that sounds like your situation, at a length you can send without editing. Same model, same day. The only difference was how much you told it.

04 · the habitTurn the recipe into something repeatable

The value of a fixed structure is that it stops depending on your memory. You can save a template in a note and fill it in: "You are [role]. Context: [situation]. Task: [verb + goal]. Format: [length and tone]. Example: [optional sample]." With that, writing a good prompt for ChatGPT stops being a matter of luck and becomes a step by step you repeat the same way every time.

And there is a second habit, simpler still: if the first answer misses the mark, do not start from scratch. Tell it what to fix. "Shorter." "Less formal." "Drop the greeting." The model keeps the thread and adjusts. A three message conversation usually beats a single perfect prompt you tried to guess all at once.

A good prompt rarely lands on the first try. It comes from a good mold and two corrections.

I do not promise the structure solves everything: there are tasks where the model simply does not know, and no recipe fixes that. But for 90 % of everyday work (emails, summaries, ideas, drafts) the difference between frustration and usefulness is almost never in the model. It is in whether you gave it role, context, task, format, and, when it helps, an example. That is the part you actually control.

Sources

  1. OpenAI. Prompt engineering: Strategies and tactics for getting better results. OpenAI Platform Documentation. Recommends giving clear instructions, context, a role, and examples to improve answers. platform.openai.com/docs/guides/prompt-engineering.
  2. Brown, T. et al. (2020). Language Models are Few-Shot Learners. Advances in Neural Information Processing Systems (NeurIPS) 33. arXiv:2005.14165. (Introduces learning from a few examples inside the prompt.)
  3. OpenAI Help Center. Best practices for prompt engineering with the OpenAI API. Practical guide on specificity, output format, and the use of examples. help.openai.com/en/articles/6654000.

Learn more about AI

See all Learn AI