Skip to content

Foundations · Chapter 2 of 11

Anatomy of a prompt

Most good prompts are built from the same few parts. You don't need all of them every time, but you should decide on each one.

By Updated

Finn fitting the last piece into a puzzle

The task and the goal

Start with what you want done, as a verb and a result: write, compare, plan, check. Then say what the result is for. “Compare these two phone plans” is a task; “…so I can choose one for a family of four” is a goal, and it changes what a good answer looks like. Anthropic advises being explicit about the output you want, including any extra effort Anthropic.

Weak

Tell me about running.

Better

Write a six-week plan that takes me from jogging 2 km to 5 km. I can train three days a week, and my knees are sensitive.

Context and reader

Context is what only you know: who reads the result, what happened before, what you have already tried and which material to use. Google's guide recommends supplying the information the model needs rather than assuming it has it Google.

  • Name the reader. A note for a new colleague differs from one for a customer.
  • Paste the material. The text, table or error message beats a description of it.
  • Keep private details out. Use [square brackets] for names, addresses and numbers, and fill them in yourself.

Limits

Limits say what to do and what to avoid: length, tone, sources, topics to leave out, facts not to invent. Google lists constraints as part of a clear prompt, such as a length limit for a summary Google. Phrase them as what to do where you can, and keep the don'ts for the things that really matter.

Check that your limits don't pull apart: “be thorough” and “three sentences” can't both win. OpenAI's GPT-5 guide says contradictions like this can hurt that model more than others OpenAI.

Output format

Say what shape the answer should take: a table with named columns, a list, a letter, JSON or a single word. Google advises naming the format Google, and Anthropic notes that the style of your prompt can nudge the style of the answer Anthropic.

Weak

Give me some dinner ideas.

Better

Give me five vegetarian dinner ideas as a table with the columns Dish, Time in minutes and Main ingredient. Under 40 minutes each.

A role or framing

A role is a one-line job description: “You are an editor who cuts without changing the meaning.” Anthropic says that even a one-sentence role in the system prompt focuses behaviour and tone Anthropic, and OpenAI's suggested layout for instructions starts with the assistant's identity OpenAI. Finn, PromptPrinter's assistant, builds a role or framing into its prompts too.

Put it together

Here is a small task built from the parts. For longer instructions, OpenAI suggests sections in roughly this order: identity, instructions, examples, context OpenAI.

  1. Rolesets the voice

    You are a friendly organiser who writes short, clear notices.

  2. Taskwhat to produce

    Write a notice inviting my neighbours to a courtyard clean-up.

  3. Contextwhat only you know

    Our building has about twenty flats. We meet on [date] at [time]. Gloves and bags are provided.

  4. Limitswhat to do and avoid

    At most 120 words. Warm, without guilt-tripping. Don't add details I haven't given you.

  5. Formatthe shape of the answer

    A headline, three short paragraphs, then how to sign up by [date].

One prompt, five parts.

The finished prompt

You are a friendly organiser who writes short, clear notices.
Write a notice inviting my neighbours to a courtyard clean-up.
Our building has about twenty flats. We meet on [date] at [time]. Gloves and bags are provided.
At most 120 words. Warm, without guilt-tripping. Don't add details I haven't given you.
A headline, three short paragraphs, then how to sign up by [date].

You can write it as one paragraph just as well. What counts is that every part you need is there, and that nothing in it contradicts something else.

Sources

Official guides by the model providers. They change as models change, so check them for your model.