Anatomy of a Good Prompt
Every effective prompt has key components that work together. Understanding these parts helps you craft better instructions consistently.
The Five Core Components
A well-structured prompt often contains:
- Role/Persona - Who should the AI be?
- Context - What background is needed?
- Task - What should be done?
- Format - How should output be structured?
- Constraints - What limits or rules apply?
Visualizing Prompt Structure
Here's the same framework applied to different scenarios. Pick the example closest to your use case:
Example 1: Travel Planning
Example 2: Business & Marketing
Example 3: Software Development
Click "Analyze" on any example to see how the prompt hits all the key components.
Component Breakdown
1. Role/Persona
Sets the AI's expertise level and perspective:
- "You are an expert data scientist..."
- "Act as a patient elementary school teacher..."
- "Pretend you're a skeptical investor..."
2. Context
Provides necessary background information:
- The situation or problem
- Relevant details about the user
- Previous attempts or constraints
3. Task
The specific action you want:
- Clear verb (explain, write, analyze, create)
- Specific subject matter
- Desired outcome
4. Format
How the output should be structured:
- JSON, markdown, bullet points
- Word count or length
- Sections or headings
5. Constraints
Rules and limitations:
- What to include or exclude
- Tone and style requirements
- Audience considerations
Exercise: Build a Complete Prompt
Common Mistakes
Missing role: Without expertise context, you get generic responses.
Vague task: "Help me with my essay" vs "Review my essay for grammar and suggest 3 improvements."
No format: You might get a wall of text when you wanted bullet points.
Conflicting constraints: "Be comprehensive but keep it under 50 words."
Quick Reference Template
Practice: Analyze This Prompt
What's missing from the prompt above? Think about:
- What role would improve the response?
- What context is the AI missing?
- What format would be most useful?
- What constraints would help?
Understanding prompt anatomy is the foundation for everything else in this course.

