ai-hub
[en]es
[concept][changing]

The Anatomy of a Prompt

An effective prompt is built from blocks: context, intent, format, constraints, and examples. We dissect each one and how to assemble them.

// 3 min read · updated 2026-07

// before reading

What is it

The anatomy of a prompt is the set of blocks that make up an effective instruction for a generative AI model: context, intent, format, constraints, and examples. It isn't a rigid formula — it's a mental checklist so the model doesn't have to guess.

A prompt rarely fails because the model "lacks creativity." It fails because a block was missing and the model filled the gap with an assumption. Knowing the anatomy means knowing exactly which block to add when the output isn't what you wanted.

Mental model

Think of a prompt as a form you hand to a very capable colleague who just joined the team: the more fields you fill in, the less they have to invent.

The five blocks, and what each one answers:

BlockQuestion it answersIf it's missing...
ContextWho, what product, what technical constraints?the model assumes a generic case
IntentWhat outcome do I want, and why?it runs the literal action, not the goal
FormatHow do I want the output?it picks a format at random
ConstraintsWhat should it NOT do?it includes things you didn't want
ExamplesWhat does a good result look like?it interprets style on its own
graph LR A[Context] --> P[Prompt] B[Intent] --> P C[Format] --> P D[Constraints] --> P E[Examples] --> P P --> O[Predictable output]

The rule is simple: each block you add reduces the variance of the result.

How it's used

A prompt is built in layers. Start with intent and keep adding blocks until the result is repeatable.

Minimal prompt (intent only):

Write a product description for an online store.

Result: generic, random tone, unpredictable length.

Prompt with the full anatomy:

Context: B2C specialty-coffee store; young audience new to single-origin coffee.
Intent: a description that educates without overwhelming and nudges the sale.
Task: product description for an Ethiopian Yirgacheffe.
Format: 2 short paragraphs + 3 tasting-note bullets. 90 words max.
Constraints: don't use "the best", "premium", or sommelier jargon.
Tone example: "Sweet, citrusy, and easy to drink. Perfect for your first
pour-over at home."

You don't always need all five blocks. For simple tasks, context + intent + format is enough. Examples and constraints get added when the model starts to drift.

Pro Tip: When a result disappoints you, don't rewrite the whole prompt. Spot which block was missing (format? a constraint?) and add just that one. Iterating block by block is much faster than rewriting from scratch.

When to use it / when not to

Use the full anatomy when:

  • You need a repeatable result you'll reuse or document.
  • The output feeds another tool or process (code, design, data).
  • You already tried a short prompt and the model drifted.

You don't need to break out every block when:

  • It's a one-off exploratory question.
  • You're brainstorming and want variety, not precision.
  • The task is trivial and the model already nails it without extra context.

// related