---
id: how-to-write-a-great-prompt
lang: en
title: "How to write a great prompt"
seoTitle: "How to write a great AI prompt"
description: "A simple five-part recipe for prompts that work: role, task, context, examples, and format. With a copy-ready template and a real business example."
part: prompting
partTitle: "Prompting"
partOrder: 3
order: 2
level: Beginner
durationMinutes: 7
outcome: "Write a strong prompt from a simple, repeatable recipe."
summary: "A strong prompt has five parts: role, task, context, examples, and format. Give Claude those and you get usable work the first time."
draft: false
updated: "2026-07-26"
furtherReading:
  - title: "Prompt engineering overview (Anthropic)"
    url: "https://docs.claude.com/en/docs/build-with-claude/prompt-engineering/overview"
    note: "the techniques behind the recipe, from the source."
  - title: "Anthropic's interactive prompt engineering tutorial"
    url: "https://github.com/anthropics/prompt-eng-interactive-tutorial"
    note: "a hands-on, nine-chapter course you can work through."
  - title: "Prompt engineering guide (OpenAI)"
    url: "https://platform.openai.com/docs/guides/prompt-engineering"
    note: "a second take on structuring prompts well."
  - title: "Best practices for prompt engineering (OpenAI Help)"
    url: "https://help.openai.com/en/articles/6654000-best-practices-for-prompt-engineering-with-the-openai-api"
    note: "short, practical dos and don'ts."
keywords:
  - how to write a prompt
  - prompt template
  - prompt structure
  - prompt recipe
  - better AI prompts
  - AI prompt examples
quiz:
  intro: "Four quick questions. Ace all four and the next lesson unlocks."
  passScore: 4
  questions:
    - q: "What are the five ingredients of a strong prompt?"
      options:
        - "Greeting, request, sign-off"
        - "Role, task, context, examples, format"
        - "Who, what, when, where, why"
        - "Length, tone, language, deadline, budget"
      answer: 1
      explain: "Role, task, context, examples, format. That is the whole recipe."
    - q: "Which part does the lesson say everyone skips, though it matters most?"
      options:
        - "Role"
        - "Format"
        - "Context"
        - "Examples"
      answer: 2
      explain: "Context. The AI knows nothing about your Tuesday until you tell it."
    - q: "Your prompt says \"make it better\" and the result is no better. What is the fix?"
      options:
        - "Add \"please\" and \"thank you\""
        - "Say what \"better\" means: shorter, warmer, less like a robot"
        - "Ask for a much longer answer"
        - "Switch to a different AI tool"
      answer: 1
      explain: "Name what \"better\" means. The AI cannot read the frown on your face."
    - q: "Why is \"write the strategy, the email, and the deck\" a weak prompt?"
      options:
        - "It is rude to the AI"
        - "One job per prompt works better; do them in turn and build on each"
        - "AI cannot make slide decks"
        - "It uses too many words"
      answer: 1
      explain: "One clear job per prompt. Ask for three things at once and you get three half-finished things."
  pass:
    badge: "Perfect score"
    title: "Boom. You've got the recipe."
    body: "Full marks. Your prompts just leveled up. Now let's make the answers even sharper."
  retry: "Check the marked answers and give it another go. You've got this."
---

> **Level:** Beginner · **Reading time:** ~7 min
>
> **What you'll be able to do:** write a strong prompt from a simple, repeatable recipe.

Most people talk to AI like they're texting a psychic. They type "write me an email," hit enter, and wait for the machine to read their mind. Then they act betrayed when it hands back something a nervous intern would be too shy to send.

Here's the thing: the AI didn't fail. The prompt did. **A vague ask gets a vague answer, every time.** The good news is that a good prompt isn't a dark art or a 40-line "mega-prompt" you buy off the internet. It's **a recipe with five ingredients**. Learn it once, use it forever.

## The recipe: five ingredients

A strong prompt usually has five parts. You won't need all five every time, but when the output actually matters, the more you give, the less you'll be let down.

### 1. Role: who should the AI be?

Tell it who to act as, and who *you* are. "You're my assistant, writing as me" lands very differently from "You're a sharp financial analyst." Same machine, different hat.

### 2. Task: what exactly do you want?

One clear job. Not "help me with this client" but "draft a two-line reply that says no without burning the relationship." Vague verbs like *handle*, *improve*, and *look at* are where good answers go to die.

### 3. Context: what does it need to know?

This is the part everyone skips, and it's the one that matters most. Who's the audience? What's the backstory? What are the constraints? The AI knows nothing about your Tuesday. Tell it.

### 4. Examples: show, don't just tell

If you have a sample you like (an old email, a report in the right style), paste it. "Match this tone" beats three paragraphs describing the tone. One good example is worth a paragraph of adjectives.

### 5. Format: what should the answer look like?

Say the shape you want: length, structure, tone. "Three subject lines and a body under 120 words" gets you three subject lines and a body under 120 words. "Some ideas" gets you a wall of text and a small headache.

<figure class="lesson-svg" aria-labelledby="recipe-title">
<svg viewBox="0 0 640 500" width="100%" height="auto" role="img" xmlns="http://www.w3.org/2000/svg" font-family="Inter, system-ui, sans-serif">
<title id="recipe-title">The prompt recipe: five ingredients</title>
<desc>Role, Task, Context, Examples, and Format, each with a one-line description.</desc>
<text x="0" y="22" font-size="21" font-weight="800" fill="var(--ink,#1F2328)">The prompt recipe</text>
<text x="0" y="46" font-size="13.5" fill="var(--soft-gray,#6E747C)">Five ingredients. You only need all five when the output really matters.</text>
<rect x="0" y="66" width="640" height="78" rx="14" fill="#fff" stroke="var(--line,#E7E9EC)"/>
<circle cx="44" cy="105" r="20" fill="var(--part,#1FA98C)"/>
<text x="44" y="111" font-size="18" font-weight="800" fill="#fff" text-anchor="middle">1</text>
<text x="82" y="100" font-size="17" font-weight="800" fill="var(--ink,#1F2328)">Role</text>
<text x="82" y="124" font-size="14" fill="var(--med-gray,#5B6169)">Who should the AI be? And who are you?</text>
<rect x="0" y="154" width="640" height="78" rx="14" fill="#fff" stroke="var(--line,#E7E9EC)"/>
<circle cx="44" cy="193" r="20" fill="var(--part,#1FA98C)"/>
<text x="44" y="199" font-size="18" font-weight="800" fill="#fff" text-anchor="middle">2</text>
<text x="82" y="188" font-size="17" font-weight="800" fill="var(--ink,#1F2328)">Task</text>
<text x="82" y="212" font-size="14" fill="var(--med-gray,#5B6169)">One clear job. Skip vague verbs like &#34;handle&#34; or &#34;improve&#34;.</text>
<rect x="0" y="242" width="640" height="78" rx="14" fill="#fff" stroke="var(--line,#E7E9EC)"/>
<circle cx="44" cy="281" r="20" fill="var(--part,#1FA98C)"/>
<text x="44" y="287" font-size="18" font-weight="800" fill="#fff" text-anchor="middle">3</text>
<text x="82" y="276" font-size="17" font-weight="800" fill="var(--ink,#1F2328)">Context</text>
<text x="82" y="300" font-size="14" fill="var(--med-gray,#5B6169)">What must it know? Audience, backstory, constraints.</text>
<rect x="0" y="330" width="640" height="78" rx="14" fill="#fff" stroke="var(--line,#E7E9EC)"/>
<circle cx="44" cy="369" r="20" fill="var(--part,#1FA98C)"/>
<text x="44" y="375" font-size="18" font-weight="800" fill="#fff" text-anchor="middle">4</text>
<text x="82" y="364" font-size="17" font-weight="800" fill="var(--ink,#1F2328)">Examples</text>
<text x="82" y="388" font-size="14" fill="var(--med-gray,#5B6169)">Paste a sample you like: &#34;like this, not like that&#34;.</text>
<rect x="0" y="418" width="640" height="78" rx="14" fill="#fff" stroke="var(--line,#E7E9EC)"/>
<circle cx="44" cy="457" r="20" fill="var(--part,#1FA98C)"/>
<text x="44" y="463" font-size="18" font-weight="800" fill="#fff" text-anchor="middle">5</text>
<text x="82" y="452" font-size="17" font-weight="800" fill="var(--ink,#1F2328)">Format</text>
<text x="82" y="476" font-size="14" fill="var(--med-gray,#5B6169)">The shape of the answer: length, structure, tone.</text>
</svg>
</figure>

## Watch it work

Say a client was promised a report on Friday. It'll be late. You need to send the email nobody enjoys sending.

The lazy prompt:

```
Write an email to my client about the delay.
```

You'll get something. It'll open with "I hope this email finds you well," bury the point in paragraph three, and sound like it was written by a fax machine. Now the recipe version:

```
You're my assistant, writing as me. I'm an account manager, warm but straight-talking.

Task: draft a short email telling a client their report will be two days late.

Context: the client is Devlin & Co. We promised Friday; it'll land Tuesday. The delay is on us: a data source broke. They matter to us and they're a little anxious. I don't want to grovel, but I want them to feel in safe hands.

Format: give me three subject lines and a body under 120 words. Plain English, no jargon, no "please be advised." End with a clear next step.
```

Same task, ten seconds more typing. The second one comes back short, honest, and ready to send, because you gave the AI a role, a real situation, and a shape to fill. You did the thinking; it did the typing.

<figure class="lesson-svg" aria-labelledby="rep-title">
<svg viewBox="0 0 640 380" width="100%" height="auto" role="img" aria-labelledby="rep-title rep-desc" xmlns="http://www.w3.org/2000/svg" font-family="Inter, system-ui, sans-serif">
<title id="rep-title">Claude's reply to the recipe prompt</title>
<desc id="rep-desc">A reply card with three subject-line options and a short, ready-to-send email telling a client the report will land Tuesday, not Friday, ending with a clear next step. A tag notes it is under 120 words.</desc>
<text x="16" y="24" font-size="11" font-weight="700" fill="var(--med-gray,#5B6169)">Claude</text>
<rect x="8" y="32" width="624" height="336" rx="16" fill="var(--part-tint,#E9F7F3)" stroke="var(--part,#1FA98C)" stroke-width="1.5"/>
<rect x="470" y="48" width="146" height="26" rx="13" fill="#fff" stroke="var(--part,#1FA98C)" stroke-width="1"/>
<text x="543" y="65" font-size="11.5" font-weight="700" fill="var(--part-ink,#16806A)" text-anchor="middle">&#10003; Under 120 words</text>
<text x="32" y="64" font-size="14" font-weight="800" fill="var(--part-ink,#16806A)">Three subject lines</text>
<text x="32" y="90" font-size="12.5" fill="var(--ink,#1F2328)">1. Quick update on your report timing</text>
<text x="32" y="114" font-size="12.5" fill="var(--ink,#1F2328)">2. Your Devlin report: now Tuesday</text>
<text x="32" y="138" font-size="12.5" fill="var(--ink,#1F2328)">3. A small delay on your report</text>
<line x1="28" y1="160" x2="612" y2="160" stroke="#CDE8E1" stroke-width="1.5"/>
<text x="32" y="188" font-size="14" font-weight="800" fill="var(--part-ink,#16806A)">Email body</text>
<text x="32" y="214" font-size="12" fill="var(--ink,#1F2328)">Hi Sarah,</text>
<text x="32" y="236" font-size="12" fill="var(--ink,#1F2328)">A quick heads-up: your report will</text>
<text x="32" y="258" font-size="12" fill="var(--ink,#1F2328)">land Tuesday, not Friday. A data</text>
<text x="32" y="280" font-size="12" fill="var(--ink,#1F2328)">source broke on our side, and we'd</text>
<text x="32" y="302" font-size="12" fill="var(--ink,#1F2328)">rather send it right than rushed.</text>
<text x="32" y="324" font-size="12" fill="var(--ink,#1F2328)">You'll have it by 10am Tuesday.</text>
<text x="32" y="352" font-size="12" fill="var(--ink,#1F2328)">Best, Alex</text>
</svg>
</figure>

## Four ways it goes wrong

**"Make it better."** Better how? Shorter, warmer, less like a robot? The AI can't read the frown on your face. Name what "better" means.

**Skipping the backstory.** You know the client is furious and the deadline moved twice. The AI doesn't. Thirty seconds of context saves three rounds of edits.

**Asking for everything at once.** "Write the strategy, the email, and the deck" gets you three half-finished things. Do one job per prompt, then build on the result. (That's the [next lesson](/learn/prompting/iterating).)

**Forgetting the format.** If you don't say how long or what shape, you get the AI's guess. Its guess is usually "longer than you wanted."

## The template

Keep this somewhere you can grab it:

```
Role:     Who should the AI be? And who are you?
Task:     What exactly do you want it to do? (one clear job)
Context:  What must it know? (audience, backstory, constraints)
Examples: Got a sample you like? Paste it. "Like this, not like that."
Format:   What should the answer look like? (length, structure, tone)
```

Quick questions don't need all five: asking for a synonym doesn't call for a role and a mission statement. But the moment the output matters, run down the list. It's the difference between a tool and a mind-reader you're disappointed in.

## Try it

Grab a real email you've been putting off, the awkward one, you know the one. Write it two ways. First the lazy version: one line, no context. Then the recipe version: role, task, context, format. Run both.

Read them side by side. The gap between the two is exactly the value of ninety seconds of thinking before you hit enter. That gap is the whole skill.

## Key terms

[Prompt](/glossary#prompt), [Context](/glossary#context), [Prompt engineering](/glossary#prompt-engineering)
