Prompt engineering is the skill of writing better instructions for an AI chatbot. The model does not change. The words you give it change, and the answer changes with them. A vague prompt gives a vague answer. A clear prompt with examples, context and a format gives an answer you can use. This guide covers the basics that work for Claude, ChatGPT and Gemini alike.
You do not need a course or a special tool. You need five habits, and you can practise all five in one afternoon.
Rule 1: be specific about the goal
Anthropic's prompt engineering guidance starts before the prompt itself: define what success looks like, and find a way to test it. If you cannot say what a good answer looks like, the model cannot guess it either.
Compare these two prompts. Weak: "Write about my shop." Strong: "Write a 100-word product text for my online shop. The product is a handmade ceramic mug, price 24 euros, dishwasher safe. The reader is a gift buyer. Friendly tone, one headline, no exclamation marks."
The strong prompt names the task, the facts, the reader, the length and the tone. Every detail you add removes one guess from the model. If the answer is still wrong, the missing detail is usually in your prompt.
Rule 2: give examples
Examples are the fastest way to show the model what you want. Anthropic lists examples, also called few-shot prompting, among the core techniques, next to clarity, XML structuring, role prompting and prompt chaining. OpenAI gives the same advice: combine few-shot examples into a short block your team can scan and update.
If you want product texts in a certain style, paste two examples you like and write: "Write in this style." If you want a summary at a certain length, paste one summary you like and write: "Summarise like this, in the same length." Two good examples beat ten lines of description.
Keep examples short. One or two is enough for most tasks. Long example lists eat the context window and slow the answer down.
Rule 3: add context and the format
A prompt without context forces the model to invent the missing facts. Give the background in a short block at the start: who the text is for, what has happened so far, which facts are fixed. Then ask for the format you want: a table, a list, three versions, a headline plus two sentences.
Structure helps. Anthropic recommends XML tags to separate the parts of a prompt, such as , and . The model reads the tags and keeps the parts apart, which matters for long prompts with files attached.
Role prompting also helps. "You are an editor for a small business blog" sets the tone and the standard in one line. Put the tone and role guidance in the system message where the tool allows it, and keep the task details and examples in the user message, as OpenAI recommends.
Rule 4: break big tasks into steps
A big task in one prompt usually gives a messy answer. Break it into steps, and let each step use the result of the last one. Anthropic calls this prompt chaining, and it is one of the core techniques in its guidance.
Instead of "Write my whole business plan," try three prompts. First: "List the five sections a business plan for a bakery needs." Second: "Draft section one, the market, in 150 words, for Halifax." Third: "Turn the draft into a table with costs and dates." Each step is easy to check, and a mistake in step one does not ruin step three.
Chaining also works for code, research and study plans. Ask for an outline first, approve it, then ask for one section at a time.
Rule 5: test, compare and keep what works
Anthropic is clear on this point: define success criteria first, then test your prompt against them. A prompt is not finished when it works once. It is finished when it works three times in a row on different inputs.
Keep a small library of prompts that work. When a prompt gives a good result, save it with the task it solved. OpenAI makes the same point for teams: treat prompts as application code, store them in versioned files, and review prompt changes in the same pull requests as the product behaviour they change.
Test the same prompt on two models when the answer matters. Claude and ChatGPT will give different answers to the same words, and the comparison often shows which part of your prompt is unclear.
Mistakes that waste your time
The most common mistake is asking one vague question and blaming the model for the vague answer. The second is pasting a huge document with no question at all: the model does not know whether you want a summary, a critique or a translation. The third is accepting a long answer without reading it. Check names, dates and numbers against a source you trust.
Do not paste passwords, private keys or sensitive personal data into any AI chat. Do not ask for facts the model cannot know, such as today's private company numbers, and then complain that it guessed. Give it the source text, or check the answer yourself.
A template you can copy
Use this shape for most tasks:
Role: You are [who the model should be]. Task: [what to do, in one sentence]. Context: [the facts, the reader, the background]. Format: [table, list, length, tone]. Example: [one example of the style you want, if you have one].
Fill in the five lines, send it, and read the answer with the same care you would give a colleague's draft. Prompt engineering is not a trick. It is clear writing, aimed at a reader that does exactly what you wrote.




