A prompt is any instruction you give to an AI model. It can be a single sentence or several paragraphs. Prompt engineering is the practice of writing prompts that consistently produce the output you actually want. It matters because two people using the same AI tool can get dramatically different results depending on how they phrase their request.
This guide covers the core techniques that work across all major LLM-based tools — ChatGPT, Claude, Gemini, Jasper, and others.
The anatomy of a good prompt
Most effective prompts contain some combination of these four elements:
- Role — what persona or expertise the model should adopt
- Task — what you want it to do, stated precisely
- Context — background information that shapes the output
- Format — how you want the response structured
You don't always need all four. A short creative task might only need the task element. A complex business document might need all of them.
Technique 1 — Be specific about the output
Vague prompts produce vague results. Specificity forces the model to make the right assumptions instead of guessing.
- Weak: "Write something about AI."
- Strong: "Write a 150-word product description for an AI writing tool, targeted at marketing managers at mid-size B2B SaaS companies. Tone: professional but direct. Avoid buzzwords like 'revolutionary' or 'game-changing'."
Specifics to include: length (word count, number of bullet points), audience, tone, what to avoid, and what format the output should take.
Technique 2 — Assign a role
Telling the model to act as a specific expert shifts its response style significantly.
- "You are a senior copywriter at a direct-response agency..."
- "Act as a sceptical editor reviewing this for factual accuracy..."
- "You are a Python developer with 10 years of experience in data pipelines..."
Role prompts work because the model learned from vast amounts of domain-specific text written by those types of experts. By naming the role, you activate the relevant patterns in its training data.
Technique 3 — Few-shot examples
Instead of describing what you want, show it. Include one or two examples of the output format you're looking for, then ask for a new one in the same style.
Example prompt:
I need product taglines in this style:
Product: ElevenLabs → Tagline: "Any voice. Any language. Instantly."
Product: Midjourney → Tagline: "Imagine it. Then see it."
Now write a tagline for: Jasper AI (AI writing assistant for marketing teams)
Few-shot prompting is particularly powerful for tasks with a specific format or stylistic requirement that's hard to describe in words.
Technique 4 — Chain of thought
For complex reasoning tasks, asking the model to "think step by step" before giving a final answer significantly improves accuracy. This works because it forces the model to surface intermediate reasoning rather than jumping directly to a conclusion.
Simply add: "Think through this step by step before giving your answer."
This technique is especially effective for: debugging code, analysing arguments, making decisions with multiple criteria, and mathematical reasoning.
Technique 5 — Constrain what you don't want
Negative constraints are as important as positive ones. If you know the model tends to produce a certain type of unwanted output, explicitly forbid it.
- "Do not start the email with 'I hope this message finds you well.'"
- "Do not suggest consulting a lawyer — assume I have already done so."
- "Do not use bullet points — write in flowing paragraphs."
- "Do not repeat information from the previous paragraph."
Common mistakes
- Too much context, too little direction. Dumping 2,000 words of background without a clear task confuses the model. Lead with the task, then provide context.
- Accepting the first output. Treat the first response as a draft. Ask the model to revise: "Make this 30% shorter", "Make the tone less formal", "The third paragraph is unclear — rewrite it."
- Assuming the model remembers previous conversations. In most tools, each conversation is independent. If context from a previous session matters, include it.
Prompt templates worth saving
Once you find a prompt structure that works well for a recurring task, save it. Most AI writing tools have a prompt library or you can keep a simple text file. A good prompt template is a reusable asset — investing 20 minutes to perfect one now saves hours of re-prompting later.
Summary
Effective prompting is less about technical knowledge and more about clarity of thinking. If you can describe what you want — to a person — precisely enough that they'd get it right on the first try, you can write a prompt that does the same. The techniques above are frameworks for achieving that precision systematically.