Prompt Engineering
Prompt Engineering Basics
Learn the five elements of a strong AI prompt — task, context, format, examples, and constraints — with before-and-after examples.
Tutorial overview
What you will learn
- Name the five core elements of a strong prompt
- Turn a vague request into a specific one
- Diagnose which element a weak prompt is missing
By the end, you will have
- A reusable five-element checklist for writing prompts
Introduction
A prompt is the instruction you give an AI assistant, and the quality of that instruction largely decides the quality of the answer. Strong prompts share five elements: a clear task, useful context, a stated format, examples when helpful, and constraints. This lesson teaches all five, with weak and strong versions of the same prompt so you can see the difference.
What you will build or practice
You will rewrite a vague prompt into a specific one using the five elements, and you will finish with a checklist you can apply to any request you make of chat assistants like ChatGPT, Claude, or Gemini.
Before you begin
You need access to any AI chat assistant and a place to save prompts you like. If AI tools are new to you, skim AI Basics first.
Key concept
Think of a prompt as a work request. If you asked a colleague to "write something about our product," you would get an unpredictable result. If you named the audience, the goal, the length, and the tone, you would get something usable. AI assistants respond the same way: the five elements are simply the parts of a complete request.
Step 1: State the task clearly
The task is the action you want: summarize, rewrite, compare, list, draft, explain. Put it first and make it concrete.
Weak: Help me with my resume.
Strong: Rewrite the three bullet points below so each one starts with an action verb.
Step 2: Add context
Context is the background the assistant cannot guess: who you are, who the audience is, what the material is for.
Weak: Explain machine learning.
Strong: Explain machine learning to a retail manager with no technical
background who wants to know how it could help with inventory.
Step 3: Specify format and constraints
Say what the output should look like (a list, a table of contents, a paragraph, an email) and set limits: length, tone, what to avoid.
Strong: Give me 5 bullet points, each under 15 words, in a friendly
but professional tone. Do not use jargon.
Step 4: Show an example when the format is unusual
If you want a specific style, showing one sample beats describing it.
Rewrite each product name in this pattern:
Old: "Standing Desk Mk2" becomes New: "Mk2 | Standing Desk | Adjustable"
Now do the same for the list below.
Practice exercise
Take this weak prompt: "Give me ideas for my presentation." Rewrite it using all five elements: name the task, add your audience and topic, request a format, include one example of an idea you like, and add a constraint such as a time limit. Run both versions in an assistant and compare the results.
Common mistakes
- Burying the task in the middle of a long message instead of stating it first.
- Assuming the assistant knows your audience, goal, or situation.
- Asking for "good" output instead of naming length, tone, and structure.
- Stacking several unrelated tasks into one prompt.
Check your understanding
- What are the five elements of a strong prompt?
- Why does "Explain machine learning to a retail manager" beat "Explain machine learning"?
- When is including an example most useful?
Key takeaways
- A prompt is a work request; complete requests get better results.
- Task, context, format, examples, and constraints cover most of what a prompt needs.
- The fastest fix for a bad answer is usually adding the missing element, not starting over.
Next steps
Practice the full write-test-refine loop in Prompt Engineering, or learn a memorable structure in The CLEAR Prompt Framework.
Related resources
Newsletter or next lesson
Join the newsletter for a clear weekly lesson, or continue to the next tutorial in the AI Beginner Roadmap.