01

What is a Prompt?

Toggle between a bad and good prompt
Your prompt
write something about dogs
AI output
Dogs are great animals. They come in many breeds and are loyal companions. People have kept dogs as pets for thousands of years. There are big dogs and small dogs...

"A prompt is how you talk to AI — the words you use determine everything you get back."

A prompt is any input you give to an AI model. It can be a question, an instruction, a piece of text to transform, or a combination. The model has no context beyond what's in your prompt, so the specificity, clarity, and structure of what you write directly determines the quality of the output.

Prompt: The input text given to an AI model. Everything the AI knows about what you want is contained in the prompt — there's no other channel.
02

Why Prompts Matter

Drag the slider to see output quality change
Prompt quality 50
Output quality Good
50%
Decent output — mostly on-topic with some structure.

"Garbage in, garbage out. This was true for spreadsheets. It's 10× more true for AI."

AI models are powerful but direction-agnostic. They'll try to complete whatever you give them. Vague prompts produce vague outputs. Specific, well-structured prompts produce specific, high-quality outputs. Learning to prompt well is like learning to google — deceptively simple, with enormous variance in skill level.

Prompt engineering: The practice of designing and refining inputs to AI models to consistently get high-quality, accurate, and useful outputs.
03

Basic Prompt Structure

Fill in the fields and build your prompt
Task — what do you want?
Context — relevant background
Format — how should it look?
Your assembled prompt

"The three-part prompt — task + context + format — fixes 80% of bad outputs."

Most great prompts share the same skeleton: Task (what do you want the AI to do?), Context (what background does it need to do it well?), and Format (how should the output be structured?). Add a Role if you want the AI to adopt a specific persona. This simple framework prevents the most common mistake: asking for output without giving enough information to produce it.

Prompt structure: Task + Context + Format (+ optional Role). Each element reduces ambiguity and gives the model clearer signal about what "good" looks like.
04

Zero-shot vs Few-shot

Switch modes to see how examples help
The prompt
Classify the sentiment of this review as Positive or Negative. Review: "The battery died after two hours."
AI output
Negative. Correct — but the model guessed the format since no examples were given.

"A few examples are worth a thousand words of instruction — show the model what good looks like."

Zero-shot prompting asks the AI to do something with no examples. Few-shot prompting provides 2-5 examples of input/output pairs before the actual request. The examples "train" the model's response distribution in-context, dramatically improving output format, tone, and accuracy — especially for structured or creative tasks.

Few-shot prompting: Including example input-output pairs in your prompt so the model learns the desired pattern from demonstration rather than description.
05

Chain-of-Thought Prompting

Watch step-by-step reasoning unfold
"If a train travels 60 mph for 2.5 hours, how far does it go? Think step by step."
1
Identify what's given: speed = 60 mph, time = 2.5 hours.
2
Recall the formula: distance = speed × time.
3
Substitute values: distance = 60 × 2.5 = 150.
4
Apply units: the answer is measured in miles.
Answer: The train travels 150 miles.

"Ask AI to think out loud, and it becomes dramatically smarter — because reasoning is iterative."

Adding "think step by step" or "reason through this carefully" to your prompt activates chain-of-thought (CoT) reasoning. Instead of jumping to an answer, the model works through intermediate steps. For math, logic, and complex reasoning tasks, CoT can improve accuracy by 40-60%. It's one of the highest-leverage prompt tricks that works across every model.

Chain-of-thought prompting: Instructing the model to show its reasoning process step-by-step before arriving at a final answer, improving accuracy on complex tasks.
06

System Prompts

Same question — two very different answers
Without system prompt
No instructions set.
How do I fix this bug?
There are many ways to debug code. You could use a debugger, add print statements, check your logic, search Stack Overflow, or review code line by line…
With system prompt
You are a friendly coding teacher for beginners. Give short, clear answers with a snippet when helpful.
How do I fix this bug?
Start by reading the error message — it tells you exactly what's wrong and on which line. Then add console.log() around the problem to inspect your values.

"System prompts are how you turn a general AI into a specialized assistant for your exact use case."

A system prompt is a special instruction that appears before the conversation begins, setting the AI's persona, constraints, and capabilities. It's invisible to end users but controls everything about how the AI behaves. Claude and ChatGPT both support system prompts via their APIs. If you're building an AI product, the system prompt is your most powerful design tool.

System prompt: An instruction given to an AI model before the conversation begins, defining its role, tone, constraints, and capabilities for the entire session.
07

Context Engineering

Add items to fill the context window
Context window 0% used

"The art isn't in asking the right question — it's in giving the model the right context to answer it well."

Context engineering is about strategically managing what information goes into the model's context window. You decide what to include (documents, history, examples), what to leave out, and how to order it. Models pay more attention to the beginning and end of the context window (primacy and recency effects). For complex tasks, thoughtful context design matters more than the question itself.

Context engineering: The discipline of deliberately designing what goes into an AI's context window — including documents, instructions, and examples — to maximize output quality.
08

Giving AI a Persona

Pick a persona — same question, totally different voice
"What's the best way to learn something new quickly?"
Select a persona above to see their answer.

"Tell the AI who it is, and it will behave consistently — 'Act as a senior UX researcher' beats 'help me with UX'."

Assigning a role or persona dramatically focuses AI output. "You are a senior product manager at a Series B startup" produces different, more targeted responses than a bare question. Personas work because they activate relevant patterns from training data. Be specific: "senior software engineer who cares about readability" beats "programmer."

Role prompting: Assigning a specific identity or expertise to the AI model at the start of a prompt to activate relevant knowledge patterns and tone.
09

Formatting Output

Select a format — same content, different structure
The three most popular programming languages are Python, JavaScript, and TypeScript. Python is known for simplicity and data science. JavaScript runs in browsers. TypeScript adds types to JavaScript.

"The best answer in the wrong format is still a bad answer — tell the model exactly how you want it."

AI can output in almost any format you specify: bullet points, numbered lists, JSON, markdown tables, HTML, CSV, or prose. When you need structured output (for code, data, or UIs), specifying the exact format prevents the model from deciding for you. JSON output is particularly useful for piping AI responses into applications.

Output formatting: Specifying in your prompt exactly how the response should be structured — as JSON, a table, bullet points, or prose — to make the output immediately usable.
10

Iteration: Improving a Bad Prompt

Watch the prompt evolve through 3 rounds of refinement
Step 1 — First attempt
Write about climate change.
Output quality
"Climate change is a major global issue. Temperatures are rising..." — Generic, unfocused, no clear audience.

"The first prompt is just a hypothesis. Great outputs come from 3-4 iterations, not one perfect prompt."

The best prompters iterate fast. Start with a working prompt, review the output, identify what's missing or wrong, and refine. Common refinements: add more context, specify format, add examples, tighten the task description, or break one big prompt into several smaller ones. Treat prompting like a conversation, not a one-shot query.

Prompt iteration: The process of systematically refining a prompt through multiple rounds based on output quality, similar to how a designer iterates on a wireframe.
11

Common Mistakes

Tap each card to reveal the mistake and the fix
?
tap to reveal
Too Vague
Fix: Add a specific task, format, and audience to every prompt.
?
tap to reveal
Too Long
Fix: Put your key instruction first — don't bury it in paragraphs.
?
tap to reveal
No Examples
Fix: Show 1-2 examples of the style or format you want.
?
tap to reveal
Overloading
Fix: Break 10-task prompts into focused, sequential prompts.
?
tap to reveal
No Constraints
Fix: Always specify length ("under 100 words"), tone ("professional"), and audience ("for a 12-year-old") to prevent open-ended outputs.

"Most bad AI outputs aren't the model's fault — they're the prompt's fault."

The five most common prompt mistakes: (1) Too vague — no specific task or format. (2) Too long — burying the key instruction in paragraphs. (3) No examples — assuming the model knows your preferred style. (4) Asking for too much at once — combining 10 tasks in one prompt. (5) No constraints — not specifying length, tone, or audience. Each mistake has a quick fix.

Prompt failure modes: Recurring patterns in poorly-designed prompts that produce consistently bad outputs: vagueness, overloading, format ambiguity, and missing context.
12

Prompting Cheat Sheet

Hover each pattern to highlight — 6 patterns, 90% of situations
Pattern 1
Basic Instruction + Format
Template: [Do X] in [format] for [audience].
Example: "Summarize this article in 3 bullet points for a non-technical reader."
Pattern 2
Role + Task
Template: You are a [role]. [Task].
Example: "You are a senior UX researcher. Review this onboarding flow and list the top 3 friction points."
Pattern 3
Few-shot with Examples
Template: Here are examples: [Ex1 in → out] [Ex2 in → out]. Now: [your input]
Example: Provide 2 sample email subject lines, then ask it to write a third in the same style.
Pattern 4
Chain-of-Thought Reasoning
Template: [Task]. Think step by step before giving your final answer.
Example: "Should we launch in Q3 or Q4? Think step by step before giving your final answer."
Pattern 5
Document Analysis
Template: Here is [document type]: [paste text]. [Question or task].
Example: "Here is a contract: [text]. List all clauses that could be a liability risk for the buyer."
Pattern 6
Structured JSON Output
Template: [Task]. Return a JSON object with fields: [field1], [field2], [field3].
Example: "Extract the name, date, and total from this invoice. Return a JSON object with fields: name, date, total."

"Bookmark this. The 6 patterns here cover 90% of prompting situations you'll actually encounter."

Most prompting situations map to one of six patterns: (1) Basic instruction + format. (2) Role + task. (3) Few-shot with examples. (4) Chain-of-thought reasoning. (5) Document analysis. (6) Structured JSON output. Master these six, and you can handle almost anything. The cheat sheet on the right is your quick reference.

Prompt patterns: Reusable templates for common prompting scenarios that can be adapted and combined to produce reliable, high-quality AI outputs.

You've finished Prompting!

You now know how to write clear prompts, use few-shot examples, chain-of-thought, system prompts, and iterate toward great outputs.

Continue: AI Products