Hands typing a prompt into an AI chat on a laptop next to a notebook of ideas

How to Write AI Prompts That Actually Work

To write a good AI prompt, tell the AI five things: who the answer is for, what you want done, the background it can’t know, the rules it must follow, and what the answer should look like. That’s the whole method. The rest of this guide shows why each part matters, using real outputs instead of made-up examples.

On October 28, 2026, I ran three everyday requests through Claude Opus 5.5, once as a lazy one-liner and once as a proper prompt. Each prompt ran in its own fresh session, so neither version saw the other. The results weren’t what most prompt guides would predict, and they changed how I think about what a prompt is for.

The five parts of a good prompt

Part The question it answers Example
Role or audience Who is this for, or whose side is the AI on? “I run a small online bakery and I’m emailing my web designer.”
Task What exactly should it do? “Rewrite my draft email.”
Context What does it need to know that only you know? “I want to stay on good terms with him, but I need two problems fixed.”
Constraints What are the rules and limits? “Under 120 words. Don’t add facts that aren’t in my draft.”
Format What should the answer look like? “A subject line, then the email.”

Not every prompt needs all five. A quick question can be one line. But when an answer comes back wrong, one of these five is almost always missing, so the table doubles as a checklist for fixing a prompt that didn’t work.

Anthropic’s prompting guide has a useful test for this: imagine handing your prompt to a colleague who knows nothing about the task. If they’d need to ask you questions first, the AI will either ask too or guess, and a guess is where generic answers come from.

What happened when I tested weak and strong prompts

How I tested: each prompt went to Claude Opus 5.5 through the Claude Code command line, in a new session with tools switched off and a plain “You are a helpful assistant” instruction. Short outputs are quoted in full and long ones are summarized. Nothing quoted has been edited.

Request Lazy prompt result Full prompt result
Rewrite an email Good email, but 179 words with a “what changed” lecture attached 96 words, ready to send, asked for exactly what I needed
Outline a puppy-feeding post Answer buried in section IV, with cup amounts I’d never publish Answer first, no risky amounts, every section I asked for
Fix a broken website Five questions back, no fix Five numbered steps, each with a “worked if” check

Test 1: “Make this better”

The lazy version was the two words people type most, pasted above a messy draft:

Make this better.

hi tom, just checking in about the website redesign. we were supposed to get the homepage mockups last week but havent seen anything. also the invoice you sent has the wrong amount i think, it says $2,400 but we agreed $2,000. can you let me know whats going on with both. thanks

Honestly, the result was decent. It added a subject line, split the two issues into numbered points and asked Tom for a timeline. But it ran to 179 words, softened the invoice point to “my understanding is that we agreed on $2,000”, and finished with five bullet points explaining its edits, which I’d have to delete before sending.

The full prompt told it who I was, what I wanted from Tom, a word limit and the output format:

I run a small online bakery and I'm emailing Tom, a freelance web designer I've hired to redesign our website. I want to stay on good terms with him, but I need two problems fixed.

Rewrite my draft email below so it is polite, clear and firm. Rules:
- Keep it under 120 words.
- Mention both issues: the homepage mockups were due last week and haven't arrived, and the invoice says $2,400 when we agreed on $2,000.
- Ask for a specific reply: a new delivery date for the mockups and a corrected invoice.
- Don't add any facts that aren't in my draft.

Give me a subject line, then the email.

My draft: [same draft as above]

The answer, unedited:

Subject: Homepage mockups and invoice correction

Hi Tom,

I hope you're well. I'm writing about two issues with the website redesign.

First, the homepage mockups were due last week, and we haven't received them yet. Second, the invoice you sent shows $2,400, but we agreed on $2,000.

Could you please reply with:

1. A new delivery date for the homepage mockups
2. A corrected invoice for $2,000

I'd like to get both settled so we can keep the project moving. I appreciate your work on this and look forward to hearing from you.

Thanks,
[Your name]

96 words, both issues stated as facts, and a reply Tom can answer in two lines. The lazy prompt gave me a draft to edit. The full prompt gave me an email to send.

Test 2: An outline for a puppy-feeding post

The lazy prompt: Write an outline about how much to feed a puppy.

The outline looked thorough, with nine sections from “Introduction” to “Conclusion”. Two problems would have hurt the real post. First, the actual answer didn’t appear until section IV, after the intro, the factors and the feeding schedule, and someone who searched that question wants the answer first. Second, it included specific daily amounts by breed size, from “⅓–1½ cups” for toy breeds to “4+ cups” for giant breeds. Feeding amounts depend on the food’s calorie density and the individual dog, so for a pet blog that’s exactly the kind of number that should come from the food label and a vet.

The full prompt described the reader, asked for the answer first, listed the sections I wanted and said not to give gram or cup amounts:

I'm writing a blog post for first-time dog owners in the US who searched "how much should I feed my puppy". Most of them have a puppy between 8 weeks and 6 months old and are worried they're feeding too much or too little.

Create an outline for the post:
- Answer the main question in the first section, before any background.
- Then cover feeding by age, feeding by expected adult size, how many meals per day, and signs of over- or under-feeding.
- Use H2 and H3 headings.
- Tell readers to follow the feeding guide on their food bag and to ask their vet. Don't give specific gram or cup amounts.

Return only the outline.

The new outline opened with “The Short Answer: How Much to Feed Your Puppy” (start with the bag’s feeding guide, adjust by body condition, confirm with your vet) and had no cup amounts anywhere. It also added a “When to Call Your Vet” section on its own, which fits the reader. It wasn’t perfect: at 922 words it was longer than an outline needs to be, and it tacked on an optional FAQ I didn’t ask for. Next time I’d add “keep it under 300 words.”

The lesson here isn’t that the AI was careless. It had no way to know I didn’t want feeding amounts. Rules like that live only in your head until you write them down.

Test 3: “My website is broken, help.”

This one gave the clearest difference. The lazy prompt got no fix at all, just five groups of questions: what “broken” looks like, where, what the site is built with, what changed, and any error details. That’s the right response, since it can’t fix what it can’t see. But it means a whole round trip wasted.

The full prompt gave the exact error, what triggered it, my skill level and what access I had:

My WordPress site shows "There has been a critical error on this website." on every page since I updated a plugin called "Smart Slider" about an hour ago. The admin dashboard (wp-admin) shows the same message, so I can't log in. I'm not a developer, but I can open my hosting file manager.

Give me numbered steps to get the site back, starting with the safest fix. For each step, say how I'll know whether it worked. Keep it under 250 words.

Back came five numbered steps in 245 words by my count, inside the limit. They ran from checking email for WordPress’s recovery-mode link, to renaming the plugin’s folder in the file manager, to restoring a backup, each with a “Worked if:” line, plus a warning not to simply reactivate the plugin afterwards. That’s a fix a non-developer can follow. (For more on this, see fixing WordPress errors with AI.)

What the tests actually showed

  • Current models rescue vague prompts more than you’d expect: the lazy email was usable. If your prompts “work fine”, that may be why. But “fine” still meant extra editing every time.
  • The biggest gains came from information only I had: the exact error message, my reader’s worry, the fact that feeding amounts were off-limits. No model can guess those, however good it is.
  • Limits get followed: both prompts with a word limit came in under it (96 of 120, 245 of 250). The outline prompt had no limit and ran to 922 words.

Six habits that make prompts work

Say why, not just what: a reason helps the AI handle cases your rule didn’t cover. Anthropic’s guide gives the example of explaining that text will be read aloud by a text-to-speech engine, instead of just banning ellipses. “Don’t give cup amounts, because readers should follow their food label” works better than “no numbers”.

Show an example when style matters: describing a tone is hard; pasting a sample is easy. Google’s Gemini prompting guide goes as far as recommending few-shot examples in every prompt, and Anthropic suggests three to five for best results. Our guide to few-shot prompting shows how to set them up, and the same idea is how you train ChatGPT on your writing style.

Say what to do instead of what not to do: “write in short paragraphs of plain prose” steers better than “don’t use bullet points”. The AI gets a target instead of a guess.

Put long material first and your question last: when you paste a long document, notes or data, place it at the top and the instructions at the end. Anthropic reports that putting the question at the end improved answer quality by up to 30% in its tests with long, multi-document inputs.

Split big jobs into steps: a whole article from one prompt is usually worse than outline first, then section by section, then an edit. That’s prompt chaining, and it lets you catch problems early.

Give feedback it can act on: “make it better” teaches nothing. “Cut the intro, keep the second example, half the length” does. When a correction works, add it to the original prompt so you don’t have to repeat it.

How to lay out a longer prompt

When a prompt has several parts, label them so the AI can tell your instructions from your material. Plain labels work, and so do XML-style tags, which Anthropic recommends for Claude:

<notes>
[paste meeting notes here]
</notes>

<task>
Write a follow-up email to the client based on the notes above.
</task>

<rules>
1. Under 150 words.
2. List the three agreed next steps with owners and dates.
3. Only use facts from the notes.
</rules>

Numbered rules are easier for the AI to follow and easier for you to check afterwards. The material goes first and the task last, as in the habit above.

Does it change for ChatGPT, Claude or Gemini?

Less than you’d think. OpenAI, Anthropic and Google all publish prompting guides, and the core advice is the same: be specific, give context, show examples, state the format, and iterate. The differences show up in the details. Claude responds well to XML tags. Gemini’s guide leans hard on examples and on starting the answer for it (a “prefix” such as the first line of an outline). Each assistant also lets you save standing instructions so you don’t have to repeat them: custom instructions in ChatGPT, projects and styles in Claude, Gems in Gemini.

Different kinds of tools need different details, though:

Tool What to include
Chat assistants The five parts above
Image generators Subject, setting, style, lighting, composition, aspect ratio and what to leave out. See how to write AI image prompts
Coding agents The goal, which files are involved, how to test the result, and “explain your plan before editing”. See how to install Claude Code to try one
Research tools A precise question, a time frame and a request for dated sources you can check

Mistakes that waste a prompt

  • Leaving out the one fact that matters: the error message, the audience, the deadline. Test 3 shows what happens.
  • Contradictory rules: “be detailed but very short” forces the AI to pick one, and it may not pick yours.
  • No length limit: without one, answers drift long. My outline test went to 922 words.
  • Trusting facts without checking: a well-written prompt doesn’t stop AI from stating wrong numbers confidently. The cup amounts in test 2 sounded authoritative.
  • Pasting private data: keep passwords, client details and anything confidential out unless you’ve checked the tool’s privacy settings.

A template you can copy

This is the structure of the prompts that won all three tests. Fill in the brackets and delete any line you don’t need:

I'm [who you are / your situation]. This is for [audience].

[The task, in one sentence.]

Background: [what the AI can't know: facts, the goal, what went wrong].

Rules:
- [Length limit]
- [What to include]
- [What to leave out, and why]

Return [the format: a list, a table, an email with subject line, etc.].

For blog work specifically, how to write a blog post with AI walks through a full set of prompts from outline to edit.

Common questions

What is prompt engineering? It’s the practice of writing and refining instructions so an AI model gives useful, reliable answers. For everyday use it mostly means the five parts above, plus checking the result and adjusting.

How long should a prompt be? Long enough to include what the AI can’t know, and no longer. My winning prompts were 82 to 167 words, the longest because it included the pasted draft. A simple question needs one line.

Do phrases like “act as an expert” help? A role can set tone and depth, but in my tests the gains came from facts and rules, not titles. “I’m not a developer, but I can open my file manager” did more than “act as a WordPress expert” would have.

Is there one best prompt for ChatGPT? No. There’s a best structure, and it works the same way in ChatGPT, Claude and Gemini: audience, task, context, constraints, format.

Similar Posts