Week 2 • Lesson 1 of 6 • 65 mins
Advanced Prompting: Chaining & Roleplay
Chain-of-Thought, Prompt Chaining, and sophisticated Role-play for expert results.
Beyond the Basics: Advanced Prompt Engineering
If Week 1 was learning to drive, this is learning to race. The techniques in this lesson separate casual AI users from professionals who consistently get exceptional results.
1. Chain-of-Thought (CoT) - Making AI Think Out Loud
What it actually is: Chain-of-Thought is forcing the AI to show its reasoning process before giving you the final answer. Instead of jumping straight to a conclusion, it walks through the logic step-by-step.
Why this is a game-changer: When AI "thinks out loud," it catches its own errors. It's like the difference between a student blurting out an answer versus showing their work on a math problem. The act of articulating reasoning reduces mistakes dramatically.
The research: Studies show CoT can improve accuracy by 30-50% on complex reasoning tasks. This isn't marginal - it's transformative.
How to trigger it:
Basic CoT:
Before answering, think through this step - by - step:
1. What is the core question?
2. What information do we have?
3. What assumptions are we making?
4. What's the logical path to an answer?
5. What could go wrong with this reasoning?
Then give me your final answer.
Advanced CoT (Claude-specific):
Use<thinking> tags to work through this problem step- by - step.
Show your reasoning inside the tags, then give me the final answer outside the tags.
This way I can see your work if I need to, but get a clean answer by default.
Real example - comparing approaches:
Without CoT (direct prompt):
User: "If a train leaves Mumbai at 10 AM traveling 120 km/h, and another leaves Delhi at 11 AM traveling 100 km/h toward Mumbai, and they're 1400 km apart, when do they meet?"
AI: "They meet at approximately 3:40 PM."
[May be wrong, no way to verify the logic]
With CoT:
User: "Think through this step-by-step before answering: If a train leaves Mumbai at 10 AM traveling 120 km/h, and another leaves Delhi at 11 AM traveling 100 km/h toward Mumbai, and they're 1400 km apart, when do they meet?"
AI: "Let me work through this systematically:
1. Initial setup:
- Train A: Leaves Mumbai at 10 AM, speed = 120 km / h
- Train B: Leaves Delhi at 11 AM, speed = 100 km / h
- Initial distance = 1400 km
2. Distance covered before Train B starts:
- Train A travels for 1 hour alone(10 - 11 AM)
- Distance covered = 120 km
- Remaining distance when both moving = 1400 - 120 = 1280 km
3. Combined approach rate:
- Both trains moving toward each other
- Combined speed = 120 + 100 = 220 km / h
4. Time to meet after Train B starts:
- Time = 1280 km ÷ 220 km / h = 5.82 hours
- Converting: 5 hours 49 minutes
5. Final answer:
- Meeting time = 11 AM + 5h 49m = 4: 49 PM"
[Now you can verify each step and trust the answer]
When to use CoT:
- Mathematical calculations
- Logic puzzles
- Complex analysis with multiple factors
- When you need to verify reasoning
- High-stakes decisions where errors are costly
When NOT to use CoT:
- Simple factual queries ("What's the capital of France?")
- Creative writing (it kills the flow)
- Brainstorming (analysis paralysis)
- When you're in a hurry and accuracy isn't critical
2. Prompt Chaining - The Assembly Line Approach
What it is: Instead of one massive prompt trying to do everything, you break the work into a sequence of smaller, focused prompts. Each step uses the output from the previous step.
Why it works:
- Each step is simpler and more reliable
- You can verify intermediate results
- You can reuse components
- You maintain better quality control
- Context stays focused on the current task
The mental model: Think of it like cooking. You don't do everything at once - you prep ingredients (step 1), cook components separately (steps 2-3), then combine (step 4). Same principle.
Basic 3-step chain example:
Task: Create a comprehensive blog post from a YouTube video
Step 1: Extract and Structure
[Upload or paste YouTube transcript]
"Analyze this transcript. Give me:
1. The main thesis in one sentence
2. 5 - 7 key points discussed
3. Any data, statistics, or specific examples mentioned
4. The speaker's conclusion
Format as a structured list."
Output: Clean, organized summary
Step 2: Develop Outline
"Based on this summary [paste Step 1 output], create a blog post outline:
- Compelling headline(2 - 3 options)
- Hook introduction(problem / question to draw readers in)
- 5 main sections covering each key point
- Conclusion with call - to - action
For each section, note: what point it makes, what example to use, what the reader should take away."
Output: Detailed outline
Step 3: Write the Post
"Write the blog post following this outline [paste Step 2 output].
Constraints:
- 1200 - 1500 words
- Conversational tone(write like you're explaining to a colleague)
- Include the specific examples from the transcript
- Each section starts with a subheader
- End with 3 concrete action steps
[Add any other voice / style requirements]"
Output: Full draft
Why this beats a single prompt:
- If Step 1 misses something, you fix it before building on it
- You can use the summary (Step 1) for other purposes (social posts, email newsletter)
- You can swap out Step 3 (maybe write it as a Twitter thread instead)
- Each step is manageable and checkable
Advanced chaining patterns:
The Iterative Refinement Chain:
Step 1: "Draft a product description for [product]"
Step 2: "Critique this description. What's weak? What's missing?"
Step 3: "Rewrite addressing those issues"
Step 4: "Now make it 30% more concise without losing key points"
The Multi-Perspective Chain:
Step 1: "Analyze this problem from a business perspective"
Step 2: "Now analyze it from a customer perspective"
Step 3: "Now from a technical feasibility perspective"
Step 4: "Synthesize all three perspectives into a recommendation"
The Research Synthesis Chain:
Step 1: "Research topic X using web search, give me 10 key findings with sources"
Step 2: "Identify contradictions or disagreements in these findings"
Step 3: "What's the consensus view? What's debated?"
Step 4: "Write an executive summary that presents both sides fairly"
Common chaining mistakes:
Mistake 1: Chains that are too long If you're going beyond 5-6 steps, you're probably overcomplicating it. Collapse some steps or reconsider your approach.
Mistake 2: Not verifying intermediate steps The whole point is to catch issues early. If you blindly chain without checking, you might amplify an early error through the whole sequence.
Mistake 3: Losing context between chains Each new prompt should explicitly reference what came before: "Based on the analysis above [paste]..." not just "Next, do X" (AI might forget what "next" means)
Mistake 4: Breaking the chain at random points Plan your chain before starting. Know what each step produces and why you need it.
3. Sophisticated Roleplay - Creating Expert Personas
Basic roleplay: "You are a chef." Sophisticated roleplay: Creating a complete character with background, constraints, and behavioral patterns.
Why roles matter: AI models are trained on text from every domain. When you assign a specific role, you're activating the neural pathways associated with that expertise. A "senior software architect" will write differently than a "junior developer" because the training data from those two groups has different patterns.
The anatomy of a sophisticated role:
Level 1 - Basic role:
"You are a marketing manager."
Result: Generic, could be anyone
Level 2 - Specific role:
"You are a B2B SaaS marketing manager with 8 years of experience."
Result: Better, but still broad
Level 3 - Role with context:
"You are a B2B SaaS marketing manager with 8 years of experience, currently at a Series B startup. You're responsible for a $2M annual marketing budget and a team of 5. Your background is in content marketing, and you've successfully launched 12 product features to market."
Result: Starting to feel real
Level 4 - Role with personality and constraints:
"You are Sarah Chen, VP of Marketing at a B2B fintech SaaS company. Background:
- 12 years in tech marketing, started in content, moved into leadership
- Data - driven but not dogmatic - you value intuition informed by metrics
- Direct communication style - you hate corporate jargon
- Your superpower is positioning complex products simply
- You're skeptical of trends but excited about AI (because you've tested it)
- You manage a $5M budget and answer to a demanding CEO who asks 'why' three times
Current challenge: Launching a product in a crowded market against competitors with 10x your budget.
Constraints:
- Can't outspend competitors
- Need to show ROI within 90 days
- Team is junior and needs guidance, not micromanagement"
Result: This person has opinions, biases, pressure, strengths
When to use sophisticated roles:
Use Case 1: Getting realistic advice
[Sophisticated role of experienced founder]
"We're deciding between launching in India or Southeast Asia first. Walk me through how you'd make this decision. Be specific about what data you'd look at and what tradeoffs you'd consider."
The detailed role will give you advice that considers real-world constraints, not textbook theory.
Use Case 2: Simulating difficult conversations
[Role: Skeptical enterprise buyer]
"I'm about to pitch you our product. I'll give you the pitch, and you respond as a skeptical buyer who:
- Has been burned by overpromising vendors
- Has budget authority but needs to justify to their boss
- Is currently using a competitor
- Is risk - averse
Be realistic - ask tough questions, raise objections, don't be easily convinced."
Practice your pitch against this AI skeptic. It'll expose weaknesses.
Use Case 3: Expert review and critique
[Role: Senior editor at a top tech publication - 20 years experience, has seen every writing cliché, values clarity and originality]
"Review this article draft. Be brutally honest. What's weak? What's cliché? Where did I lose you? What would you cut? What needs more support?
Don't be polite - I need this to be excellent."
A well-defined critical role will give you tougher feedback than a generic "review this" prompt.
Building composite roles (multiple perspectives in one):
Sometimes you want a role that combines unusual perspectives:
"You are a hybrid expert:
- 60 % data scientist(PhD in statistics, loves Python and R)
- 30 % marketing strategist(understands positioning and messaging)
- 10 % skeptical philosopher(questions assumptions, looks for logical flaws)
This combination means you can:
- Analyze data rigorously
- Translate findings into business recommendations
- Challenge whether we're solving the right problem
Use this combined perspective to analyze[topic]."
This creates a unique viewpoint you won't get from a standard role.
Role consistency tricks:
Name the persona: "You are Dr. Rajesh Kumar" is more concrete than "You are a doctor." Names make AI maintain character better.
Use first person in the role: Instead of "You are an expert who..." try "I am an expert with 15 years experience in..." This sometimes improves response quality.
Include specific speech patterns: "I prefer short sentences. I use analogies from sports. I don't hedge - if I don't know something, I say so directly."
Add constraints that create realism: "You're under time pressure - you need to make a decision by Friday." "You have a $50k budget, not a penny more." "You're explaining this to a non-technical CEO."
These constraints force the AI to think practically, not theoretically.
4. Metacognitive Prompting - Teaching AI to Question Itself
What it is: Asking the AI to critique, evaluate, or improve its own output. You're making it wear two hats: creator and critic.
Why it works: AI is good at pattern recognition. When it switches to "critic mode," it spots issues it overlooked in "creator mode." It's like having a second pair of eyes - that happen to be the same AI.
Basic pattern:
1. Create something
2. Critique it
3. Revise based on critique
Example 1: Self-improving writing
"Write a sales email for a project management tool targeting small creative agencies.
Then, analyze that email from three perspectives:
1. A skeptical buyer who has seen 100 sales emails this week
2. A writing expert who cares about clarity and persuasion
3. A spam filter looking for red flags
Finally, rewrite the email addressing the issues all three perspectives identified."
The AI will:
- Write initial draft
- Identify issues (probably: generic claims, no personalization, weak call-to-action)
- Rewrite with those fixes
Example 2: Multi-round refinement
"Write a blog post about [topic].
[AI writes post]
Now be a harsh editor.What are the 3 weakest points in this post ? Where did the argument fall apart ? What examples felt forced ?
[AI critiques]
Rewrite those 3 sections to address those issues.
[AI revises]
Now, is this post differentiated enough from what's already out there? What's the one unique insight or angle we're bringing?
[AI evaluates differentiation]
If the unique angle isn't strong enough, pivot the entire post to emphasize what IS unique."
This multi-round process produces dramatically better output than a single prompt.
Advanced metacognitive patterns:
The Devil's Advocate:
"Write an argument for [position].
Now argue against it as convincingly as you can.Find the weakest points and attack them.
Then, strengthen the original argument to withstand those attacks."
The Assumption Auditor:
"Here's my analysis: [paste your work]
What assumptions am I making ? List them explicitly.
Which of these assumptions are most likely to be wrong ?
How would the analysis change if those assumptions were wrong ? "
The Simplicity Test:
"Explain [complex topic].
Now, explain it to a smart 12 - year - old.Where do you get stuck ? What parts can't be simplified without losing accuracy?
Those stuck points are probably where MY understanding is weakest.Explain those parts in more depth."
The Audience Mismatch Detector:
"This content is for [target audience].
Read it as if you're [different audience - like a different profession, age group, or expertise level].
What parts would confuse them ? What would seem obvious to them ? What would offend them ?
Adjust the content to work for BOTH audiences."
5. Combining Techniques - The Master Prompt
When you combine CoT + Chaining + Roleplay + Metacognition, you get extraordinarily high-quality output.
Example: Comprehensive competitive analysis
Prompt:
[ROLE]
You are a senior competitive intelligence analyst who has worked at McKinsey and three unicorn startups.You combine rigorous research with practical business insight.
[CHAIN STEP 1 - RESEARCH]
Research our top 3 competitors in [industry].For each, identify:
- Core product offering
- Pricing model
- Target customer
- Key differentiators
- Recent funding / news
- Apparent strategy
Use chain - of - thought to work through your research process.
[CHAIN STEP 2 - ANALYSIS]
Based on that research, analyze:
- What are they doing that's working?
- Where are the gaps in the market ?
- Where are they vulnerable ?
[CHAIN STEP 3 - METACOGNITIVE CRITIQUE]
Challenge your own analysis:
- What might you be missing ?
- What assumptions are you making about their strategy ?
- What could disrupt this entire market analysis ?
[CHAIN STEP 4 - RECOMMENDATIONS]
Given everything above, what are 3 specific strategic moves we should consider ?
- Why each move exploits a competitor weakness or market gap
- What resources we'd need
- What the risks are
This single comprehensive prompt orchestrates multiple advanced techniques to produce analyst-grade output.
6. Common Advanced Prompting Mistakes
Mistake #1: The Wall of Text Giving the AI 5 different instructions in one paragraph.
Bad:
"Write a blog post about productivity and make it conversational but also include some statistics and make sure it's SEO optimized and don't use buzzwords and keep it under 1000 words and include a story at the beginning."
Good:
TASK: Write a blog post about productivity
REQUIREMENTS:
- 800 - 1000 words
- Conversational tone(like talking to a colleague)
- Include 2 - 3 relevant statistics with sources
- SEO optimized for keyword: "productivity tips for remote workers"
- Open with a relatable 2 - paragraph story
AVOID:
- Buzzwords: "synergy", "leverage", etc.
- Generic advice: "wake up early", "exercise"
Use formatting. Make it scannable.
Mistake #2: Ignoring the Persona If you don't assign a persona, you get "Helpful AI Assistant" - which is usually generic and bland.
Every complex task benefits from a specific role.
Mistake #3: Not iterating Accepting first output as final. The pros iterate 2-5 times on important work.
Mistake #4: Chaining without verification Running a 5-step chain without checking intermediate steps. One early error cascades into garbage.
Mistake #5: Over-constraining creativity Giving so many rules that the AI has no room to surprise you.
Sometimes: "Here's the goal, here are the boundaries, now surprise me with how you achieve it."
Mistake #6: Under-constraining accuracy Letting the AI be creative when you need precise, factual output.
Know when to lock it down (technical writing, data analysis) vs. let it explore (brainstorming, creative writing).
7. Practical Exercise Framework
Here's how to practice these techniques:
Week 1 practice:
- Pick one technique (CoT, chaining, or roleplay)
- Use it for every AI interaction this week
- Document: What worked? What didn't? How did output quality change?
Week 2 practice:
- Combine two techniques
- Compare combined vs. single technique on the same task
Week 3 practice:
- Build a "master prompt" for a task you do regularly
- Include role + constraints + chain steps
- Refine it based on results
- Save it as a template
What's Next:
You can now orchestrate AI to think deeply, work in sequences, and embody expert perspectives. But we've been living in a text-only world.
Next lesson: Multimodal AI. Images, voice, video. The complete creative studio.
Resources & Downloads
Hands-on Practicals
Write a LinkedIn post about a topic you know well. Then use metacognitive prompting: 'Act as a skeptical reader who works in this field. What in this post feels like AI-generated fluff? What claims lack evidence? What's actually insightful?' Use that brutal feedback to rewrite. Compare the before/after. Most people find the second version is 3x better because the critique forces specificity and substance.
Find a 10-minute YouTube video on a topic relevant to your work. Chain these steps: (1) Get transcript summary with key points, (2) Extract 5 most important takeaways as bullet points, (3) Transform those into a Twitter/X thread with one tweet per takeaway plus intro and conclusion, (4) Expand the thread into a LinkedIn carousel post with one slide per point. Document how the content transforms at each step and which steps added the most value.
Create a sophisticated role persona for your specific domain - give them a name, background, expertise, personality, and current challenges. Then ask them to review a piece of your work (a proposal, strategy document, piece of content). Compare this feedback to what you'd get from a generic 'review this' prompt. The specific persona should give you domain-appropriate advice that a generalist would miss.
Pick a complex problem you're actually facing. Ask the AI to solve it twice: Once with a direct prompt, once with explicit CoT ('think through this step-by-step before answering'). Compare: (1) Which answer do you trust more? (2) Which reasoning can you verify? (3) Did CoT expose any flaws in the direct answer? Track this for 5 different problems to internalize when CoT adds value.
Knowledge Check
Why does 'Chain-of-Thought' prompting improve accuracy on complex reasoning tasks?
What is the primary benefit of prompt chaining over a single complex prompt?
How does sophisticated roleplay differ from basic roleplay in prompt engineering?
What is metacognitive prompting and when is it most valuable?