How to Write a Good AI Prompt: 5-Part Formula (Before and After)

Most bad AI answers come from vague prompts. “Write a post about coffee” gives you a bland, generic article. Add a few details and the same tool gives you something you can actually use.

This guide shows a simple 5-part formula for writing good AI prompts, with a real before and after so you can see the difference it makes.

How we tested: both outputs below were generated with Claude in November 2026. The formula works the same way in ChatGPT and Gemini. Your exact wording will differ.

The 5-part prompt formula

  1. Role: who the AI should act as. “You are an experienced travel writer.”
  2. Task: exactly what you want. “Write an Instagram caption.”
  3. Context: the details only you know: your audience, product, goal, what already exists.
  4. Format: length, structure, tone. “Under 40 words, 2 emojis max, friendly.”
  5. Limits: what to avoid. “No hashtags, no clichés like ‘game-changer’.”

You do not need all five every time, but the more of them you include, the less editing you do afterwards.

Before and after: the real difference

The vague prompt

Write a product description for a water bottle.
Real output (vague prompt)

Stay hydrated in style with our premium water bottle. Designed for everyday use, it keeps your drinks cold for hours and hot when you need it. Durable, leak-proof and easy to carry, it’s the perfect companion for work, the gym or your next adventure.

It reads fine, but it could describe any bottle in any shop. Nothing in it would make a buyer choose this one.

The same request with the 5-part formula

You are a copywriter for a small online shop in Pakistan. Write a product description for our 1-litre steel water bottle. Context: it keeps water cold for about 12 hours, fits in a car cup holder, costs Rs 1,850, and our buyers are university students and office workers in hot cities. Format: one short paragraph of 50 to 70 words, then 3 bullet points. Tone: simple and practical. Do not use the words “premium”, “perfect” or “adventure”.
Real output (5-part prompt)

Pakistani summers are long, and warm water from a plastic bottle by noon is nobody’s idea of a break. This 1-litre steel bottle keeps your water cold for about 12 hours, so the bottle you fill in the morning is still cold after your last class or meeting. At Rs 1,850, it costs less than a few weeks of bought water.

  • Keeps water cold for about 12 hours
  • Fits most car cup holders
  • Steel body, no plastic taste

Same tool, same topic. The second answer is specific, local and ready to paste, because the prompt gave the AI the facts it could not guess.

Why each part matters

Role sets the voice

“You are a copywriter for a small shop” gives a different style from “you are a university professor”. Pick the person whose writing you want.

Context is where quality comes from

The AI does not know your price, your customers or your city. Every fact you add is one less generic sentence in the answer. If you only improve one part of your prompts, improve this one.

Format saves editing time

Ask for the length and structure you need. Otherwise you get a 400-word answer when you wanted three lines.

Limits remove the “AI sound”

Telling the tool which words to avoid is the fastest way to stop answers sounding like every other AI text.

A copy-paste template

You are [role]. [Task]. Context: [audience, product or topic details, goal, anything the AI cannot know]. Format: [length, structure, tone]. Do not [things to avoid].

3 more tips

  • Give an example. Paste one piece you like and say “write in this style”.
  • Ask for options. “Give me 3 versions” lets you pick the best and combine them.
  • Improve in the same chat. “Make it shorter” or “more formal” works better than starting again.

Frequently asked questions

Does this formula work in ChatGPT, Gemini and Claude?

Yes. All three follow detailed instructions much better than one-line requests. The formula is about giving clear information, not about any one tool.

How long should a prompt be?

As long as it needs to be to include the facts the AI cannot guess. Two or three sentences is often enough; complex tasks may need a paragraph.

Should I write prompts in English?

English usually gives the most reliable results, but you can ask for the answer in Urdu, Roman Urdu or any language by adding “Write the answer in [language]”.

See the formula in action in our 25 ChatGPT prompts for blog writing.