Guides3 min read
How to write better AI prompts: a step-by-step guide
The five parts of a good AI prompt, step by step, with before-and-after examples and a fill-in-the-blanks template that works with any AI.
By Ashley Ward, Founder, Loopy AI

Updated 17 November 2026. Works with ChatGPT, Claude, Gemini, Grok and any other AI chat or coding tool.
The short answer: a good prompt tells the AI five things: who it should act as, what you want, the context it needs, the rules to follow, and what the answer should look like. Add an example when you can, then improve the answer in a second message instead of starting again.
The five parts of a good prompt
Part | What it tells the AI | Example |
|---|---|---|
Role | Who to act as | "You're an experienced copywriter." |
Task | What you want, in one sentence | "Write three subject lines for this email." |
Context | What it can't guess | "It goes to customers who haven't ordered in 90 days." |
Rules | What to do and avoid | "Under 50 characters. No exclamation marks." |
Format | What the answer should look like | "A numbered list, best one first." |
You don't need all five every time. A quick question needs only the task. The more the answer matters, the more parts you add.
Step by step
- Start with the task. Write what you want in one plain sentence. If you can't, the AI can't either.
- Add the context it can't know. Who it's for, what it's about, what you've already tried. Paste the text, data or code it needs.
- Set the rules. Length, tone, words to avoid, what to leave out.
- Say what the answer should look like. A list, a table, a short paragraph, an email you can send as it is.
- Show an example if you have one. One good example beats a paragraph of description.
- Improve, don't restart. Reply with what to change: "Shorter", "More formal", "Keep number two, redo the others."
Before and after
Weak prompt | Better prompt |
|---|---|
"Write a product description." | "You're a copywriter for an online shop. Write a 60-word description of these walking boots for people who hike in the rain. Mention the waterproof lining and the grip. Friendly, no jargon." |
"Summarise this." | "Summarise this report in five bullet points for a manager with two minutes. Put the decision they need to make first." |
"Fix my code." | "This function should return the total price with tax, but it returns the price without it. Here's the code and the error. Explain the cause in one line, then show the fix." |
Common mistakes
- Too vague. "Make it better" leaves the AI guessing what better means. Say what to change.
- Missing context. The AI only knows what's in the conversation. If it matters, paste it in.
- Too many jobs at once. Ask for one thing, then the next, in the same chat.
- No format. Without one, you get whatever shape the AI picks.
- Starting again too soon. A follow-up message usually fixes the answer faster than a new prompt.
Fill-in-the-blanks template
Copy this, replace the parts in square brackets, and delete any line you don't need:
You're [role]. [Task in one sentence]. It's for [who it's for]. Here's what you need to know: [context]. Follow these rules: [rules]. Give me the answer as [format]. Here's an example of what I like: [example].
Want prompts that are already written?
The Loopy prompt library has tested prompts for coding, research, marketing, images and more, each with the parts you change marked as blanks. It's free with a Loopy account.
Frequently asked
- What makes a good AI prompt?
- A clear task, the context the AI can't guess, the rules to follow and the format you want back. Add a role and an example when the answer matters.
- Do the same prompts work in ChatGPT, Claude and Gemini?
- Mostly, yes. The five parts work with any AI chat or coding tool. Image, video and audio tools are the exception: they have their own prompt styles.
- How long should a prompt be?
- As long as it needs to be. A quick question can be one line. A task that matters needs its context and rules, which might take a short paragraph.
- What should I do if the answer is wrong?
- Reply in the same chat and say what to change, instead of starting again. The AI keeps the context, so small fixes are quick.
- AI prompts
- Prompt writing
- ChatGPT
- Claude
- Gemini

