The perfect prompt: anatomy of a prompt that works every time
Some prompts produce spectacular results. Others, on the same subject, give flat and generic responses. The difference? It's neither luck nor talent — it's the structure.
A perfect prompt is composed of 6 fundamental elements. When you master them, you get relevant responses from any AI — ChatGPT, Claude, Gemini or others. This article deconstructs each of these elements, explains why it matters, and shows you how to use it with concrete examples.
If you're a beginner, first check out our guide what is prompting to understand the basics.
The 6 elements of a perfect prompt
Imagine a prompt like a cooking recipe. Each ingredient has a specific role. Forget one and the result changes completely. Here are the 6 ingredients of a perfect prompt:
- The role — Who is the AI in this conversation?
- The context — What is the situation?
- The instruction — What exactly should the AI do?
- The format — How to present the response?
- The constraints — What limits to respect?
- The examples — What does the expected result look like?
Let's look at each element in detail.
Element 1: The role — Give expertise to the AI
The role is the first element of your prompt. It defines who the AI is in this conversation. Assigning a role activates the knowledge and vocabulary related to that domain of expertise.
Why it's essential: the same subject treated by a "high school teacher" or by a "neuroscience researcher" won't give the same result at all. The role determines the level of detail, vocabulary and approach angle.
How to formulate it well:
- Be specific: "technical SEO expert" rather than "marketing expert"
- Add experience: "with 10 years of experience in B2B startups"
- Specify the style: "who explains in a simple and educational manner"
Example:
You are a certified nutritionist specialized in endurance athlete nutrition. You communicate clearly and practically, avoiding medical jargon.
Element 2: The context — Set the scene
The context gives the AI all the background information it needs to respond relevantly. Without context, the AI has to guess — and it often guesses wrong.
Why it's essential: the AI knows nothing about your situation. Your industry, your audience, your constraints, your objectives — all of this must be explicit.
What to include:
- Your current situation and your objective
- Your audience or recipient
- Relevant background information (data, history, previous attempts)
- The framework in which the request fits
Example:
I'm preparing for a marathon in 4 months. I currently run 30 km per week. I'm vegetarian and tend to lack iron. My goal is to go under 3h45.
Element 3: The instruction — The precise request
The instruction is the heart of your prompt. It's what you concretely ask the AI to do. A vague instruction produces a vague response.
Why it's essential: it's the only part that many people write — but often too vaguely. "Help me with my nutrition" is not an instruction. "Create a weekly meal plan" is one.
Keys to a good instruction:
- Use an action verb at the beginning of the sentence: "create", "write", "analyze", "compare", "list"
- Be specific about the expected deliverable
- One instruction = one task. If you have several, break them down
Example:
Create a 7-day meal plan adapted to my marathon preparation, with breakfast, lunch, dinner and 2 snacks.
Element 4: The format — Structure the response
The format tells the AI how to present its response. Without format indication, the AI generally produces a long text in paragraphs — not always what you need.
Why it's essential: a comparative table, a bullet list and a narrative text contain the same information but don't serve the same purpose. The right format makes the response immediately usable.
Common formats to specify:
- Table with defined columns
- Bullet or numbered list
- Structure with H2/H3 headings
- Specific format: email, LinkedIn post, report
- Number of words or paragraphs
- Code with comments and tests
Example:
Present the plan as a table with columns: Day, Breakfast, Morning snack, Lunch, Afternoon snack, Dinner. Add an "Estimated caloric intake" row at the bottom of each day.
Element 5: The constraints — Define the limits
Constraints frame the response. They eliminate irrelevant results and force the AI to stay within the limits of what is useful to you.
Why it's essential: without constraints, the AI tends to produce responses that are too long, too generic or off-topic. Constraints channel the AI's creativity toward what is truly useful to you.
Types of constraints:
- Length: "maximum 300 words", "in 5 points"
- Tone: "professional", "casual", "educational"
- Exclusions: "without dietary supplements", "without technical jargon"
- Audience: "understandable by a beginner"
- Quality: "with sources", "based on scientific data"
Example:
Only vegetarian foods. Prioritize plant-based iron sources. Maximum budget 60 euros per week. Maximum preparation time 30 minutes per meal. No powder supplements.
Element 6: The examples — Show rather than tell
Examples are the advanced prompter's secret weapon. An example is worth a thousand words of explanation. This technique is called few-shot prompting and it's one of the most powerful levers to get exactly the result you want.
Why it's essential: some expectations are difficult to express with words. The format, tone, level of detail — an example conveys all of this instantly.
How to use examples:
- Show 1 to 3 examples of the expected result
- Give an example of "input" and the corresponding "output"
- Also include a counter-example if useful ("do NOT do this")
Example:
Here's the desired format for each meal:
Breakfast (day 1): Oat porridge (80g) + soy milk + banana + pumpkin seeds (15g) — ~450 kcal, 18g protein, 4mg iron
Follow this model for all meals.
The complete prompt: all elements assembled
Here's what a prompt that uses all 6 elements looks like. Compare it with what most people write:
What most people write:
Make me a meal plan for sports.
The perfect prompt:
[Role] You are a certified nutritionist specialized in endurance athlete nutrition. You communicate clearly and practically.
[Context] I'm preparing for a marathon in 4 months. I run 30 km/week, I'm vegetarian and tend to lack iron. Goal: go under 3h45.
[Instruction] Create a 7-day meal plan with breakfast, lunch, dinner and 2 snacks per day.
[Format] Present as a table: Day | Meal | Detail | Calories | Protein | Iron.
[Constraints] Vegetarian only. Max budget 60 euros/week. Max preparation 30 min/meal. No powder supplements. Plant-based iron sources prioritized.
[Example] Expected format — Breakfast D1: Oat porridge (80g) + soy milk + banana + pumpkin seeds (15g) — 450 kcal, 18g prot, 4mg iron.
The difference is obvious. The first prompt leaves the AI guessing almost everything. The second precisely guides toward the desired result.
Do you always need to use all 6 elements?
No. The 6 elements are your complete toolbox, but you don't need to use them all every time:
- Quick question: instruction alone is enough ("What is the capital of Australia?")
- Simple task: instruction + format ("List 5 gift ideas for an 8-year-old child, as bullet points")
- Professional task: role + context + instruction + format (most use cases)
- Complex or precise task: all 6 elements for optimal result
The essential thing is to know these 6 elements to mobilize them when the result isn't up to par. If the AI doesn't give you what you want, identify which element is missing and add it.
The cheat sheet to keep handy
Here's the checklist to consult before each important prompt:
- Role — Who is the AI? What expert does it embody?
- Context — Does the AI have all the necessary info about my situation?
- Instruction — Is my request precise with an action verb?
- Format — Have I specified how I want the response?
- Constraints — Are there limits to respect?
- Examples — Would an example help the AI understand my expectations?
Download this checklist in printable format from our prompting cheat sheet, or use our prompt builder which guides you through each element automatically.
Conclusion: the perfect prompt is a complete prompt
A perfect prompt isn't necessarily long or complex. It's a complete prompt — one that gives the AI everything it needs to produce exactly the result you expect.
The next time an AI response disappoints you, don't blame the tool. Review your prompt, identify the missing element among the 6, and add it. You'll be surprised by the difference.
The 6 elements — role, context, instruction, format, constraints, examples — are your universal structure. Master it, and every AI will become a remarkably effective assistant.
Stay Updated
Get our best articles and techniques every week.