Prompt Engineering Basics·Lesson 9

Anatomy of a Great Prompt

The core components that make prompts effective — role, context, instruction, format, and constraints.

Course progress9 / 29

The Five Components

Every effective prompt contains some combination of these five components:

1. Role — Who should the AI be? "You are an experienced marketing strategist..."
2. Context — What background information does it need? "I'm launching a SaaS product for small businesses..."

3. Instruction — What exactly should it do? "Create a 30-day launch plan..."

4. Format — How should the output look? "Present as a table with columns for Week, Task, Channel, and KPI"

5. Constraints — What should it avoid or prioritize? "Budget is $5,000. Focus on organic channels. No paid ads."

You don't need all five for every prompt, but the more you include, the better the output.

Bad vs Good Prompts

Bad prompt: "Write me a blog post about AI"
Problem: No role, no context, no format, no constraints. The AI has to guess everything.

Good prompt: "You are a tech blogger writing for a non-technical audience. Write a 500-word blog post explaining how small business owners can use ChatGPT to save 5 hours per week. Use a conversational tone, include 3 specific examples, and end with a clear call-to-action. Avoid jargon."

The good prompt specifies the role (tech blogger), context (non-technical audience, small business), instruction (500-word blog post), format (conversational, 3 examples, CTA), and constraints (no jargon).

The Specificity Principle

The #1 rule of prompt engineering: be specific.

Vague prompts get vague responses. Specific prompts get specific, useful responses.

- Instead of "make it better" → "improve the opening paragraph by adding a hook question and a surprising statistic"
- Instead of "write code" → "write a Python function that takes a CSV file path and returns the top 5 rows by revenue, handling missing values gracefully"

- Instead of "summarize this" → "summarize this article in 3 bullet points, each under 20 words, focusing on the implications for software developers"

Practice This

Take a prompt you've used before that gave mediocre results. Rewrite it using all five components (role, context, instruction, format, constraints). Send both versions to ChatGPT or Claude and compare the outputs.

Try this on ChatGPT, Claude, or Gemini

Key Takeaways
  • Great prompts have five components: role, context, instruction, format, constraints
  • Specificity is the single most important factor in prompt quality
  • You don't need all five components — but more detail means better output
  • Compare bad vs good prompt outputs to train your intuition

Test Yourself

Q1What are the five components of an effective prompt?
Role (who the AI should be), Context (background information), Instruction (what to do), Format (how output should look), Constraints (limitations and priorities).