An effective prompt has three elements: a task, the context the model needs to do it, and the format the answer should take. Everything else people add to prompts, roles, examples, rules, tone, is a refinement of one of those three. If a prompt is failing, one of the three is missing or vague, and you can usually tell which from how it fails.
This is the answer to a question that appears in courses and exams on AI tools, and the exam answer is the same as the working one. The rest of this post is what each element does in practice.
Element 1: the task
The task is what you want done, stated as a result. "Write a product description" is a task. "Help me with my product" is a topic. The difference is that a task has a finished state the model can aim at.
A task is weak when it uses a verb the model can satisfy in many ways. "Improve this" could mean shorten, clarify, correct or rewrite. "Shorten this to 100 words without removing any number" is one thing. A task is also weak when it hides two tasks: "summarise this and suggest next steps" produces a summary that drifts into advice. Split them, or state the order and the length of each.
When the task is missing or vague, the output is on topic and useless. You read it and think "yes, but that is not what I needed." That is the signal to rewrite the task as a result.
Element 2: the context
Context is what the model needs to know that it cannot guess: who the output is for, what it is about, the facts, the material to work from, the constraints. A model without context fills the gaps with averages, and the average of everything is the generic text people complain about.
Context comes in two kinds. The first is background: the audience, the purpose, the situation. "For first-time home buyers in Texas who are comparing two lenders" changes every sentence of the answer. The second is material: the document to summarise, the data to analyse, the draft to edit. Material goes in its own block, after the task, labelled, so the model knows it is working on the material rather than discussing it.
When context is missing, the output is correct in general and wrong for you. It describes a product like yours rather than your product. When material is missing, the model invents it: numbers that look plausible, quotes nobody said. That is the signal to paste the source.
Format is the shape of the answer: length, structure, order, what to include and what to leave out. A format can be a sentence, "five bullets, each under 15 words," or a template with the headings and placeholders. Templates work better for anything with more than two parts, because the model fills a template exactly and interprets a description loosely.
Format goes last in the prompt. Models weight the final instruction most, and the format is the instruction you most want followed to the letter. It also includes the negatives: "no introduction," "no summary at the end," "do not restate the question." Each one removes a habit you would otherwise edit out every time.
When format is missing, the output is right and unusable: a wall of prose when you needed a table, four paragraphs when you had room for one line, headings you have to strip before pasting. That is the signal to add the template.
The three elements in one template
Task: [one sentence, stated as the result you want].
Context: [who it is for, what it is about, the constraints]. Material: [paste the document, data or draft here, or write 'none'].
Format: [length, structure, order, what to leave out]. If anything needed is missing from the context, say what it is before answering.
The last line is a fourth element in practice, a rule for what to do with gaps. It is not one of the three because it only matters once the three are there, but it prevents the most expensive failure, the confident answer to a question you did not ask.
Two worked examples
Weak: "Write an email to my team about the new process."
The task is a topic, the context is two words, the format is absent. The output will be a generic announcement with a cheerful opening and three vague paragraphs.
Effective: "Task: write an email announcing that expense reports move to a new tool on 1 November. Context: for a team of 12 sales reps who submit reports monthly and have not seen the tool; the old tool stops accepting reports on 31 October; training is a 20-minute video linked here [link]. Format: subject line under 50 characters; three short paragraphs: what changes, when, what they need to do; one sentence on where to ask questions. No exclamation marks, no 'exciting'."
Same model, same effort, a result you send with one edit.
Weak: "Analyse this data." Effective: "Task: find the three products whose sales fell most between Q2 and Q3. Context: the table below has one row per product per quarter, columns product, quarter, units, revenue; the business wants to know where to focus the Q4 promotion. Material: [table]. Format: a three-row table with product, Q2 revenue, Q3 revenue, change in percent, then one sentence per product on the most likely reason visible in the data, then what you cannot tell from this table."
Where roles, examples and tone fit
A role ("you are an experienced contracts lawyer") is context: it tells the model whose knowledge and standards to use. An example is format: it shows the shape and the tone of the answer more precisely than a description. A tone instruction is format too. Rules like "never invent a citation" are context about the standards that apply. Nothing in a good prompt sits outside the three elements; the elements are the checklist, and the techniques are ways of filling them.
Every prompt in the prompt library follows this order, task, context, format, so you can see the three elements in working examples and edit a tested prompt instead of writing from a blank page. For a longer treatment of structure, the guide to prompt structures builds on the same three parts, and the prompt generator produces a prompt in this shape from a plain description.