2.1 Anatomy of a Good Prompt
Five-part framework: (1) ROLE — who the AI should be, (2) CONTEXT — background information, (3) TASK — what to do, (4) FORMAT — how to structure output, (5) CONSTRAINTS — what NOT to do. Bad: "Write about marketing." Good: "You are a senior digital marketing strategist. A D2C skincare brand with ₹5L/month budget wants to increase Instagram engagement by 30% in 3 months. Create a monthly content calendar as a table. Keep budget-conscious."
2.2 Zero-Shot Prompting
Give the task with no examples. Works for unambiguous tasks: "Translate to Hindi: [text]", "Summarise in 3 bullets: [email]", "Classify as positive/negative/neutral: [review]." Zero-shot is the DEFAULT — always try it first. If results are inconsistent or wrong, escalate to few-shot. Most simple tasks work perfectly with zero-shot.
2.3 Few-Shot Prompting
Provide 3–5 examples of input → desired output BEFORE the actual task. The model learns the PATTERN from examples. Critical for: custom categories, specific output formats, domain-specific terminology. "Classify tickets. Examples: 'Payment failed' → billing. 'App crashes' → technical. 'How to export?' → feature. Now classify: 'Charged twice' → ?" The model infers the classification pattern from your examples.
2.4 Chain-of-Thought (CoT)
"Think step by step" — forces the model to show reasoning BEFORE the answer. Dramatically improves math, logic, and multi-step problems. Without CoT: "17 × 24?" → often wrong. With CoT: "17 × 24? Think step by step." → "17×20=340, 17×4=68, 340+68=408" → correct. Use for: analysis, debugging, calculations, comparisons, decision-making. Five words that transform AI accuracy.
2.5 Role-Based / Persona Prompting
"You are a [specific expert with specific experience]." Changes vocabulary, depth, and perspective. "You are a tax accountant specialising in Indian startups under ₹10Cr revenue" gives VERY different advice from "You are a financial advisor." The more specific the role, the more targeted the output. Stack context: "...with 10 years at a fintech company, familiar with RBI guidelines."
2.6 System Prompts & Instruction Hierarchy
System prompt: persistent instructions framing ALL responses. User prompt: the specific request. System prompts define: persona, output format, constraints, knowledge boundaries. Example: "You are a customer support agent for Acme Corp. Only answer Acme product questions. If asked about competitors, say 'I can only help with Acme.' Always include a ticket number." System prompts = the personality and rules the AI follows.
2.7 Output Format Control
Force specific formats: "Respond in JSON with keys: summary, sentiment, confidence." "Create a markdown table: Feature, Pros, Cons." "Write exactly 3 bullets, each under 20 words." "Respond ONLY with the answer, no explanation." Format control turns unpredictable AI into structured, parseable data. Essential for automation — without format control, AI output is useful to humans but useless to programs.
2.8 Prompt Chaining: Multi-Step Tasks
Complex tasks ≠ one giant prompt. Break into steps: (1) "Summarise this document" → (2) "Extract key risks from this summary" → (3) "Suggest mitigation for each risk" → (4) "Format as a table." Each step's output feeds the next. Chaining = multi-step reasoning without overloading a single prompt. Works better than one prompt trying to do everything at once.
2.9 Negative Prompting & Guardrails
Tell the model what NOT to do: "Do NOT include disclaimers." "Do NOT use bullet points — write in paragraphs." "Do NOT mention competitors." "If unsure, say 'I don't have enough information' instead of guessing." Negative constraints prevent common AI failure modes: unnecessary caveats, wrong format, hallucinated facts. What you EXCLUDE is as important as what you INCLUDE.
2.10 Prompt Templates & Libraries
Build reusable templates: [CODE_REVIEW], [MEETING_NOTES], [EMAIL_DRAFT]. Variables: "You are a {role}. Industry: {industry}. Language: {language}." Templates save time and ensure consistency across a team. Individual prompt engineering doesn't scale — shared template libraries do. Organisations should maintain team-wide prompt repositories like they maintain code libraries.
Exercise: Take one task ("analyse this customer review") and write it using zero-shot → few-shot → CoT → role-based prompts. Compare output quality across all four techniques. Build a reusable template with 3 variables. Test negative prompting by adding and removing constraints.