Prompt Engineering Fundamentals (The Only Framework You Need)
Learn the 5 primitives of a great prompt, when to use zero-shot vs few-shot vs chain-of-thought, and a copy-paste template that works on any LLM.
Nirmal Rabari
AI Trainer · Cyber Security Educator
Prompt engineering isn't a hack — it's the user interface of every LLM. Once you understand the five primitives below, you can write prompts for any model (ChatGPT, Claude, Gemini, Llama) without memorizing tricks.
The 5 primitives of a great prompt
- Role — who the model should be.
- Context — what it needs to know.
- Task — the one outcome.
- Format — the shape of the answer.
- Constraints — what to avoid, limits, tone.
Zero-shot vs few-shot vs chain-of-thought
Zero-shot: just ask. Works for easy, common tasks.
Few-shot: include 2–4 examples of input → output. Best for tone matching, classification, structured extraction.
Chain-of-thought: ask the model to reason step by step before answering. Best for math, planning, and multi-step decisions.
The cheat sheet
- "Act as…" sets role.
- "Think step by step" unlocks reasoning.
- "Return as a markdown table with columns X, Y, Z" forces structure.
- "Before answering, ask me clarifying questions" prevents bad answers.
- "Critique your own answer, then improve it" doubles quality on hard tasks.
- "Be concise. No filler." beats most "be brief" phrasings.
A template you can steal
# Role
You are {role with seniority}.
# Context
- Audience: {who}
- Background: {what they need to know}
- Why this matters: {goal}
# Task
{one sentence, one outcome}
# Format
{shape — bullets, table, JSON schema, 200-word email…}
# Constraints
- {tone}
- {what to avoid}
- {length}
# Examples (optional)
Input: …
Output: …How to debug a bad answer
- Did you give a role? Add one.
- Did you give an example? Add one.
- Did you tell it what not to do? Add the anti-pattern.
- Is the task multi-step? Ask for a plan first, then execution.
- Is it hallucinating? Lower the scope ("only use the text I pasted").
Prompt engineering is just clear thinking, written down. If you can brief a junior teammate, you can prompt an LLM. The teams that win are the ones who write their best prompts down, version them, and reuse them — turning prompts into internal software.
Want this delivered live to your team?
I run corporate AI workshops, college sessions and executive briefings across India, the UAE, the UK and the US. Get a tailored agenda for your team.
Book a training session