Ch 2 — Anatomy of a Great Prompt

The 5 building blocks — Role, Context, Task, Format, Constraints — and how each one transforms the output
Foundations
warning
Bare Task
arrow_forward
person
+ Role
arrow_forward
description
+ Context
arrow_forward
format_list_numbered
+ Format
arrow_forward
block
+ Constraints
arrow_forward
compare
Before/After
arrow_forward
content_copy
Template
-
Click play or press Space to begin...
Step- / 7
warning
Start: The Bare Task (What Most People Do)
A real scenario — writing a product description for a SaaS landing page
The Scenario
You work at a SaaS company that makes a project management tool called “TaskFlow.” Your marketing team needs a product description for the landing page. Let’s build the prompt piece by piece and watch how the output improves at each step.
Bare Task Only
Prompt: “Write a product description for TaskFlow.”

Output: “TaskFlow is a powerful project management tool that helps teams stay organized and productive. With intuitive features and a user-friendly interface, TaskFlow makes it easy to manage tasks, track progress, and collaborate with your team...”

Generic marketing fluff. Could describe any tool. No specifics, no personality, no differentiation.
Why It Fails
# "Write a product description for TaskFlow" # What the model knows: # - It's a product description (format: vague) # - It's for something called TaskFlow # - That's it. # What the model doesn't know: # - What TaskFlow actually does # - Who it's for # - What makes it different # - What tone to use # - How long it should be # - What the reader should do after reading # Result: the model fills in the blanks # with the most generic patterns from its # training data. Every SaaS landing page # sounds the same because the prompts # all look the same.
person
Add Role: Who Is the Model?
Setting the persona changes the vocabulary, tone, and expertise level
What Role Does
A role tells the model what kind of expert to be. It shifts the entire probability distribution toward language, concepts, and patterns that expert would use. “You are a senior SaaS copywriter” activates different patterns than “You are a technical writer” or no role at all.
# Adding role to our prompt: "You are a senior SaaS copywriter who specializes in converting free-trial signups. Write a product description for TaskFlow." # Output now has: # ✓ Conversion-focused language # ✓ Benefits over features # ✓ Call-to-action phrasing # ✗ Still generic (no product details) # ✗ Still no specific audience
Role Examples Across Domains
# Different roles, different outputs: # For code review: "You are a senior backend engineer with 10 years of Python experience who values clean, maintainable code." # For data analysis: "You are a data analyst at a fintech company who explains findings to non-technical stakeholders." # For customer support: "You are a patient, empathetic support agent for a B2B software company." # The more specific the role, the more # the model's "personality" shifts. # "Engineer" is okay. # "Senior backend engineer who values # clean code" is much better.
Key insight: Role is the most underused building block. Most people skip it entirely. Adding a specific role is the single easiest way to improve any prompt.
description
Add Context: What Does the Model Need to Know?
Background information the model can’t guess
What Context Does
Context provides the specific information the model needs to give a useful answer. Without it, the model fills in blanks with generic assumptions. With it, the model has real material to work with. Think of it as briefing a new hire: what do they need to know before they can do the job?
# Adding context: "You are a senior SaaS copywriter. TaskFlow is a project management tool for remote engineering teams (10-50 people). Key differentiator: it integrates directly with GitHub, Slack, and CI/CD pipelines, so engineers never leave their workflow. Competitors (Jira, Linear) require context-switching. Price: $12/user/month. Target audience: engineering managers who are frustrated with Jira's complexity. Write a product description for TaskFlow." # Output now mentions specific integrations, # addresses Jira pain points, targets the # right audience. Much more specific!
Context Checklist
# Ask yourself: what would a new hire # need to know to do this task? # For product copy: # ✓ What the product does # ✓ Who it's for (specific audience) # ✓ What makes it different # ✓ Key competitors # ✓ Price point # For debugging: # ✓ The error message # ✓ The relevant code # ✓ What you expected vs what happened # ✓ What you've already tried # For data analysis: # ✓ The data schema # ✓ The business question # ✓ Who will read the analysis # ✓ What decisions depend on it
format_list_numbered
Add Format: What Should the Output Look Like?
Structure eliminates the “wall of text” problem
What Format Does
Without a format specification, the model defaults to prose paragraphs. Format tells the model exactly how to structure the output: bullet points, numbered lists, JSON, a specific section layout. This is especially important when the output will be used programmatically or pasted into a specific template.
# Adding format: "...Write a product description for TaskFlow with this structure: 1. Headline (max 10 words, punchy) 2. Subheadline (1 sentence, pain point) 3. Three bullet points (benefit-focused, each starting with a verb) 4. Social proof line (use placeholder) 5. CTA button text (5 words max)" # Output is now structured, scannable, # and ready to paste into the landing page.
Format Patterns That Work
# Common format specifications: # Structured text: "Use markdown with H2 headers" "Bullet points, max 3 per section" "Numbered steps, one action per step" # Data: "Return as JSON with this schema: {...}" "Markdown table with columns: X, Y, Z" "CSV format, no headers" # Specific layouts: "TLDR (1 line), then Details (3 paras)" "Executive summary, then technical deep dive" "Problem → Cause → Solution → Prevention" # Pro tip: if you want a specific format, # show it. Don't just describe it. # "Format like this:" + example # beats "use a structured format" every time.
block
Add Constraints: What Should the Model NOT Do?
Guardrails prevent the most common failure modes
What Constraints Do
Constraints are negative instructions — they tell the model what to avoid. This is crucial because models have strong defaults: they tend to be verbose, use clichés, add disclaimers, and hedge. Constraints override these defaults. Think of them as the “don’t” list you’d give a new team member.
# Adding constraints: "Constraints: - No buzzwords (don't use 'synergy', 'leverage', 'streamline', 'empower') - No generic claims ('powerful', 'robust', 'cutting-edge', 'world-class') - Total length: under 150 words - Tone: direct and confident, not salesy - Don't mention competitors by name" # The output is now tight, specific, # and free of the generic filler that # plagues most AI-generated copy.
Constraint Patterns
# Constraints that fix common problems: # Too verbose: "Max 100 words" "One paragraph only" "Be concise — every word must earn its place" # Too generic: "Use specific numbers, not vague claims" "No adjectives without evidence" # Too hedgy: "No disclaimers or caveats" "Don't say 'it depends' — commit to an answer" # Wrong audience: "Assume the reader is technical" "Don't explain basic concepts" # Hallucination risk: "Only use information I've provided" "If unsure, say 'I don't know'"
Key insight: Constraints are often more powerful than positive instructions. Telling the model what NOT to do is sometimes easier than describing exactly what you want. “Don’t use buzzwords” is clearer than “use authentic language.”
compare
The Full Before & After
Same task, dramatically different results
Before (Bare Task)
“Write a product description for TaskFlow.”

Output: “TaskFlow is a powerful project management tool that helps teams stay organized and productive. With intuitive features and a user-friendly interface, TaskFlow makes it easy to manage tasks, track progress, and collaborate with your team. Whether you’re a small startup or a large enterprise, TaskFlow has everything you need to streamline your workflow.”

58 words of nothing. Could describe literally any tool.
After (All 5 Building Blocks)
Output:
Headline: “Ship faster. Manage less.”
Sub: “Your engineers shouldn’t need a PM tool certification to track their work.”
Bullets:
• Connect GitHub PRs to tasks automatically — no copy-pasting URLs
• Get sprint updates in Slack without anyone writing a status report
• See deployment status alongside task progress in one dashboard
Proof: “Used by 2,000+ engineering teams”
CTA: “Start free — no credit card”

Specific, structured, ready to ship. Every line earns its place.
content_copy
The Universal Prompt Template
Copy this, fill in the blanks, use it for anything
The Template
# The 5-Block Prompt Template: [ROLE] You are a [specific expert] who [key trait]. [CONTEXT] Here's what you need to know: - [Background info the model can't guess] - [Specific details about the situation] - [Who the audience is] [TASK] [Clear, specific instruction — one main task] [FORMAT] Structure your response as: - [Exact format specification] - [Section layout, length, style] [CONSTRAINTS] Rules: - [What to avoid] - [Length limits] - [Tone/style boundaries]
When to Use Each Block
# Not every prompt needs all 5 blocks. # Here's when each matters most: # ROLE: Almost always. Skip only for # trivial tasks ("translate this word"). # CONTEXT: When the model can't guess # the specifics. Always for domain tasks. # TASK: Always. This is the core. # FORMAT: When you need structured output # or the default format won't work. # CONSTRAINTS: When the model's defaults # are wrong (too verbose, too generic, # wrong tone, etc.) # Simple task: Task + Format # Medium task: Role + Task + Format # Complex task: All 5 blocks
Key insight: You don’t need to memorize this template. Just ask yourself 5 questions before writing any prompt: (1) Who should the model be? (2) What does it need to know? (3) What should it do? (4) What should the output look like? (5) What should it avoid? Answer those, and you have a great prompt.