Prompt engineering
Get the answer you want, the first time
You already know how to chat with AI. Now you'll learn to write prompts that get great answers on purpose, not by luck.
What is prompt engineering?
Imagine ordering a cake. If you say "make me a cake", you might get anything. If you say "a small chocolate cake for 6 people, no nuts, ready Friday", you get what you need.
Prompt engineering is the same idea. It means writing your request so the AI knows exactly what to do. You don't need any code. You only need clear words.
The 5-part framework
Most great prompts have the same five parts. You won't always need all five, but checking each one makes your prompts much stronger.
- Role — who the AI should act as ("You are a friendly study coach").
- Context — the background it needs ("I'm a beginner with exams in 3 weeks").
- Task — the exact job, with a clear verb ("Create a study plan").
- Constraints — the limits ("Max 2 hours per day, weekends off").
- Output — the shape of the answer ("Show it as a table").
Here is a prompt that uses all five parts:
You are a friendly study coach for beginners.
I have a biology exam in 3 weeks and I'm behind on 4 chapters.
Create a day-by-day study plan for me.
Keep it to 2 hours per day and leave Sundays free.
Show the plan as a table with columns: Day, Chapter, Activity, Time.What you'll learn
How to use this section
The first two pages cover the 5-part framework. The next four cover advanced skills you'll use every day when building apps. I recommend going in order. Every page follows the same format:
- What is it? — A simple explanation with an everyday example
- See it in action — Prompts you can copy and try
- Common mistakes — Weak prompts next to better ones
- Practice — A few quick questions to check your understanding
Practice
Try these exercises to lock in what you just learned.
What's next?
Let's start with the first two parts of every strong prompt: giving the AI a role and the right context.