Nearby lessons
3 of 49Prompt Engineering - The Prompt Formula
The Prompt Formula
The prompt formula is a structured way of writing any prompt. It has five parts and gives you clear direction plus full control over AI's output:
| Part | What it means | Example |
|---|---|---|
| Role | Who AI should act like | Act as a teacher, HR, interviewer... |
| Task | What AI should do | Explain, write, list, compare... |
| Context | Background information / for whom | for beginners, for freshers, for my manager... |
| Constraints | Rules / limits | no jokes, 5 bullet points, polite and short... |
| Output format | How the answer should look | table, bullet points, email, 100 words... |
In simple words: The prompt formula is the heart of prompt engineering. Role gives direction, context gives clarity, constraints control behavior, and output format gives shape.
The tailor example shows why structure matters:
- "Stitch shirt" → creates confusion.
- "Stitch a white cotton shirt, full sleeve, size 40, office use" → gives the tailor everything needed.
Same tailor — the structured instruction made the difference.
The Escalation Ladder — One Prompt, Six Levels
Here is one prompt evolving level by level. Each step adds one part of the formula — Role, Task, Context, Constraints, Output format — and the output becomes more predictable with every level.
- STEP 1 → 2: +Role gives direction.
- STEP 2 → 3: +Task says what to do.
- STEP 3 → 4: +Context adds who it is for.
- STEP 4 → 5: +Constraints add rules.
- STEP 5 → 6: +Format locks the shape of the answer.
Trainer's Note: Step 1 is a casual question; Step 6 is a complete instruction. Each small addition moved the output from random to professional. This is the difference between a casual user and a prompt engineer — the casual user types once, the engineer builds the prompt step by step.
Example02
Prompt Formula in Action — Interviewer Example
One more example for interview practice:
Trainer's Note: You do not need to write the words ROLE / TASK / CONTEXT in your prompt. Just include the idea behind each part and AI automatically understands the structure.
Example03
Without Formula vs With Formula
| Without Formula | With Formula |
|---|---|
| Random output | Structured output |
| Less clarity | High clarity |
| Less control | Full control |
| General answers | Targeted answers |
| Wastes time | Saves time |
Real-World Use Cases
- Student — notes, explanations, study plans with a clear role and format.
- Employee — emails, reports, task planning with constraints.
- Business — marketing content, captions, ideas with a defined output format.
📝 Key Takeaways
- Prompt clarity = specific + complete.
- Vague or incomplete prompts make AI guess; complete prompts give strong output.
- The prompt formula has 5 parts: Role, Task, Context, Constraints, Output format.
- Build prompts level by level — each level adds one part of the formula.
- Role gives direction, context gives clarity, constraints give control.
- The tailor example: a structured instruction gives a perfect result.
- Apply the formula to every prompt and AI output becomes professional.
🧠 Test Your Knowledge
5 QuestionsProgress: 0 / 5