🎯 Lesson Objectives
By the end of this lesson, you will:
- Understand why assigning roles dramatically improves AI output
- Know the four categories of roles and when to use each
- Master role stacking for complex tasks
- Have ready-to-use role templates for common scenarios
📖 The Power of Roles
Here's something fascinating: the same question asked with different roles produces completely different answers.
Why Roles Work
When you assign a role, AI:
- Adjusts vocabulary — Uses appropriate terminology
- Changes depth — More or less technical as needed
- Shifts perspective — Teacher explains, expert delivers
- Matches expectations — Professional output for professional roles
🔬 Same Question, Different Roles
Question: "How do I center a div in CSS?"
The role completely changes the response style and usefulness!
📚 The Four Role Categories
1. 🎓 Expertise Roles
Purpose: Get professional-quality output with best practices
| Role | Best For |
|---|---|
| "Senior frontend developer" | Web development tasks |
| "Python expert" | Python-specific coding |
| "Database architect" | Database design questions |
| "Security specialist" | Security-related code |
| "DevOps engineer" | Deployment, infrastructure |
Example:
You are a senior React developer with 10 years of experience.
Create a reusable button component with TypeScript.
2. 👨🏫 Teaching Roles
Purpose: Get clear explanations and learning-focused responses
| Role | Best For |
|---|---|
| "Patient coding teacher" | Learning new concepts |
| "Tutor explaining to a 10-year-old" | Very simple explanations |
| "Bootcamp instructor" | Practical, hands-on guidance |
| "College professor" | Thorough, academic explanations |
Example:
You are a patient coding teacher who uses simple analogies.
Explain what an API is to someone who has never programmed.
3. 🔍 Quality Roles
Purpose: Improve code quality and catch issues
| Role | Best For |
|---|---|
| "Code reviewer" | Finding bugs, improving code |
| "UX designer who codes" | User-friendly interfaces |
| "Performance expert" | Making code faster |
| "Clean code advocate" | Readable, maintainable code |
Example:
You are a code reviewer focused on best practices.
Review this code and suggest improvements:
[code]
4. 🎨 Style Roles
Purpose: Get specific tone, approach, or aesthetic
| Role | Best For |
|---|---|
| "Minimalist developer" | Simple, no-frills code |
| "Creative web designer" | Visually interesting designs |
| "Practical engineer" | No-nonsense, working solutions |
| "Encouraging mentor" | Motivation and confidence |
Example:
You are a minimalist developer who values simplicity.
Create the simplest possible navigation bar using only HTML and CSS.
🎭 Role Decision Guide
Use this table to choose the right role:
| If You Need... | Use This Role |
|---|---|
| Code that works | "Senior [language] developer" |
| Understanding a concept | "Patient teacher" |
| Better code | "Code reviewer" |
| Nice-looking design | "UX designer who codes" |
| Simple solution | "Minimalist developer" |
| Fast code | "Performance expert" |
| Secure code | "Security specialist" |
| Learning explanation | "Tutor for beginners" |
🔗 Advanced: Role Stacking
For complex tasks, combine multiple roles:
Role Stacking
Formula: "You are a [role 1] AND [role 2]"
This gets you the benefits of both perspectives!
Role Stacking Examples:
Builder + Explainer:
You are an expert React developer AND a patient teacher.
First, create a toggle switch component.
Then, explain each line like I'm a beginner.
Creator + Critic:
You are a web developer AND a code reviewer.
First, create a login form.
Then, review your own code and suggest improvements.
Designer + Developer:
You are a UX designer AND a frontend developer.
Create a pricing table that is both visually appealing and well-coded.
📝 Activity: Role Comparison
Try this experiment to see roles in action:
✅ Compare Role Responses
0/4📋 Role Prompt Templates
Copy and use these templates:
For Building Features:
For Learning:
For Code Review:
For Design + Code:
⚠️ Common Role Mistakes
✅ Lesson Summary
Key Takeaways
- Roles dramatically change AI responses — Same question, different answers
- Four categories: Expertise, Teaching, Quality, Style
- Match role to task — Use the decision guide
- Role stacking combines benefits for complex tasks
- Be specific — "Senior React developer" not just "developer"
📝 Mini Quiz
📝 Check Your Understanding
1/3Which role is best for learning a new concept?