The anatomy of a good prompt
Course contents (19 lessons)
- Understanding the tool
- What a language model is, in plain words
- How ChatGPT works from a user's point of view
- Building a good prompt
- The anatomy of a good prompt
- Being specific: how to remove guesswork
- Showing examples: few-shot prompting
- Asking for step-by-step reasoning
- Controlling and improving answers
- Controlling length, tone and format
- Iterating: how to improve an answer with follow-ups
- Custom instructions and memory
- Working with files and images
- ChatGPT for real tasks
- Using ChatGPT for writing: emails, reports and rewrites
- Using ChatGPT for studying and learning
- Using ChatGPT for coding and technical work
- Using ChatGPT for data, spreadsheets and business tasks
- Prompt templates
- A library of reusable prompt templates
- Reliable and safe use
- Avoiding hallucinations and checking facts
- Privacy and safe use
- Workflows and final project
- Building repeatable workflows and custom assistants
- Final project: build your own prompt toolkit
A prompt is a brief
Think about how you would brief a new colleague on their first day. You would not say "do something about the website". You would say what you want done, why, for whom, how it should look, and what to avoid. A prompt is the same kind of brief. Most weak answers come from a weak brief, not from a weak model.
A strong prompt usually has five parts. You do not need all five every time, but knowing them gives you something to add when an answer is not good enough.
The five parts
- Role. Who the model should act as. This sets the vocabulary and the viewpoint.
- Task. The thing you want done, as a clear verb: write, summarise, compare, list, explain, rewrite.
- Context. The background the model cannot guess: who the audience is, the situation, the facts, the purpose.
- Format. The shape of the answer: a table, five bullet points, an email, two paragraphs.
- Constraints. The limits: length, tone, words to avoid, things to include, what not to do.
One request, built up step by step
Suppose you run a small bakery and want to tell customers about a price change. Here is the weak version:
Write a message about our price increase.
You will get a generic message, probably too formal, with invented details. Now add the parts, one at a time.
You are a friendly customer-care writer for a small neighbourhood bakery.
Task: write a short message telling customers that our bread prices
will rise by about 8% from the first of next month.
Context: our customers are mostly regulars who know us by name. The rise
is because flour and electricity cost more. We have not raised prices
for over a year. We do not want to sound guilty or corporate.
Format: one short paragraph for a shop-door notice, followed by a
two-sentence version for a text message.
Constraints: warm, honest, plain words, under 90 words for the notice,
no exclamation marks, do not mention competitors.
Compare the two prompts. The second contains almost everything a human writer would have asked you in a ten-minute conversation. The model does not get to ask, so you answer in advance.
Why each part works
- The role pulls the writing toward a friendly, local voice and away from a corporate announcement.
- The task includes the exact change, about 8%, so the model does not invent a figure.
- The context gives reasons and the audience. With it the model can write an honest explanation instead of empty filler.
- The format asks for two versions, which saves a follow-up.
- The constraints shut off the most likely bad outcomes: too long, too stiff, too many exclamation marks.
A second example: a technical task
Role: a senior spreadsheet consultant.
Task: explain how to get the total sales per region from a table.
Context: I use Excel, my data is in columns A to D (Date, Region,
Product, Amount), about 2,000 rows. I have never used pivot tables.
Format: numbered steps, each one sentence, then a short "if it goes
wrong" list with two common problems.
Constraints: no jargon without a short explanation, and tell me which
menu names to look for, without assuming I know the shortcuts.
Notice that "context" here is the facts about your data and your skill level. A prompt that says "I have never used pivot tables" changes the whole answer for the better. Telling the model how much you know is one of the cheapest improvements you can make.
A short checklist
Before you send an important prompt, run through these questions:
- Would a smart stranger understand what I want, with only this text?
- Did I say who the answer is for?
- Did I say how long, and in what shape?
- Did I give the facts it must use, so it does not invent them?
- Did I say what to avoid?
Is the role really needed?
Honestly, the role is the weakest of the five. "You are a world-class expert" adds little. A role helps when it picks a real style or viewpoint, such as "a patient maths tutor for a 12-year-old" or "a sceptical editor". Do not waste time on grand titles. Put your effort into context and constraints, which change answers far more.
Order and layout
For long prompts, it helps to separate the parts with labels, as in the examples, or with a line of dashes. If you paste material for the model to work on, put it clearly apart from your instructions:
Summarise the email below in two sentences and list any deadlines.
--- EMAIL START ---
[paste the email]
--- EMAIL END ---
The markers make it obvious where your instruction ends and the material begins. This also helps against a quirky problem: if the pasted text contains its own instructions, such as "ignore the above", the model is less likely to follow them by mistake.
The common mistake
Writing a long prompt with no real information in it. "Write an excellent, engaging, high-quality, professional article" has five adjectives and zero facts. Length is not the goal. Information is. Replace each adjective with something concrete: who reads it, what they want to do next, what to include.
Try it yourself
- Pick a message you need to write this week. Write it as a weak one-line prompt, send it, and save the result.
- Rewrite it with all five parts and send it in a new chat. Compare the two answers.
- Remove one part at a time and see which removal hurts the result most. For most people it is context.
You are a friendly customer-care writer for a small neighbourhood bakery.
Task: write a short message telling customers that our bread prices
will rise by about 8% from the first of next month.
Context: our customers are mostly regulars who know us by name. The rise
is because flour and electricity cost more. We have not raised prices
for over a year. We do not want to sound guilty or corporate.
Format: one short paragraph for a shop-door notice, followed by a
two-sentence version for a text message.
Constraints: warm, honest, plain words, under 90 words for the notice,
no exclamation marks, do not mention competitors.
This course is free to read. Create a free account to enrol, save your progress and pick up where you left off.
Sign up free I already have an account