In one sentence
Prompt engineering is the art of talking properly to an AI to get better answers. You don't need to be technical: 7 simple rules are enough to go from mediocre answers to excellent ones.
Why it matters
Here's the same question asked 2 different ways:
The impact of prompt engineering
| 🥱❌ Bad prompt | 🎯✅ Good prompt | |
|---|---|---|
| Prompt | Write an email to my boss | Write a short professional email (5 lines max) to my manager to request leave from 12 to 16 May. Respectful but cordial tone. Mention that my colleague Pierre will take over my urgent files. |
| Result | Generic 200-word email, weird tone, lacks precision | Perfect email, just needs signing |
| Follow-up effort | Complete rewrite | Send |
The second prompt takes 30 seconds longer to write. But it saves 5 minutes of rewriting. Over 100 prompts, that's 8 hours saved per week.
Rule 1: Give context
The AI has no idea who you are, what you do, about your company. It assumes you're an average English speaker writing to another average English speaker. Everything you don't say, it guesses, often wrongly.
Before: "Explain GDPR to me" After: "I'm a marketing intern at a French SME. Explain GDPR to me in 200 words, with the 3 main obligations that will impact my work (email collection, cookies, customer segmentation)."
The second version will give you a directly usable answer, whereas the first will give you a generic legal lecture.
Rule 2: Be precise about format
AI can generate any format: email, table, list, JSON, code, dialogue, outline, summary, translation... But you need to ask for it explicitly.
Bad: "Summarize this document" Good: "Summarize this document in 5 bullets, each starting with an action verb, format 'Action → Benefit'. Professional but direct tone."
Effect of precise format on satisfaction
Rule 3: Give examples (few-shot)
Few-shot prompting is just giving 1 to 5 examples of what you want. It's the most effective technique for getting consistent results.
Without examples: "Generate 5 modern product names" → Random and generic response
With 2 examples:
Generate 5 product names in this style:
- Notion (productivity, short, memorable)
- Linear (project management, resembles a common English word)
Here are 5 new ones:→ The AI will understand the style and suggest coherent names
This is used everywhere in production: data extraction, classification, code generation, writing in a specific style.
Rule 4: Break into steps (chain-of-thought)
For complex tasks, don't ask for the final result directly. Ask the AI to go through steps.
Direct request vs steps
| ⚡❌ Direct | 🪜✅ By steps | |
|---|---|---|
| Prompt | How much does a 5-day NYC trip for 2 people cost? | Calculate the cost of a 5-day NYC trip for 2 people. Step 1: return flights. Step 2: mid-range hotel. Step 3: meals. Step 4: activities. Step 5: total. |
| Accuracy | Approximate, sometimes wrong | Detailed and verifiable |
| Ability to correct | All or nothing | You can adjust each line |
Tip: simply add "Think step by step" at the end of your complex prompts. On recent models, this improves accuracy by 20-40% on reasoning tasks.
Rule 5: Ask it to "think first"
New "reasoning" models (Claude Opus, GPT-5 thinking, DeepSeek R2) have a "thinking" mode where they reflect internally before answering you. But even classic models benefit from a nudge.
This is particularly useful for:
- Complex decisions (should I do X or Y?)
- Risk analysis
- Technical choices
- Marketing strategies
Rule 6: Iterate, don't start over
90% of people make a single attempt and say "AI is rubbish". Wrong. You need to iterate: like with a human, the first version is never perfect.
Concrete example of iteration on an email:
You: Write me an email to follow up with a client who hasn't responded in 2 weeks
AI: [Generic 150-word email]
You: Too long. Make it 5 lines max, warmer, and end with an open question
AI: [Improved version]
You: Good, but don't mention he hasn't responded, that's passive-aggressive. Be positive
AI: [Perfect final version]
3 iterations of 10 seconds each = perfect email. Much faster than writing it all yourself.
Rule 7: Always verify
AI can make things up (the famous "hallucinations") with total confidence. For anything that's:
- Precise figures → verify with a source
- Quotes → verify they actually exist
- Code → test before deploying
- Medical/legal advice → consult a professional
- Historical facts → cross-check with Wikipedia or an official source
📚Going further: advanced techniques
Explicit Chain-of-Thought (CoT)
Instead of "Think step by step", use:
To solve this problem:
1. Rephrase the question in your own words
2. List the known information
3. Identify what we're looking for
4. List possible methods
5. Choose the best and apply it
6. Verify your resultThis forces the AI to structure its reasoning → better accuracy.
ReAct (Reasoning + Acting)
For AI agents that need to use tools. Pattern:
- Thought: "I need to search for X"
- Action: use the search tool
- Observation: analyze the results
- Next thought: "Now I need Y"
This is what powers agents like Claude Code, ChatGPT with browsing, etc.
Tree of Thoughts (ToT)
Instead of generating one answer, ask for multiple branches:
- "Generate 3 different approaches to solve this problem"
- "Evaluate each approach: advantages, disadvantages"
- "Recommend the best one and explain why"
Excellent for strategic decisions.
Self-Consistency
Ask the same thing 3 times with slight variations. If the 3 answers converge, that's a good sign. If they diverge, the AI is less certain than it appears.
Role prompting
Give the AI a role:
- "You are a McKinsey consultant expert in B2B SaaS strategy"
- "You are a senior Rust developer, 10 years' experience"
- "You are a journalist from The Guardian, sober and factual tone"
This radically changes the tone and precision of responses.
Negative prompting
Also say what you don't want:
- "Avoid buzzwords (synergies, leverage, optimize, etc.)"
- "Don't start with 'Certainly' or 'As an AI'"
- "No generic moral warnings"
The AI will respect these negative instructions fairly well.
Pitfalls to avoid
Advanced use cases
Here are prompt patterns that work every time:
🎯 The executive summary
Summarize this document at 3 levels:
1. ONE sentence (the absolute essential)
2. 5 bullets (the key points)
3. 200 words (complete summary)🔍 Instant SWOT analysis
Analyze [topic] as a SWOT:
- Strengths (3)
- Weaknesses (3)
- Opportunities (3)
- Threats (3)
Then give 3 priority concrete actions.📧 The perfect email
Write an email to [recipient] for [objective].
Context: [important details]
Tone: [formal/friendly/direct]
Length: 5 lines max
End with: an open question / a call-to-action🐛 Assisted debugging
I have this error: [paste error]
Here's my code: [paste code]
Step 1: explain what this error is in plain English
Step 2: identify THE likely cause in my code
Step 3: propose the fix
Step 4: explain why it will work✍️ Text improvement
Rewrite this text keeping the meaning but improving:
- Clarity (shorter sentences)
- Tone (more professional)
- Punch (more impactful)
Text: [paste]🎯 Which model to choose for these prompts?
Not all LLMs are equal. Claude is top for writing, GPT-5 for code, Mistral for French...
Quiz: your prompt engineering level
What's the most important rule of prompt engineering?
Going further
Now you know the essentials of prompt engineering. To go further:
- 🎯 Compare models: Claude is king of writing, GPT-5 of code, Mistral of French
- 💰 Evaluate cost: your long prompts cost real money in API (see "Pay or not")
- 🧠 Discover reasoning LLMs: Claude Opus, o3, DeepSeek R2 are game-changers on complex tasks
And above all: practice. Prompt engineering is 10% theory, 90% trial and error. The more you use AI, the better you'll sense which prompts work. ✨