+91 91045 23399
Nirmal Rabari - AI Trainer in IndiaNirmal Rabari
All articles
FundamentalsFebruary 2, 20265 min read

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.

NR

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

  1. Role - who the model should be.
  2. Context - what it needs to know.
  3. Task - the one outcome.
  4. Format - the shape of the answer.
  5. 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

  1. Did you give a role? Add one.
  2. Did you give an example? Add one.
  3. Did you tell it what not to do? Add the anti-pattern.
  4. Is the task multi-step? Ask for a plan first, then execution.
  5. 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.

#Prompt Engineering#LLM#Fundamentals

Was this guide helpful?

Share this guide:
Talk to Nirmal

Want this delivered live to your team - or learn it yourself?

Corporate workshops, college sessions and individual training across India, the UAE, the UK and the US. Call or WhatsApp for dates and pricing.

Keep reading

Call nowBook call