Prompt Engineering Foundations · Getting started: what a prompt really is · lesson 2 of 16 · 11 min
The anatomy of a good prompt
Five building blocks
Most great prompts contain some or all of five building blocks. You will not need every block every time, but knowing them means you will never be stuck.
- Task: what you want done. Start with a clear action verb: write, summarise, explain, compare, list, rewrite, plan.
- Context: the background the AI needs: who you are, the situation, the goal.
- Audience: who the result is for, and what they already know.
- Format: what the output should look like: length, structure, tone, language.
- Examples or constraints: a sample of what good looks like, and any rules (what to include, what to avoid).
A handy memory aid: Task, Context, Audience, Format, Examples (T-CAFE).
Building a prompt, block by block
Let's build a prompt for a common task: asking a landlord to fix a broken heater.
Task only:
Write an email to my landlord.
Add context:
Write an email to my landlord asking them to fix the heater in my flat.
It stopped working 5 days ago and I reported it by phone on Monday
but nobody has come.
Add audience:
... My landlord is polite but slow to respond, and I want to keep a good
relationship.
Add format:
... Keep it under 150 words, polite but firm, with a clear request for a
repair date by Friday. Include a subject line.
Add constraints:
... Don't threaten legal action. Mention that I have a young child at home.
The final prompt is five or six sentences long, and the email it produces will need only minor edits. The first version would have needed a full rewrite.
Why each block matters
- Without a clear task, the AI may explain instead of write, or write instead of list.
- Without context, it invents a generic situation.
- Without audience, it guesses the level of detail and tone. An explanation for a ten-year-old and one for a finance director are very different.
- Without format, you get whatever length and structure is typical, often too long.
- Without examples or constraints, it cannot match your style or avoid things you dislike.
Order and layout
For short prompts, natural sentences work well. For longer prompts, especially when you paste in text, it helps to separate the parts clearly:
TASK: Summarise the customer feedback below for my manager.
CONTEXT: We are a small online clothing shop. This is feedback from
our last 30 orders.
AUDIENCE: My manager, who has 2 minutes to read it.
FORMAT: 3 bullet points of main themes, then 1 suggested action.
FEEDBACK:
---
(paste feedback here)
---
Putting pasted text inside quotation marks or clear markers helps the AI tell your instructions apart from the material you want it to work on.
Role: an optional sixth block
You may see advice to start with "You are a..." ("You are an experienced career coach"). A role can help set the tone and level of expertise, especially in combination with the other blocks. But a role alone is not magic; "You are a world-class marketer. Write a post." still lacks context, audience and format. Think of role as seasoning, not the meal.
A worked example from start to finish
A shop owner in Dubai wants to reply to a customer review.
TASK: Write a reply to the Google review below.
CONTEXT: I own a small phone repair shop in Dubai. The customer waited
2 hours because a part was delayed. We gave a 10% discount.
AUDIENCE: The customer, but also future customers reading the reviews.
FORMAT: Under 80 words, warm and professional, in English.
CONSTRAINTS: Apologise sincerely, don't make excuses, invite them back.
REVIEW:
"Repair was good but I waited 2 hours with no updates. Not happy."
The result will be specific (it mentions the wait and the missing updates), appropriately short and on-tone.
Quick self-check before you press enter
Ask yourself:
- Would a smart stranger understand what I want?
- Did I say who it is for?
- Did I say how long and in what format?
- Is there anything I would be annoyed to see? If so, say so.
This takes ten seconds and saves many rounds of back-and-forth.
Hands-on: build a T-CAFE prompt in five minutes
Pick a real task from this week. Fill in this template, deleting any line you do not need:
TASK: [action verb + what you want, e.g. "Write a WhatsApp message..."]
CONTEXT: [who you are, the situation, the goal]
AUDIENCE: [who will read it and what they care about]
FORMAT: [length, structure, tone, language]
EXAMPLES / CONSTRAINTS: [a sample you like; things to include or avoid]
Here is a filled-in version from a freelance photographer in Karachi:
TASK: Write a WhatsApp message confirming a wedding shoot booking.
CONTEXT: I am a freelance photographer. The couple paid a 30% deposit
yesterday. The shoot is on the mehndi and baraat days.
AUDIENCE: The bride's elder sister, who is organising everything and is
very busy.
FORMAT: Under 70 words, warm and professional, English with one Urdu
greeting. Use line breaks, no bullet points.
CONSTRAINTS: Mention that the balance is due one week before the first
event. Do not mention prices.
The same structure works in every assistant
T-CAFE is not tied to one product. It works in ChatGPT, Claude, Gemini, Copilot or any assistant built into your email, documents or phone. If your assistant supports custom instructions or projects (see module 4), you can store the parts that never change, such as who you are and your preferred style, so each new prompt only needs the task and the details.
Common beginner questions
Do I need to write labels like TASK and CONTEXT? No. They help you remember the parts and help the AI separate them, especially when you paste material. Natural sentences work fine for short prompts.
How long should a prompt be? As long as it needs to be. Two sentences for a quick rewrite; half a page when you paste material and have specific requirements. Length is not the goal; missing information is the enemy.
Should I be polite? Politeness does no harm and keeps your habits pleasant, but clarity matters far more than "please" and "thank you".
How to know your prompt is good
Run the stranger test: hide the AI's answer and show only your prompt to a friend. If they could do the task without asking you a single question, your prompt is ready. If they ask "Who is this for?" or "How long?", add that information.
Video lecture: The anatomy of a good prompt
11 chapters · about 8 minutes · captions and full transcript below.
- The anatomy of a good prompt
- T-CAFE
- Building block by block
- Each missing block = a guess
- Label longer prompts
- Role: seasoning, not the meal
- The ten-second self-check
- Practice round: a booking confirmation
- Example 1: a birthday message
- Example 2: a hotel review reply (illustrative)
- Recap
Lecture transcript
The anatomy of a good prompt
What if every good prompt you ever wrote had the same hidden structure? It does. In this lecture you will learn five building blocks that turn a vague request into one the AI can nail first time. You will watch a prompt grow block by block, see a complete worked example, and leave with a ten-second self-check you can run before pressing enter. By the end, you will never stare at an empty chat box wondering what to type.
T-CAFE
Here are the five blocks. Task: what you want done, starting with a clear action verb like write, summarise, compare or plan. Context: the background, who you are, the situation and the goal. Audience: who the result is for and what they already know. Format: length, structure, tone and language. And Examples or constraints: a sample of what good looks like, plus rules about what to include or avoid. A handy memory aid is T CAFE. Task, Context, Audience, Format, Examples. You will not need every block every time. But knowing them means you are never stuck.
Building block by block
Watch a prompt grow. We start with the task only: write an email to my landlord. The AI has no idea why. Add context: ask them to fix the heater in my flat, it stopped working five days ago, and I reported it by phone on Monday. Now add audience: my landlord is polite but slow, and I want to keep a good relationship. Add format: under one hundred and fifty words, polite but firm, with a clear request for a repair date by Friday, and a subject line. Finally, constraints: do not threaten legal action, and mention that I have a young child at home. Five or six sentences, and the email needs only minor edits.
Each missing block = a guess
Why does each block matter? Without a clear task, the AI may explain when you wanted it to write. Without context, it invents a generic situation. Without an audience, it guesses the tone and depth, and an explanation for a ten-year-old is very different from one for a finance director. Without format, you get whatever length is typical, usually too long. And without examples or constraints, it cannot match your style or avoid the things you dislike. Each missing block is a gap the AI fills with an average guess.
Label longer prompts
For longer prompts, especially when you paste material in, labels help. Write TASK, then CONTEXT, then AUDIENCE, then FORMAT, then paste the material between clear markers like three dashes. The labels help you remember the parts, and they help the AI tell your instructions apart from the text you want it to work on. Imagine a phone repair shop owner in Dubai replying to a two-star review. Task: write a reply. Context: the customer waited two hours because a part was delayed, and we gave a ten percent discount. Audience: the customer, and future customers reading reviews. Format: under eighty words, warm and professional. Constraints: apologise sincerely, no excuses, invite them back.
Role: seasoning, not the meal
You may have seen advice to start every prompt with you are a world-class marketer, or you are an expert career coach. A role like that can help set tone and depth. But a role on its own is not magic. You are a world-class marketer, write a post, still has no context, no audience and no format. Think of the role as seasoning, not the meal. Add it when it helps, and never instead of the five blocks.
The ten-second self-check
Here is your ten-second self-check before you press enter. Would a smart stranger understand what I want? Did I say who it is for? Did I say how long and in what format? And is there anything I would be annoyed to see? If so, say it up front. A great way to test this is the stranger test: show only your prompt to a friend. If they could do the task without asking you a single question, your prompt is ready.
Practice round: a booking confirmation
Here is a quick practice round. A freelance photographer in Karachi needs to confirm a wedding booking on WhatsApp. Task: write the confirmation message. Context: the couple paid a thirty percent deposit, and the shoot covers the mehndi and the baraat. Audience: the bride's elder sister, who is organising everything and very busy. Format: under seventy words, warm and professional, English with one Urdu greeting, line breaks and no bullet points. Constraints: mention that the balance is due one week before the first event, and do not mention prices. Notice how quickly the blocks fall into place once you know them. That is the whole point of a structure.
Example 1: a birthday message
First, a simple example to lock in the five blocks. Say you want a birthday message for a colleague. Task: write a short birthday message. Context: she is my colleague Sana, and she just finished a huge project. Audience: Sana, and the rest of the team will see it in the group chat. Format: two sentences, cheerful, one emoji. Constraint: do not mention her age. Read that back. It took about twenty seconds to write, and the result will sound like it came from someone who actually knows her. Notice you did not need a role, a long preamble or any special phrases. Five blocks, filled in quickly, and you are done.
Example 2: a hotel review reply (illustrative)
Now a realistic business scenario, with illustrative numbers. Lina manages marketing for a boutique hotel in Abu Dhabi with sixty rooms. She needs a reply to a guest who complained about a noisy air-conditioning unit. Task: draft a reply to this review. Context: we fixed the unit the same day and offered a free late checkout. Audience: the guest, plus future guests reading public reviews. Format: under ninety words, warm and professional, English. Constraints: apologise without excuses, mention the fix, invite them back, and do not offer anything we did not offer. The draft comes back specific and calm. Lina edits one phrase and posts it. Across, say, twenty reviews a month, a structure like this can save her a couple of hours, and keeps every reply on-brand.
Recap
Let us recap. Great prompts are built from five blocks: Task, Context, Audience, Format, and Examples or constraints, T CAFE. Add only the blocks the task needs, label them for longer prompts, and treat roles as seasoning. The same structure works in every assistant, whether it is ChatGPT, Claude, Gemini, Copilot or the one built into your email. Try this now: use the template in the lesson to write a T CAFE prompt for a real message you need to send this week, and run the stranger test on it. Next up, we tackle the biggest enemy of good answers: vague words.
Key takeaways
- Great prompts combine Task, Context, Audience, Format and Examples or constraints (T-CAFE).
- Start with a clear action verb, then add only the blocks the task needs.
- Separate instructions from pasted material with labels or quotation marks.
- A role can help, but it does not replace context, audience and format.
Try it
Write a T-CAFE prompt for a real message you need to send this week. Ask a friend or colleague to read only your prompt: could they do the task without asking questions?