Talking to AI · Lesson 6 of 7
Writing your first prompt
Learn a simple, repeatable four-part recipe (Role, Context, Task, Format) and build a complete prompt step by step.
You're learning as a guest — everything is open. Sign in to save progress, earn XP and pick up where you left off.
A recipe you can reuse
You now know what a prompt is, how models respond to patterns, and why context matters. Let's turn that into a simple recipe you can use for almost any request. It has four ingredients:
| Ingredient | Question it answers | Example |
|---|---|---|
| Role | Who should the AI act as? | "You are an experienced personal trainer." |
| Context | What's the situation? | "I'm 40, haven't exercised in years, and have a bad knee." |
| Task | What exactly should it do? | "Create a 4-week beginner walking plan." |
| Format | What should the result look like? | "A table with one row per week, under 200 words." |
You don't need all four every time. A quick question ("What's the capital of Peru?") needs only a task. But for anything you care about, running through these four will dramatically improve your results.
Tip: An easy way to remember it: Role, Context, Task, Format. Who, why, what, and how it should look.
Building a prompt, step by step
Let's build a real prompt from scratch. The situation: you want help planning a week of dinners.
Step 0: The first instinct
Most people start here:
Give me dinner ideas.
It's a valid prompt, but the AI knows nothing about you, so you'll get a generic list that might include dishes you don't eat, can't afford, or don't have time to cook.
Step 1: Add the task, precisely
Make the task concrete: how many, for when, and what you'll do with it.
Plan 5 weeknight dinners for Monday to Friday.
Better. Now the AI knows the scope.
Step 2: Add context
What would a helpful friend need to know before suggesting meals?
Plan 5 weeknight dinners for Monday to Friday. I'm cooking for two adults and a 7-year-old who doesn't like spicy food. We have about 30 minutes to cook on weeknights, and I'd like to keep the grocery bill reasonable. One of us is vegetarian, so at least 3 meals should be vegetarian, and the others should be easy to adapt.
This is where the biggest improvement happens. The AI now knows the people, the time limit, the budget, and the dietary needs.
Step 3: Add a role
A role tells the AI which perspective and expertise to bring.
You are a practical home cook who specializes in quick, budget-friendly family meals.
Roles are helpful but not magic. A role works best as a frame for good context, not a replacement for it.
Step 4: Add the format
Decide how you want to use the answer. You'll be shopping and cooking, so a table plus a shopping list makes sense.
The finished prompt
You are a practical home cook who specializes in quick, budget-friendly family meals. Plan 5 weeknight dinners for Monday to Friday. I'm cooking for two adults and a 7-year-old who doesn't like spicy food. We have about 30 minutes to cook on weeknights, and I'd like to keep the grocery bill reasonable. One of us is vegetarian, so at least 3 meals should be vegetarian, and the others should be easy to adapt. Format: 1. A table with columns: Day, Meal, Prep time, Vegetarian? (yes/adaptable) 2. A combined shopping list grouped by store section (produce, dairy, pantry, etc.) 3. One tip for reusing leftovers during the week
Here's an illustrative example of the kind of response this produces (shortened):
| Day | Meal | Prep time | Vegetarian? |
|---|---|---|---|
| Monday | Veggie fried rice with eggs | 25 min | Yes |
| Tuesday | Chicken and vegetable sheet-pan dinner (tofu for the vegetarian) | 30 min | Adaptable |
| Wednesday | Pasta with tomato, spinach, and white beans | 20 min | Yes |
| Thursday | Build-your-own tacos (beans and seasoned chicken side by side) | 25 min | Adaptable |
| Friday | Homemade flatbread pizzas | 20 min | Yes |
Shopping list Produce: onions, garlic, spinach, bell peppers, broccoli... Pantry: rice, pasta, canned white beans, canned tomatoes...
Leftover tip: Cook extra rice on Monday and use it for a quick lunch bowl on Wednesday.
Compare that to what "Give me dinner ideas" would return. Same AI, completely different usefulness.
Then iterate
Your first prompt doesn't have to be perfect. Read the result and adjust with a quick follow-up:
- "Swap Thursday for something that uses a slow cooker."
- "My kid doesn't eat mushrooms. Replace any meals that use them."
- "Add rough cooking steps for Tuesday's meal."
Each follow-up builds on the context you've already given, so you don't need to repeat everything.
A reusable template
Copy this skeleton and fill in the blanks for your next request:
You are [role with relevant expertise]. Context: [your situation, background facts, constraints, and who this is for]. Task: [exactly what you want done, with any numbers or scope]. Format: [length, structure, tone, and anything to include or avoid].
Watch out: Don't let the template become a box-ticking exercise. "You are a helpful assistant" adds nothing as a role, and stuffing in irrelevant context can blur the request. Each part should carry information that changes the answer.
Quick recap
Role, Context, Task, Format: who the AI should be, what the situation is, what to do, and how the result should look. Start with a clear task, add the context only you know, frame it with a role, define the format, and then refine with follow-ups.
Common mistakes
Mistake: Using a generic role like 'You are a helpful assistant' and calling it done.
Fix: Choose a role with relevant expertise, and spend most of your effort on context and task.
Mistake: Leaving the task vague ('help with dinner') even when context is detailed.
Fix: State exactly what to produce, including numbers and scope (e.g., '5 dinners for Monday to Friday').
Mistake: Forgetting to say how you'll use the result, then getting a wall of text.
Fix: Pick a format that fits your next step: a table to compare, a list to shop with, steps to follow.
Practice exercise
Build a prompt with the recipe
Use the Role, Context, Task, Format recipe to turn the starter prompt into a complete, useful prompt.
- Task: Make it precise (what, how many, for when).
- Context: Add at least three facts the AI couldn't guess.
- Role: Choose a role with relevant expertise.
- Format: Describe the structure that fits how you'll use the answer.
Label each part, or write it as natural paragraphs, whichever you prefer.
Your draft stays in this browser tab — it isn't sent anywhere.Try your draft in the Playground
Hints
You can do the whole exercise as a guest.Sign in to save progress
Knowledge check