Prompting That Actually Works
Master the four mechanics of a good AI prompt - role, context, format, and examples - and learn why vague input reliably produces garbage output. Concrete before/after examples included.
TL;DR: A prompt is a spec. The model is a contractor. If your spec is vague, the output will be generic. Four ingredients - role, context, format, and examples - turn a vague request into a precise brief. Learn these four and you unlock 80% of what makes AI useful.
Why Most Prompts Fail
People treat AI like a search engine: type a fragment, expect magic. That's the wrong mental model. A language model is not reading your mind. It's pattern-matching against your words and filling in everything you left unspecified with the statistical average of all the text it trained on.
Vague input gets average output. Average output feels generic because it is - it's literally averaged from millions of examples.
The fix is not to "be more creative." It's to be more specific. Anthropic's official prompting documentation puts it plainly: think of the model as a brilliant but new employee who lacks context on your norms and workflows. The more precisely you explain what you want, the better the result.
Their golden rule: show your prompt to a colleague with minimal context on the task and ask them to follow it. If they'd be confused, the model will be too.
The Four Ingredients
Every strong prompt has some combination of four elements. You don't need all four every time, but knowing all four lets you diagnose weak prompts fast.
1. Role
Tell the model who it is before you tell it what to do. A single sentence changes everything about tone, vocabulary, and assumed knowledge.
WEAK: "Edit my bio."
STRONG: "You are a brand copywriter who works with independent creators.
Edit my bio for a creator directory. It should sound like a real person,
not a LinkedIn summary."
The role narrows the frame of reference before the task begins. Anthropic's docs show a minimal example that still works: "You are a helpful coding assistant specializing in Python." One sentence. It immediately shifts every answer toward Python idioms, Python-specific library suggestions, and Python community conventions.
Roles work because they activate a narrower slice of what the model knows - the relevant professional vocabulary, the right level of assumed knowledge, the expected communication style.
2. Context
Context is the briefing document. It answers: who is the audience, what's the purpose, what constraints exist, and what does the model need to know to not make embarrassing mistakes?
WEAK: "Write me a product description."
STRONG: "Write a product description for a portable espresso maker.
Target audience: people who travel for work and care about ritual over
convenience. Keep it under 80 words. Avoid words like 'sleek' or
'perfect for'. This goes on a Shopify product page."
Anthropic's docs make a point worth quoting directly: providing the motivation behind your instructions helps the model better understand your goals and deliver more targeted responses. They give a concrete example - instead of "NEVER use ellipses," say "Your response will be read aloud by a text-to-speech engine, so never use ellipses since it won't know how to pronounce them." The model is smart enough to generalize from the reason, not just follow the rule blindly.
3. Format
If you don't specify the output format, the model picks one. Sometimes it guesses right. Often it doesn't. Be explicit.
WEAK: "Summarize this article."
STRONG: "Summarize this article in 3 bullet points. Each bullet should be
one sentence. Use plain language - no jargon."
Format instructions can include: length (word count, sentence count, paragraphs), structure (bullet list, numbered steps, JSON, table), tone (casual, formal, blunt), what to avoid (no em dashes, no bullet points, no markdown), and reading level.
Anthropic's docs recommend a positive framing: tell the model what to do rather than only what not to do. Instead of "don't use markdown," try "write your response in flowing prose paragraphs."
For more complex or technical prompts, wrapping sections in XML tags helps the model parse your intent without ambiguity - for example, <instructions>, <context>, <format>. This is especially useful when your prompt mixes instructions with actual content you want processed.
4. Examples
Examples are the most powerful ingredient and the most underused one. Showing the model what "good" looks like is faster and more reliable than describing it in abstract terms.
This technique is called few-shot or multishot prompting. Anthropic's documentation calls it one of the most reliable ways to steer output format, tone, and structure, and recommends 3-5 examples for best results.
Here are two example product taglines in the style I want:
Example 1:
Product: Standing desk converter
Tagline: "Your back called. It said yes."
Example 2:
Product: Noise-cancelling headphones
Tagline: "Finally. Just you and the work."
Now write a tagline for: a mechanical keyboard with quiet switches.
Good examples should be relevant (close to your actual use case), diverse (varied enough that the model doesn't accidentally pick up unintended patterns), and clearly labeled so the model knows they're examples and not actual content to process. Wrapping them in <example> tags or <examples> tags is the recommended convention when writing more structured prompts.
Putting It Together: Before and After
Here's the same request, built up from weak to strong using all four ingredients.
Before
Write a tweet about my new product launch.
The model has no idea what the product is, who it's for, what platform tone is appropriate, how long the tweet should be, or whether you want hype or subtlety. It will guess - and it will guess average.
After
You are a social copywriter who works with indie makers launching on Product Hunt.
[ROLE]
My product is a browser extension that mutes AI buzzwords in Slack - words like
"leverage," "synergy," and "circle back." It's for people who are tired of corporate
speak. I'm launching today on Product Hunt.
[CONTEXT]
Write one tweet announcing the launch. Max 240 characters. No hashtags.
Dry humor - understated, not shouty.
[FORMAT]
Examples of the tone I want:
"We made a thing that does one job. Turns out, people wanted that."
"No roadmap. No investors. Just a weekend and a problem we had ourselves."
[EXAMPLES]
The second version gives the model a real brief. The output will be coherent, specific, and actually usable.
One More Thing: Explain the Why
One counterintuitive trick that consistently improves output: tell the model why you want something, not just what you want.
"Don't use bullet points" is a constraint. "Don't use bullet points - this is going in an email to a senior executive and I want it to read as a memo, not a slide deck" is a constraint with a reason. The model can now generalize: it knows to avoid anything that makes the output feel like a presentation, not just bullets specifically.
Anthropic's documentation confirms this: Claude is smart enough to generalize from the explanation, which means a well-reasoned instruction produces better results than a bare rule.
The Iteration Mindset
Good prompting is not a one-shot activity. It's a loop. Write a prompt, read the output, find the gap between what you got and what you wanted, then add specificity to close that gap.
A practical checklist after each output:
- Is the tone right? - Add or adjust the role.
- Is it missing key context? - Add the background it didn't have.
- Is the format wrong? - Be explicit about structure and length.
- Is the style off? - Add 2-3 examples of what "right" looks like.
Most prompts get meaningfully better in 2-3 iterations. Treat each output as diagnostic data, not a final verdict on whether "AI works."
Key takeaways
- Vague = averaged. Every underspecified element gets filled with a statistical average. That average is what "generic AI output" actually means.
- Role sets the frame of reference before the task begins. One sentence is enough to shift tone, vocabulary, and assumed knowledge.
- Context is the briefing. Include audience, purpose, constraints, and the why behind your rules - not just the rules themselves.
- Format prevents guessing. Specify structure, length, tone, and what to avoid - in positive terms where possible.
- Examples beat descriptions. Show 3-5 concrete examples of what good looks like. They are the most underused and most reliable technique.
- Iterate. A prompt is a spec that gets refined, not a one-time incantation.
Try this next: Once your prompts are working well individually, learn how to chain them together for multi-step workflows in Chaining Prompts for Complex Tasks.