Free resource

The anatomy of a good prompt

Some Anthropic engineers asked Claude to analyze a car crash from a form and a hand-drawn sketch. With a short instruction, Claude concluded it was… a skiing accident.

The problem wasn't the AI. It was the instruction. They kept adding pieces until the answer was spot on. Here are those pieces, explained without jargon and with a real-life example.

Same request, two results

Weak prompt

Reply to this customer complaint.

The AI doesn't know who you are, what you sell, what your policies are, or how you want to sound. It will guess.

Structured prompt

  1. Role and task
  2. Context
  3. Tone
  4. The material
  5. Examples
  6. Steps
  7. Rules
  8. Format

Same request, but with the 8 pieces below. The full version is at the end of the page, ready to copy.

The 8 pieces of a good prompt

You don't always need all 8. But the more important the task, the more pieces are worth using. Every example uses the same task: replying to a customer complaint for an online clothing store.

  1. Role and task

    Tell it who it is and what it has to do. This goes first because everything else depends on it.

    Example
    You are the customer service lead for an online clothing store. Your task is to reply to a customer complaint.
  2. Context

    Everything that doesn't change from case to case: who you are, who you're talking to, your business rules. The AI can't know this unless you tell it.

    Example
    We sell clothes in Colombia. Shipping takes 3 to 5 business days. Size exchanges are free for 30 days. We don't offer refunds on sale items.
  3. Tone

    How you want it to sound. And one key thing: give it permission to say "I don't know." Otherwise it will guess with total confidence.

    Example
    Be kind and direct, no filler. If something in the complaint is unclear, say so instead of assuming.
  4. The material

    What the AI needs to analyze: the complaint, the document, the data. Separate it from the rest with tags so it doesn't confuse it with your instructions.

    Example
    <complaint>
    I ordered a size M jacket 9 days ago, it arrived yesterday and it's a size S. I want my money back.
    </complaint>
  5. Examples

    Show it an answer you like, especially for a tricky case. One good example is worth ten instructions.

    Example
    <example>Hi Laura. You're absolutely right, and we're sorry about the mistake. We've already set up a free exchange…</example>
  6. Steps

    Tell it in what order to think. Like a person, the AI reaches better conclusions when it works through things in order.

    Example
    1. Identify what the customer is asking for. 2. Check whether any of our policies apply. 3. Decide what we can offer. 4. Write the reply.
  7. Rules

    The limits it must not cross. The most important one: don't make things up.

    Example
    Don't promise anything that isn't in our policies. Don't invent dates or tracking numbers. If information is missing, ask the customer for it.
  8. Format

    How you want to receive the answer: length, structure, language.

    Example
    A reply of 5 lines max, ready to send on WhatsApp. Then, on a separate line, tell me which policy you applied.

Final trick: repeat the most important instruction at the end of the prompt. What it reads last is what it keeps most in mind.

Template to copy

Copy it, replace what's in brackets, and delete the pieces you don't need.

Template
You are [who it is]. Your task is [what it has to do].

Context:
[What doesn't change: who you are, who you're talking to, your rules.]

Tone: [how you want it to sound]. If something is unclear, say so instead of guessing.

<material>
[Paste the text, document, or data to analyze here.]
</material>

Example of a good answer:
<example>
[An answer you like.]
</example>

Follow these steps:
1. [First...]
2. [Then...]
3. [Finally...]

Rules:
- Don't make up anything that isn't in the material.
- [Another important rule.]

Answer format: [length, structure, language].

Remember: [repeat the most important thing here].

The full example

Full prompt
You are the customer service lead for an online clothing store. Your task is to reply to a customer complaint.

Context:
We sell clothes in Colombia. Shipping takes 3 to 5 business days. Size exchanges are free for 30 days. We don't offer refunds on sale items.

Tone: kind and direct, no filler. If something in the complaint is unclear, say so instead of assuming.

<complaint>
I ordered a size M jacket 9 days ago, it arrived yesterday and it's a size S. I want my money back.
</complaint>

Example of a good answer:
<example>
Hi Laura. You're absolutely right, and we're sorry about the mistake. We've already set up a free exchange: the courier will pick up the item tomorrow, and the correct size will reach you in 3 to 5 business days.
</example>

Follow these steps:
1. Identify what the customer is asking for.
2. Check whether any of our policies apply.
3. Decide what we can offer.
4. Write the reply.

Rules:
- Don't promise anything that isn't in our policies.
- Don't invent dates or tracking numbers.
- If information is missing, ask the customer for it.

Answer format: 5 lines max, ready to send on WhatsApp. Then, on a separate line, tell me which policy you applied.

Remember: don't promise anything that isn't in our policies.

Credit

Based on the "Prompting 101" talk by Hannah and Christian from Anthropic's Applied AI team. I adapted it to everyday tasks for people who don't code.

Watch the original talk →

Want to put AI to work in your job or business?