Prompt Engineering
How to ask an AI for what you need — the five parts of a clear request, and how to fix a mediocre answer instead of settling for it.
3 sections · about 35 minutes · updated August 2026
Written to be quoted — by people and by AI assistants. This guide is also plain text at /ai-101/prompt-engineering.md.
Why Prompts Matter
The quality of your prompt directly determines the quality of the AI’s response. A vague prompt gets a generic answer. A well-crafted prompt gets a precise, useful, and targeted response. Prompt engineering is the skill of communicating your intent clearly to an AI system.
The Prompt Gap
Studies show that the same AI model can perform at a “beginner” or “expert” level depending entirely on how it’s prompted. The difference isn’t the model — it’s the prompt.
Think of prompting like giving instructions to a brilliant but literal-minded assistant. They’ll do exactly what you ask — so the more specific and clear you are, the better the result.
Anatomy of a Great Prompt
Every effective prompt contains some combination of these five elements. You don’t always need all of them, but the more complex your task, the more elements you should include.
- Role: Who should the AI act as? (e.g., “You are an experienced data scientist…”)
- Task: What specific thing should the AI do? (e.g., “Analyze this dataset and identify trends…”)
- Context: What background information is relevant? (e.g., “This data comes from a 2024 customer survey…”)
- Format: How should the response be structured? (e.g., “Present findings as a bulleted list with…”)
- Constraints: What limitations or boundaries apply? (e.g., “Keep the response under 500 words. Focus only on…”)
# Weak prompt:
"Write a follow-up email"
# Strong prompt:
"You write client emails for a plumbing company. Draft a
follow-up to a client who received our quote ten days ago
and has gone quiet.
- Mention the quote date and the job (bathroom refit)
- Friendly, no pressure, one question at the end
- Under 120 words, no exclamation marks"Check yourself
Which element of a prompt helps prevent overly long or off-topic responses?
Iterative Refinement and Evaluation
Great prompts rarely emerge fully formed. The best prompt engineers iterate: write a prompt, test it, analyze the output, and refine. This cycle of improvement is where the real skill lies.
- Start simple: Begin with a basic prompt that captures your core intent
- Test it: Run the prompt and carefully read the output
- Identify gaps: What’s missing? What’s wrong? What’s unnecessary?
- Add specificity: Address each gap with more precise instructions
- Test variations: Try different phrasings, structures, and frameworks
- Evaluate consistently: Use the same test cases to compare prompt versions
The 80/20 Rule of Prompting
You’ll often get 80% of the way with a basic prompt. The last 20% — getting the output exactly right — is where frameworks, XML tags, examples, and constraints become essential.
Check yourself
What’s the most effective way to improve a prompt that’s giving mediocre results?
Responsible AI Use