learnaiwithrafa
ClaudePrompts

The Anatomy of a Prompt That Actually Works

Stop collecting magic phrases. A reliable prompt has five parts, and once you can name them you can debug any bad output in seconds.

3 min read2 sources
  • #prompting
  • #fundamentals

People treat prompting like collecting cheat codes — a folder of "god-tier" phrases they paste and hope. That is backwards. A good prompt is not a magic spell, it is a brief. And every good brief has the same five parts.

Once you can name the parts, you stop guessing. A weak output is almost always a missing part, and you can point straight at it.

The five parts

PartQuestion it answersSkip it and you get
RoleWho should the model be?Generic, average-of-the-internet answers
TaskWhat exactly do you want?Confident answers to the wrong question
ContextWhat does it need to know?Plausible but irrelevant output
FormatHow should the answer look?A wall of text you have to reshape
ConstraintsWhat are the limits and rules?Output that ignores your real boundaries

Putting it together

Here is the difference in practice. The weak version:

Write me a product update email.

The version that works:

You are a product marketer writing to existing B2B customers.
Write a release-note email for our new SSO feature.
Context: audience is technical admins; tone is calm and direct;
the feature is opt-in and free on all plans.
Format: subject line, 120-word body, one bullet list of 3 benefits,
one clear call to action.
Constraints: no hype words, no exclamation marks, UK spelling.

Why this beats memorizing tricks

The reason structure beats magic phrases is in how these models actually work. Anthropic's interpretability research shows the model is assembling an answer from the context you give it — not retrieving a stored response keyed to a special word. So the gains come from giving it better material to assemble from, which is exactly what the five parts do.

This week

Take the last prompt that disappointed you. Do not rephrase it. Instead, label which of the five parts it was missing, add only that part, and run it again. You will be surprised how often one missing line was the whole problem.

Sources