Difficulty: Advanced · Estimated time: 20 min
What You'll Learn
How to engineer prompts systematically rather than by trial and error: using constraints and few-shot examples, decomposing complex tasks into sub-steps, forcing structured output, and running a proper evaluate-and-iterate loop.
Why This Matters
By this point in the roadmap, your prompts aren't throwaway questions — they're components inside workflows, agents, and client deliverables. A prompt that works "most of the time" isn't good enough when it's running unsupervised or feeding another system. Advanced prompt engineering is what turns a prompt from a one-off request into a reliable, repeatable instrument.
The Concept
Four techniques do most of the heavy lifting at this level:
None of this works without the fifth piece: evaluation. Treat a prompt like a draft, not a finished product — run it against several real inputs, judge the results against criteria you set in advance, and change one variable at a time between iterations so you know what actually improved things.
For deeper official guidance, see Anthropic's prompt engineering docs: docs.claude.com/en/docs/build-with-claude/prompt-engineering/overview.
Step-by-Step
Example
A client wants a weekly "top 3 content wins" summary pulled from scattered notes. Version one just asks for "a summary of this week's wins" — results vary wildly in length and focus. Version two adds constraints (max 150 words, three bullet points, no fluff openers), two few-shot examples of the exact bullet format wanted, and a fixed output schema (Win, Why it worked, Next action per bullet). Tested against four different weeks of notes, version two produces a consistent, ready-to-send summary every time — version one needed manual editing on three out of four.
Try This
Take a prompt you already use regularly for client or content work. Add two few-shot examples and a strict output schema to it. Run both the old and new version against the same three real inputs and compare — specifically, note where the new version removed a piece of manual clean-up you used to do by hand.
Copy This
You are [ROLE/EXPERTISE].
CONTEXT:
[RELEVANT BACKGROUND, DATA, OR SOURCE MATERIAL]
TASK:
[WHAT TO DO, BROKEN INTO NUMBERED STEPS IF MULTI-STAGE]
1. [SUB-STEP 1]
2. [SUB-STEP 2]
3. [SUB-STEP 3]
CONSTRAINTS:
- Tone: [TONE]
- Length: [LENGTH LIMIT]
- Exclude: [WHAT NOT TO DO OR INCLUDE]
EXAMPLES:
Input: [EXAMPLE INPUT 1]
Output: [EXAMPLE OUTPUT 1]
Input: [EXAMPLE INPUT 2 — INCLUDE AN EDGE CASE]
Output: [EXAMPLE OUTPUT 2]
OUTPUT FORMAT:
[EXACT SCHEMA OR TEMPLATE, e.g. JSON KEYS OR HEADING STRUCTURE]Common Mistakes
Level-Up Tip
Keep a lightweight "prompt changelog" for anything you reuse often — one line per version noting what changed and what effect it had. Six months from now, when a prompt stops working as well on new inputs, you'll be able to see exactly what you tried before and avoid re-testing dead ends.
Action Checklist
Next Guide
27 — Research Like an Analyst, Not a Search Engine
Premium Content
Levels 2–6 require a mygyaan membership to access the full guides.
₹1,000/month — full mygyaan.ai access (all modules)
₹3,000 one-time — this course only
