Chapter 1 · Prompt Foundations
The Anatomy of a Good Prompt: Task, Context, Input and Output Format
- Page 3 of 24
- 19 min read
When a colleague gives you a task, you ask yourself a few quick questions. Who is this for? What do you want me to do? What do I need to know? How should I hand it back? An AI model cannot ask those questions unless you invite it to, so it fills every gap with a guess. Sometimes the guess is good. Often it is generic, too long, in the wrong format, or built on facts it made up.
A good prompt answers those questions before the model has to guess. This page gives you ten building blocks, shows what each one does, and then grows one tiny request into a complete prompt, one block at a time. You will use this structure on almost every later page, from emails to spreadsheets. In What a Prompt Really Is: Goal, Audience, Context and Deliverable you met the four basic ideas; in Clarify, Iterate, Improve: From a Vague Request to a Specific Prompt you improved a vague request by trial and error. Here you learn the parts you can add on purpose.
What you will learn
- The ten parts of a prompt: role, task verb, context, audience, constraints, output format, success criteria, and three layout tools (headings, bullets, numbered steps).
- What each part is for, what goes wrong when it is missing, and when you can leave it out.
- How to build a complete prompt step by step from a one-line request, and how to check the reply.
- What a role (persona) really does: it changes tone and viewpoint, and it is not an accuracy booster.
The anatomy at a glance
You do not need all ten parts every time. A quick question to a chat assistant may need only a task and a little context. A prompt that a whole team will reuse should usually have most of them. Think of the table as a menu of questions you can answer in advance.
| Part | The question it answers | Example | If it is missing |
|---|---|---|---|
| Role | From what viewpoint, and in what voice? | "You are a customer-service writer." | The voice is generic or inconsistent. |
| Task (action verb) | What exactly should be done? | "Write", "Compare", "Classify", "List" | The model guesses the job: it may explain when you wanted a draft. |
| Context | What facts and situation should it use? | "Delivery moved from 2026-10-30 to 2026-11-04." | It invents details or stays vague. |
| Audience | Who will read the result? | "New customers, many reading on a phone." | Wrong level, wrong tone, wrong length. |
| Constraints | What limits and boundaries apply? | "At most 120 words. Use only these facts." | Too long, off-topic, or extra promises. |
| Output format | What shape should the answer have? | "Subject line, then body, then sign-off." | You must reformat by hand. |
| Success criteria | How will we know it is good enough? | "The reader knows the new date after one reading." | You cannot tell a good reply from a plausible one. |
| Headings | How do I label the parts of a long prompt? | "## Context", "## Constraints" | A long prompt becomes one block that is hard to read and edit. |
| Bullets | Which requirements are independent? | "- Plain text only" | Requirements hide inside long sentences and get missed. |
| Numbered steps | Which actions must happen in order? | "1. Read. 2. Group. 3. Summarise." | Steps are skipped or done in a different order. |
The sections below take the parts in groups. Keep the table nearby; it is the reusable part of this page.
The content parts: role, task, context, audience
Define the role or perspective
A role is one sentence that tells the model whose viewpoint to write from: "You are a customer-service writer for a small online shop." It shapes tone, vocabulary and viewpoint. A message written as a careful support agent sounds different from the same message written as a marketing copywriter, even if the facts are identical.
A correction to a popular belief. Many guides say that "You are a world-class expert" makes answers more correct. Studies that tested this on factual questions did not find a reliable accuracy gain from personas; the effects were small and inconsistent, and those studies used models of an earlier generation. Use a role to control voice and perspective. Do not rely on it to make facts truer, and never invent credentials ("You are a licensed doctor"): the reply is still not professional advice. Check facts the same way whether or not you gave a role.
AI providers do recommend a short role statement, because it focuses tone and scope. So: include one when voice matters, keep it to a sentence, and treat it as style, not as proof of quality.
Describe the task with an action verb
The task is the heart of the prompt, and its verb carries most of the meaning. "Write about the delay" is not a task: the model could explain, apologise, analyse or advertise. Pick a verb that names the action and the thing produced.
| Vague wording | Clear action verb |
|---|---|
| "Help with this report" | "Summarise this report in five bullet points" |
| "Something about these reviews" | "Classify each review as positive, negative or mixed" |
| "Look at my two offers" | "Compare the two offers on price, delivery time and risk" |
| "My email is bad" | "Rewrite this email so it is shorter and more polite" |
Good verbs for everyday work: write, rewrite, summarise, list, classify, compare, extract, translate, explain, draft, check. One prompt can have more than one task, but then number them (see below) so none is forgotten.
Supply background context
Context is everything the model cannot know and needs: the situation, the facts, the numbers, the names, the history. The model has general knowledge, but it does not know your shop, your customer, your meeting or your deadline. If you leave a fact out, it may invent one that sounds right. Put the facts you want used in the prompt, and say so: "Use only the facts below."
State the target audience
The same facts need different words for different readers: a new customer, a manager, a ten-year-old, a technical colleague. Name the reader and, if it helps, their situation and reading level: "customers who read on a phone and may not speak English as a first language." This one line often fixes length, vocabulary and tone together.
The control parts: constraints, output format, success criteria
Add constraints and boundaries
Constraints are the limits: length, what to include, what to leave out, what sources to trust, what style to avoid. Typical examples: "At most 120 words", "Use only the facts above", "Do not offer discounts", "Plain words, no jargon". Constraints are also boundaries on invention: "If a fact is not given, write [MISSING] instead of guessing." Say what to do, not only what to avoid, whenever you can; the next page returns to this.
Specify the output format
The output format is the shape of the answer: an email with a subject line, a table with named columns, five bullets, a list of questions, a JSON object. If you will paste the answer somewhere, describe exactly what that place expects. Without a format, you get whatever the model likes, and you spend the time you saved on reformatting.
Define what a successful answer looks like
Success criteria are your test for "done", written before you see the reply: "After one reading, the customer knows the new date, knows they can cancel for a refund, and knows how to do it." They help the model aim, and they help you review: you can check the reply against each criterion instead of asking only whether it feels good. If you cannot write the criteria, you may not yet know what you want, which is useful to find out early.
Worked example: from one line to a full prompt
Kwame runs a small online shop in Accra that sells ceramic mugs and bowls. A supplier shipment is late, so some orders will arrive later than promised. He wants a message for his customers. We start with what most people type first and add one part at a time.
Step 0: the one-line request
Weak prompt:
Write a message about the delay.The model must guess everything: what delay, whose, who reads it, how long, which channel, what to promise. Expect a generic apology with invented details such as "due to unforeseen circumstances" and a made-up date.
Step 1: add a role and a precise task
Better prompt:
You are a customer-service writer for a small online shop.
Write one email that tells customers their order is delayed.The role sets a calm, helpful voice. The task now names the action (write), the thing produced (one email) and the purpose (tell customers about a delay). Still no facts, so the model will invent them.
Step 2: add context
Better prompt:
You are a customer-service writer for a small online shop.
Write one email that tells customers their order is delayed.
Facts:
- The shop is Accra Home Goods. It sells ceramic mugs and bowls online.
- The supplier's shipment is late. Orders placed 2026-10-20 to 2026-10-25 are affected.
- Old delivery date: 2026-10-30. New delivery date: 2026-11-04.
- Customers may cancel for a full refund by replying to the email.Now the model has real facts to use. It still does not know who reads the email or how long it should be.
Step 3: add the audience and constraints
Better prompt:
You are a customer-service writer for a small online shop.
Write one email that tells customers their order is delayed.
Facts:
- The shop is Accra Home Goods. It sells ceramic mugs and bowls online.
- The supplier's shipment is late. Orders placed 2026-10-20 to 2026-10-25 are affected.
- Old delivery date: 2026-10-30. New delivery date: 2026-11-04.
- Customers may cancel for a full refund by replying to the email.
Audience: customers who have not written to us before. Many read on a phone,
and for some English is a second language.
Constraints:
- At most 120 words in the body.
- Use only the facts above. Do not offer discounts, gifts or other compensation.
- Do not name the supplier.The audience line pushes the model toward short sentences and plain words. The constraints stop the most common invention in apology emails: an unrequested discount code.
Step 4: add the output format and success criteria
Better prompt:
You are a customer-service writer for a small online shop.
Write one email that tells customers their order is delayed.
Facts:
- The shop is Accra Home Goods. It sells ceramic mugs and bowls online.
- The supplier's shipment is late. Orders placed 2026-10-20 to 2026-10-25 are affected.
- Old delivery date: 2026-10-30. New delivery date: 2026-11-04.
- Customers may cancel for a full refund by replying to the email.
Audience: customers who have not written to us before. Many read on a phone,
and for some English is a second language.
Constraints:
- At most 120 words in the body.
- Use only the facts above. Do not offer discounts, gifts or other compensation.
- Do not name the supplier.
Output format: a subject line, a blank line, the email body, then the sign-off
"Kwame, Accra Home Goods". Plain text only.
Success: after reading once, the customer knows the new date, knows they can
cancel for a refund, and knows how to do it.Compare what each step added:
| Step | Part added | What it fixed |
|---|---|---|
| 0 to 1 | Role, task verb | Purpose and voice are clear |
| 1 to 2 | Context | Real dates and policy instead of invented ones |
| 2 to 3 | Audience, constraints | Length, wording level, no extra promises |
| 3 to 4 | Output format, success criteria | Ready to paste, and a test for the reply |
An example reply and what to verify
Example reply (illustrative; yours will differ):
Subject: Your order will arrive on 4 November
Hello,
Thank you for your order from Accra Home Goods. A delay in our shipment means
your order will now arrive on 4 November 2026, not 30 October. We are sorry
for the wait.
If the new date does not suit you, reply to this email and say you want to
cancel. We will refund your order in full.
You do not need to do anything else if the new date is fine.
Kwame, Accra Home GoodsThe reply is an invented example for teaching. A real reply will use other words, and it may break a rule. Treat it as a draft and check it against your own prompt:
- Facts: are both dates, the shop name and the refund policy exactly as you gave them? Models sometimes change a date format or "fix" a number.
- Inventions: look for anything you did not provide, such as a discount code, an order number, a phone number or a reason for the delay.
- Constraints: count the words of the body (here about 70), and check the supplier is not named.
- Format: is there a subject line, a blank line and the exact sign-off?
- Success criteria: can a new reader find the new date, the cancel option and how to cancel? Here, yes.
- Tone: would you send it? Edit the parts you would not.
A structured prompt makes a good reply more likely and makes problems easier to see. It does not guarantee a correct reply. You are still the person responsible for what is sent.
Layout tools: headings, bullets and numbered steps
The last three parts are not about content but about how you lay the prompt out, so that you and the model can read it without confusion.
Use headings to organise instructions
A long prompt is easier to read, edit and reuse when each part has a short label. You can use plain labels ("Facts:", "Audience:") as above, or Markdown-style headings such as ## Context. Either works across models; consistency matters more than the style. Headings also make your prompt library tidy: a teammate can change only the "Facts" part next week.
Use bullets for independent requirements
Use a bullet list when the items do not depend on each other and order does not matter: constraints, facts, things to include. One requirement per bullet is easier to follow and to check later than five requirements in one sentence.
Weak prompt:
Make it short and friendly and don't give discounts and say sorry and mention the new date.Better prompt:
Requirements:
- Keep the body under 120 words.
- Use a friendly tone.
- Apologise once.
- Mention the new date, 2026-11-04.
- Do not offer discounts.Use numbered steps for ordered tasks
When the work must happen in a sequence, number the steps. The numbers tell the model the order, and they let you point to a step when you correct it ("redo step 3"). Here is a task where order matters, because later steps use the results of earlier ones. The comments are invented sample data.
Prompt:
Follow these steps in order.
1. Read the four customer comments below.
2. Label each comment positive, negative or mixed.
3. Count how many comments have each label.
4. Write a two-sentence summary for the shop owner.
5. Show the labels and counts in a small table, then the summary.
Comments:
A. "Beautiful mug, but it arrived a week late."
B. "Fast delivery and the bowl is perfect."
C. "The colour is different from the photo."
D. "Lovely quality. Will order again."Use bullets for a set of rules and numbers for a sequence of actions. You can combine them: numbered steps for the process, bullets inside a step for its rules. One caution: numbered steps tell the model what to do, which is useful when the order is the point. You do not need to script every thought of the model. For hard reasoning tasks, describe the goal, the constraints and the output you need, and check the result.
The same anatomy, reused
The structure is not specific to emails. Here is how the same ten parts look for a different job, so you can see the pattern.
| Part | Study-plan request (Lena, Berlin) |
|---|---|
| Role | You are a patient study coach. |
| Task | Create a four-week revision plan. |
| Context | Statistics exam on 2026-12-10; weak on probability; 5 hours a week. |
| Audience | Me, a part-time student with a full-time job. |
| Constraints | No more than 5 hours per week; one rest day per week. |
| Output format | A table: week, topic, hours, one practice task. |
| Success criteria | Every week fits in 5 hours and probability appears at least twice. |
| Layout | Bullets for rules; numbered steps if you ask for a process. |
Where this shows up at work
- Customer messages and support: a shared prompt with fixed role, constraints and format keeps replies consistent across a team, while the facts part changes for each case.
- Reports and meetings: audience and output format decide whether a summary suits a manager, a client or a project file.
- Building AI features: the instructions that a developer puts in an application are the same anatomy, stored in a file and reviewed like code. Clear parts make a change easy to review and a failure easy to trace.
- Quality checks: success criteria become the checklist a reviewer uses before anything is sent.
Common mistakes
- Believing a grand role fixes accuracy. "You are the world's best analyst" changes the voice, not the truth of the facts. The fix: use a short, honest role for tone, give the real facts as context, and verify the output.
- A vague verb. "Help", "look at" and "do something about" leave the job open. The fix: choose a verb that names the action and the product ("summarise in five bullets").
- Leaving out facts and hoping the model knows. It will fill the gap with plausible details. The fix: put the facts in, and add "use only these facts".
- No output format. You get a long essay when you wanted a table, and then you reformat by hand. The fix: describe the shape, including headings, columns or length.
- Everything in one long sentence. Requirements get lost. The fix: label parts, use bullets for rules and numbers for sequences.
- Adding every part to every prompt. A one-line question does not need ten blocks. The fix: add a part when its absence would change the result.
Try it yourself
- Easy. Read this prompt: "You are an expert. Write about our new office hours." Using the anatomy table, list which of the ten parts are present and which are missing.
- Medium. Omar in Cairo runs a language school. The Saturday class of 2026-11-14 moves from 10:00 to 14:00; the room stays the same; students can switch to the Tuesday class if the new time does not suit them. Build a complete prompt (role, task, context, audience, constraints, output format, success criteria) that asks for a short notice to students. Use the same chat assistant you used on earlier pages and compare its reply with your success criteria.
- Hard. Take the vague request you improved in the exercise of Clarify, Iterate, Improve: From a Vague Request to a Specific Prompt, or choose any request from your own work. Rebuild it with the ten parts, using at least one bullet list and one numbered list. Run it, then check the reply against your own prompt line by line, and write down two things you would change in the prompt.
Answers
Easy. Present: a role ("an expert", very weak: it says nothing about viewpoint) and a task of sorts ("write about"). Missing: a precise task verb and product, context (which office hours? what changed? from when?), audience, constraints, output format, success criteria. Layout tools are not needed for a prompt this short. The role "an expert" is not harmful, but it adds little: it does not make facts more accurate.
Medium. A strong answer, as a prompt:
You are an administrator at a small language school. Your tone is polite and clear.
Write a short notice to students about a class time change.
Facts:
- The Saturday class on 2026-11-14 moves from 10:00 to 14:00.
- The room does not change.
- Students who cannot attend at the new time may switch to the Tuesday class.
Audience: adult students; some read English as a second language.
Constraints:
- At most 80 words.
- Use only the facts above. Do not invent a Tuesday time or a room number.
Output format: a subject line, then the notice, then the sign-off "The school office".
Success: a student knows the date, the new time, and what to do if they cannot come.Pass checklist: the prompt names a verb and a product; every fact (date, both times, room, Tuesday option) is in the prompt; there is a limit on length; there is a rule against inventing missing details; the format is stated; the success line can be tested. When you review the reply, check the date and both times first, then look for invented details such as a Tuesday time or a room number.
Hard. Answers vary. Your result passes if: all ten parts were considered (and any part you left out has a reason); the bullets hold independent rules and the numbers hold steps whose order matters; the context contains only facts you can confirm; the success criteria are testable by someone else; and your notes name two concrete prompt changes, for example "add a word limit" or "give the audience's reading level", based on something you actually saw in the reply.
Summary
- A good prompt answers the questions the model would otherwise guess: role, task, context, audience, constraints, output format and success criteria.
- Choose a precise action verb, give the real facts, and say who the reader is.
- A role shapes tone and viewpoint. It does not reliably make answers more accurate, and you should never invent credentials.
- Use headings to organise, bullets for independent rules and numbered steps for ordered work.
- Grow a prompt one part at a time and check each reply against your own constraints and success criteria. The structure improves your odds; it does not guarantee a correct answer.
Next: Constraints, Delimiters and a Reusable Prompt Checklist goes deeper on limits and boundaries, how to separate your instructions from pasted text, and a checklist you can reuse for every prompt.