Your first useful prompt
Walk through structuring a prompt that gets consistent, production-quality output.
A useful prompt has four parts. Most failed prompts are missing at least two of them. Here's the structure and how to debug it.
The four-part structure
Every production-quality prompt has:
- Role / frame. Who the model is answering as, and what kind of output is expected.
- Context. The specific facts, examples, or documents the model needs to do the job.
- Task. The concrete thing to do, in one or two sentences.
- Format. The shape of the output — JSON schema, bullet list, specific sections.
Missing any one of these is where prompts go sideways.
A concrete example
Bad:
Summarize this article.
Useful:
You are an editor writing the lede paragraph for a tech newsletter read by
senior engineers. The readers skim. Lede paragraphs should be 2-3 sentences
that make a skeptical engineer want to read more.
Here is the article: <article>…</article>
Write one lede paragraph. Do not explain your reasoning. Do not say "This
article is about…". Start with a concrete claim or surprising fact.
The second prompt has frame (editor, skeptical engineers), context (the article), task (one lede paragraph), and format (2-3 sentences, start with a claim, no preamble). You'd get usable output.
Why prompts fail
When a prompt produces a mediocre answer, the diagnostic sequence is almost always:
- Is the task crisp? Or did you give the model three things to do at once?
- Is the context actually in the prompt? Or are you expecting it to "know" things about your domain?
- Is the format specified? Vague format = lowest-common-denominator output.
- Is the role coherent? Asking "an AI expert" for a plumbing tip gets you worse results than asking "a licensed plumber."
The prompt you'll use forever
Keep a personal template. Most engineers eventually settle on something like:
<role>You are…</role>
<context>…</context>
<task>…</task>
<format>…</format>
<examples>…</examples> ← optional, see the few-shot lesson
The tags don't have to be XML. Headers work. Markdown works. The model doesn't care about the format of your structure. It cares that there is a structure.
Check your understanding
2-question self-check
Optional. Your answers feed your knowledge score on the track certificate.
Q1.Which four parts does the lesson say every production-quality prompt has?
Q2.A prompt gives a mediocre answer. What is NOT a good debugging step the lesson recommends?
Continue in this track
More lessons from AI Fundamentals.
Lesson 2
How models are trained (and why it matters to you)
Pre-training, instruction tuning, alignment — and what each one means for your choices.
Lesson 3
Tokens, context windows, and why your prompts get cut off
The mechanics of context — and how to reason about fit, cost, and truncation.
Lesson 5
Temperature, top-p, and the knobs nobody explains
The sampling parameters that shape creativity, determinism, and diversity.