Skip to main content
Get your AI Readiness score in 5 minutes— free, no signup, no salesperson will call.
Freistyle AI

Prompt Engineering

How to Write AI Prompts That Actually Work (2026 Guide)

A simple 5-part framework for prompts that work in ChatGPT, Claude and Gemini, plus what the latest research says actually helps.

By Dominic FreiPublished Updated 11 min read

A good AI prompt tells the tool five things: who to act as, what your situation is, exactly what you want, what the answer should look like, and what to leave out. That's the whole framework. It works in ChatGPT, Claude, Gemini and Grok, and you don't need any technical background to use it.

Most bad AI answers start with a short prompt

Type "write me an email" into ChatGPT and you'll get a stiff, generic paragraph nobody would send. Give the same tool the reader, the purpose and the length, and the first draft is often usable.

Google saw this gap in its own data. In its 2024 prompting guide for Gemini in Google Workspace, it reported that the most successful prompts averaged around 21 words, while the prompts people typically try are under nine (Google, 2024). Twenty-one words isn't much. It's roughly the two sentences of context most of us leave out.

Every detail you skip is a decision the AI makes for you, and it usually picks the safest, most average option.

Why do AI prompts fail?

Mostly because they leave too much to guesswork.

A typical first attempt looks like this: "Write me a blog post about marketing." With no audience, angle, length or format, the model falls back on advice that would fit any business on earth. Plenty of people then decide AI is overrated and close the tab.

Anthropic's prompting guide has a useful test for this. Show your prompt to a colleague who knows nothing about the task. If they'd be confused, the AI will be too (Anthropic). It's a quick check worth doing before any prompt that matters.

The 5 parts of a good AI prompt

Role, context, task, format and constraints. You won't always need all five, but the more you include, the less the AI has to guess.

After testing hundreds of prompts across ChatGPT, Claude, Gemini, Grok and OpenClaw, these are the five parts I keep coming back to. The AI companies say much the same in their own words. Google's guide uses persona, task, context and format, and OpenAI's developer guide structures instructions around identity, instructions, examples and context (OpenAI).

PartWeak versionStronger versionWhat it changes
Role"Help me write...""Act as a senior copywriter..."Tone and angle
Context"Write something for my business""I'm pitching accounting software to CFOs of 50-person firms"Fit with your audience
Task"Make it good""Write 3 subject lines under 50 characters"A clear deliverable
Format(nothing)"Bullet points, max 50 words each"Output you can use straight away
Constraints(nothing)"No jargon, the reader isn't technical"Less filler

1. Role: who should the AI be?

Starting with "You are a..." sets the tone, vocabulary and point of view. "You are a hiring manager at a tech company who has screened thousands of CVs" gets you blunter, more specific feedback than "give me feedback on my CV."

One caveat, because a lot of prompting advice gets this wrong (including an earlier version of this article). A role changes how the AI talks, not how much it knows. Researchers at Wharton's Generative AI Labs tested expert personas on six models with hard multiple-choice questions in science, law and engineering, and found no reliable gain in accuracy. Personas that implied less knowledge, such as "a toddler," often made answers worse (Wharton, December 2025).

So use a role for style and perspective. Don't count on it to make the facts more correct.

2. Context: what's your situation?

Generic prompts get generic answers. Tell the AI who you are, who the output is for, and what limits you're working with.

Weak: "I need marketing help."

Better: "I run a one-person online business selling digital courses. My audience is professionals aged 30 to 50 who want to learn AI but aren't technical. I have no ad budget and rely on email and organic social posts."

Now it won't suggest hiring a ten-person marketing team or booking a TV campaign.

If you're working from something very long, like a full contract or several reports, paste it at the top and put your question at the end. Anthropic says putting the question after long inputs improved response quality by up to 30% in its tests.

3. Task: what exactly do you want?

This is where most prompts go wrong. "Help me with my business" is a wish. A task has a clear output and a clear finish line.

Vague: "Help me write better emails."

Specific: "Rewrite my cold outreach email below so it's under 100 words, uses active voice and ends with one clear call to action. [paste draft]"

If the job has several steps, split it up. Google's guide recommends putting related tasks into separate prompts rather than cramming them into one.

4. Format: what should the answer look like?

Left alone, most AI tools answer in long paragraphs. If you want a table, a numbered list or a three-sentence summary, say so.

For example: "Structure it as (1) a three-sentence summary, (2) three recommendations as bullet points, (3) one action I can take today, and (4) the main risks in a small table."

It takes ten seconds to type and saves you reformatting the answer afterwards.

5. Constraints: what should it avoid?

Constraints set the limits: a word count, a reading level, or phrases you never want to see. Some that work well:

  • "Keep it under 200 words."
  • "Write for someone with no technical background."
  • "Skip general advice like 'know your audience'."
  • "Don't open with 'In today's world'."

Anthropic's guide adds two refinements that make constraints work better. Where you can, say what you want instead of what you don't, for example "write in flowing paragraphs" rather than "don't use markdown." And give the reason. Anthropic's own example: instead of "never use ellipses," explain that the text will be read aloud by text-to-speech software that can't pronounce them. The model then applies the rule more sensibly.

Quick Win
When an answer comes back wrong, don't start over. Tell the AI what was off and ask for another version. Google's and OpenAI's guides both treat prompting as a back-and-forth, not a one-shot request.

Add examples when the style matters

This is the step most beginners skip. If you want a particular tone or layout, show the AI what good looks like. Anthropic recommends three to five examples for best results, ideally relevant to the task and varied enough that the AI doesn't just copy one. OpenAI's guide also suggests including a handful of examples.

In practice it can be as simple as: "Here are three product descriptions I wrote and liked: [paste]. Write one in the same style for [product]."

Before and after: a real example

Before: "Help me prepare for a job interview."

What you get: tips like "research the company" and "dress professionally," which you already knew.

After:

You are a senior tech recruiter who has run hundreds of interviews for product roles. I'm interviewing for a product manager job at a mid-size software company next Tuesday. I have 5 years of project management experience and this would be my first product role. Give me: (1) the 5 questions I'm most likely to get about this career switch, with sample answers, (2) two curveball questions and how to handle them, (3) three questions I should ask them, (4) a 30-second answer to "why should a project manager become a product manager?" Keep the answers conversational, not scripted. Nothing generic, everything specific to a switch into product management.

What you get: preparation built around your situation instead of a generic checklist.

Notice where the improvement comes from. The role sets the tone, but most of the difference comes from the context and the task.

Prompting myths the research doesn't support

Tipping the AI, threatening it, being extra polite, and adding "think step by step" to newer reasoning models all made little or no reliable difference in controlled tests.

Researchers have catalogued 58 different text-prompting techniques (Schulhoff et al., The Prompt Report), so it's easy to get lost in tricks. Wharton's Generative AI Labs have tested several of the popular ones on standard benchmarks.

Offering a tip or making threats. Wharton tried offers of $1,000 and threats such as shutting the model down. The authors concluded that "threatening or tipping a model generally has no significant effect on benchmark performance" (Meincke et al., 2025).

Saying please. In an earlier report, "please" versus "I order you" swung results on individual questions by up to 60 percentage points in either direction, but the effects cancelled out across the full test (Wharton, March 2025). Be polite if you like. It just isn't a lever.

"Think step by step." It still helped older, non-reasoning models in Wharton's tests. With reasoning models it added little: gains of about 3% for two OpenAI models and a 3.3% drop for Gemini 2.5 Flash, while answers took 20% to 80% longer (Wharton, June 2025). OpenAI makes a similar point in its guide: give a reasoning model the goal, the way you'd brief a senior colleague, and give faster models explicit steps, the way you'd brief a junior one.

"You are a world-class expert" for better facts. Covered above. It helps the tone, not the accuracy.

What did hold up? Clear instructions, real context, examples, and testing a prompt more than once. In Wharton's first report, the same model gave inconsistent answers to identical prompts, which is why the authors recommend repeated testing over judging a prompt on a single try.

Check what comes back

The last step isn't part of the prompt, but it matters as much. In Microsoft's 2026 Work Trend Index, 86% of the 20,000 AI users surveyed said they treat AI output as a starting point, not a final answer (Microsoft, 2026).

Check names, numbers and facts before anything leaves your desk. And think twice before pasting client data into a chatbot (what the 2026 court rulings mean for ChatGPT privacy).

Four changes to make today

  1. Add one sentence about who the answer is for.
  2. Say what format you want.
  3. Add one constraint, with the reason behind it.
  4. If the first answer misses, ask for a second version and say what to change.

And if a prompt still isn't working, paste it into Claude or ChatGPT and ask: "Rewrite this prompt using role, context, task, format and constraints." You'll usually get a better version back that you can use straight away.

Try this prompt now

Copy this into any AI tool and fill in the brackets:

You are a productivity coach who helps busy professionals work smarter with AI tools. I'm a [YOUR JOB TITLE] and I spend too much time on [YOUR BIGGEST TIME WASTER]. I want to cut that time in half using AI. Give me: (1) one specific prompt I can use tomorrow for this task, (2) a step-by-step workflow showing where AI fits into what I already do, (3) one common mistake people make when using AI for this and how to avoid it. Keep it practical and specific, no generic productivity advice. Under 300 words.

Then compare the answer with what you get from "how can AI help me be more productive?"

Related Tool
Want 540+ ready-to-use prompts with the 5-part framework already built in? They're sorted into 18 packs and work in ChatGPT, Claude, Gemini and more. → Browse Prompt Packs

Going further

Once the five parts become a habit, the next steps are examples, prompt chaining (breaking a big job into a sequence of smaller prompts) and testing a few variations. None of it needs code.

If you want the full system, The Complete AI Prompt Design Guide for Beginners goes through it in 8 chapters, including tool-specific advice for ChatGPT and Claude.

Related reading on this site: what prompt engineering actually is, 5 prompts every entrepreneur can use daily, how lawyers are using AI prompts, ChatGPT vs Claude vs Gemini vs Grok, and why learning AI matters in 2026.

Frequently asked questions

What's the best way to write an AI prompt?

Tell the AI who to act as, give it your context, state the task clearly, say what format you want, and add any constraints. When style matters, include a few examples. If the first answer misses, follow up and say what to change.

How long should an AI prompt be?

There's no fixed length. In Google's 2024 Gemini guide, the most successful prompts averaged around 21 words, while people usually typed fewer than nine. For long documents, paste the document first and put your question at the end.

Does "act as an expert" improve AI answers?

It changes the tone and angle of the answer, not its accuracy. A December 2025 Wharton study tested expert personas on six models and found no reliable improvement in factual accuracy.

Do the same prompts work in ChatGPT, Claude and Gemini?

Yes, mostly. OpenAI, Anthropic and Google all recommend the same basics in their official guides: clear, specific instructions and enough context. OpenAI and Anthropic also recommend examples. Some details differ, so test an important prompt in the tool you actually use.

Should I say please or offer the AI a tip?

It won't hurt, but it won't reliably help. Wharton's 2025 tests found that tipping or threatening a model generally had no significant effect, and politeness effects cancelled out across the full test.

Should I tell the AI to "think step by step"?

With newer reasoning models it's mostly unnecessary. Wharton found small gains at best and answers that took 20% to 80% longer. It can still help faster, non-reasoning models with multi-step problems.

What's the difference between a prompt and prompt engineering?

A prompt is the instruction you give an AI tool. Prompt engineering is the skill of writing those instructions so they get reliable, useful results. My plain-English guide to prompt engineering goes into more detail.

Where to go from here

Writing good prompts is mostly about saying clearly what you want, the same way you'd brief a new colleague. The models will keep changing. Clear instructions, real context and good examples have held up in every tool I've tested.

Pick one prompt you use every week, rewrite it with the five parts, and compare the two answers.

If you'd like one short, practical AI note a week, The Risk Memo goes out every Tuesday.

What changed in this update (October 26, 2026)
I removed an error-reduction statistic from the original version, because I couldn't trace it to a reliable source. I also corrected the advice that a role is the single biggest improvement you can make: recent research shows a role changes tone, not accuracy. The prompt-pack count is now correct (540+), and the links point to the current official guides from OpenAI and Anthropic. New in this version: a section on examples, the research on popular prompting myths, a section on checking output, an FAQ and the full list of sources.

Researched with AI tools, written and fact-checked by Dominic.

Sources

  1. Anthropic, Prompting best practices (Claude docs)
  2. OpenAI, Prompt engineering guide (API docs)
  3. OpenAI Help Center, Prompt engineering best practices for ChatGPT
  4. Google, Gemini for Google Workspace Prompting Guide (abridged edition for SMBs and startups, September 2024)
  5. Wharton Generative AI Labs, Prompting Science Report 4: Playing Pretend, Expert Personas Don't Improve Factual Accuracy (Dec 2025)
  6. Wharton Generative AI Labs, Prompting Science Report 2: The Decreasing Value of Chain of Thought in Prompting (Jun 2025)
  7. Meincke, Mollick, Mollick and Shapiro, Prompting Science Report 3: I'll pay you or I'll kill you, but will you care? (arXiv, Aug 2025)
  8. Wharton Generative AI Labs, Prompting Science Report 1: Prompt Engineering is Complicated and Contingent (Mar 2025)
  9. Schulhoff et al., The Prompt Report: A Systematic Survey of Prompt Engineering Techniques (arXiv, v6 Feb 2025)
  10. Microsoft, 2026 Work Trend Index Annual Report (May 2026)

Last updated: