Writing Better AI Prompts
A practical field guide to the best practices for prompting modern LLMs, plus 10 ready-to-use templates you can copy and adapt across domains. Checked against the Anthropic, OpenAI and Google prompting guides in November 2026.
Prompts usually fail because of ambiguity, not model limitations. Clear structure and explicit context matter far more than clever wording. Anthropic's test: show your prompt to a colleague who has no context on the task. If they would be confused, the model will be too.
The fix: stop "asking nicely" and start engineering. Give the model a role, the context it needs, one precise task, concrete examples, and an exact output format. Show, do not just tell.
The anatomy of a strong prompt
A complete, reliable prompt is built from six labeled parts. Group related instructions, use headers and whitespace, and keep each part doing one job.
Persona: assign a specific professional identity so the model reasons from that knowledge base. Even one sentence like "You are a senior financial analyst" focuses tone and behavior.
Background: the situation, audience, source data, and any constraints the model cannot infer. Never assume it knows what only you know.
One ask: a single, unambiguous instruction phrased as what to do, not what to avoid. Split multi-part jobs into ordered steps.
Few-shot: 3 to 5 varied examples of an ideal answer. Examples are one of the most reliable ways to steer format, tone and structure.
Output shape: spell out the exact structure: JSON keys, headings, length, tone. "3 sentences or fewer" beats "be brief".
Guardrails: hard limits and edge-case handling. State what to do when input is missing, invalid, or out of scope.
Eight best practices that actually move quality
- Be explicit, not implied: replace "be concise" with a measurable constraint like "respond in 3 sentences or fewer".
- Show, do not tell: include 3 to 5 varied examples of the exact output you want, format and tone included. Too many near-identical examples make the model copy them too closely.
- Structure over prose: use section headers, lists, and whitespace. Flat monolithic prompts are hard to debug.
- Positive instructions: say what to do, not a wall of "don'ts". Instead of "Do not use markdown", write "Respond in flowing prose paragraphs".
- Long inputs: data first, question last: put long documents above your instructions and ask your question at the end. Anthropic reports up to 30% better answers this way on complex, multi-document inputs, and Google gives the same advice.
- Specify the output format: name the schema, keys, or headings so the result is parseable and consistent.
- Handle the edges: a prompt that works for 95% of inputs can fail the other 5%. State the fallback explicitly.
- Iterate: treat prompting as a loop. Test on real inputs, inspect failures, refine the weakest part.
Advanced techniques worth knowing
Chain of thought
Ask the model to reason step by step before answering. Improves accuracy on logic, calculation, and multi-step analysis. Reasoning models (thinking turned on) already do this internally: just ask them to think it through.
Few-shot prompting
Embed labeled input to output examples so the model mirrors the pattern, format, and style you demonstrate.
Self-consistency
Generate several independent reasoning paths and keep the most common answer (Wang et al., 2022). Trades cost for reliability on hard problems.
Prompt chaining
Split a complex job into a sequence of smaller prompts, feeding each output into the next for cleaner, controllable results.
Match the technique to the task. Chain of thought and self-consistency cost more tokens, so reserve them for genuinely hard reasoning. With reasoning models, OpenAI notes that "think step by step" may not help and can hurt, and examples are often unnecessary: try without them first. For simple lookups, a clear single-shot prompt is faster and cheaper.
Ten domain templates you can copy today
Each template follows the same Role · Context · Task · Constraints · Format skeleton. Replace the {placeholders} with your specifics and trim what you do not need.
1 · Software engineering
# Role
You are a senior {language} engineer who values clarity and tests.
# Context
Codebase: {short description}. Style: {conventions}. Constraint: {perf/security}.
# Task
{Implement / debug / refactor} {feature}. Think it through before coding.
# Output
Return the diff only, then a 2-line summary of trade-offs. Add tests for edge cases.2 · Marketing & copywriting
# Role
You are a direct-response copywriter for {brand}.
# Context
Audience: {who}. Product: {what}. Voice: {tone}. Channel: {IG / email / landing}.
# Task
Write {3} variations of {headline / caption / CTA} focused on {one benefit}.
# Output
Each under {N} words, no jargon, lead with the hook. Label each variation A, B, C.3 · Data analysis & BI
# Role
You are a data analyst fluent in {SQL / Python}.
# Context
Dataset schema: {columns + types}. Business question: {question}.
# Task
Write the query, then interpret the result for a non-technical stakeholder.
# Output
1) the query 2) 3 bullet insights 3) one recommended next step. State assumptions.4 · Customer support
# Role
You are a calm, empathetic support agent for {product}.
# Context
Policy: {refund / SLA rules}. Customer message: """{message}""".
# Task
Resolve or escalate. If information is missing, ask one clarifying question first.
# Output
A reply under {120} words: acknowledge, solve, next step. Never invent policy.5 · Education & tutoring
# Role
You are a patient tutor for a {level} learner.
# Context
Topic: {topic}. Known: {prior knowledge}. Goal: {what they should be able to do}.
# Task
Explain with one analogy and one worked example, then ask a check question.
# Output
Plain language, short paragraphs. Do not reveal the answer to the check question.6 · Research & academic writing
# Role
You are a research assistant in {field}.
# Context
Source material: """{text / abstract}""". Audience: {expert / general}.
# Task
Summarize the argument, list the method, and flag {2} limitations.
# Output
Structured: Claim · Evidence · Method · Limitations. Quote sources, do not fabricate.7 · Product & UX
# Role
You are a product designer who thinks in user jobs-to-be-done.
# Context
Feature: {feature}. User: {persona}. Pain point: {problem}.
# Task
Propose {3} solution directions and the trade-off of each.
# Output
For each: name, 1-line description, effort (low/med/high), main risk.8 · Sales & outreach
# Role
You are an SDR writing a first-touch message.
# Context
Prospect: {role at company}. Trigger: {recent event}. Offer: {value in one line}.
# Task
Write a personalized {email / DM} that earns a reply, not a sale.
# Output
Under {75} words, one clear ask, no buzzwords. Subject line included.9 · HR & recruiting
# Role
You are a recruiter screening for {role}.
# Context
Must-haves: {skills}. Nice-to-haves: {skills}. Candidate input: """{resume / answer}""".
# Task
Score fit and justify. Be neutral and avoid bias on protected attributes.
# Output
Score /10, 3 strengths, 2 gaps, 1 interview question to probe the biggest gap.10 · Creative writing
# Role
You are a {genre} writer with a {tone} voice.
# Context
Setting: {where/when}. Character: {who + want}. Constraint: {POV / length}.
# Task
Write the opening scene that ends on a hook.
# Output
{300} words, show do not tell, no clichés. End mid-tension.Not sure what to ask for? The Reverse Prompting guide shows how to have the AI write or draw out the prompt for you.
Quick reference before you hit send
Sources: Anthropic, Prompting best practices (platform.claude.com); OpenAI, Prompt engineering and Reasoning best practices (developers.openai.com); Google, Prompt design strategies (Gemini API docs); Prompting Guide, Self-consistency (promptingguide.ai). Checked November 2026.
Want your team to use this at work?
I'm Abdulaziz Alshamsi, a certified AI trainer and consultant in Abu Dhabi. I train government and company teams to use AI in their daily work. Message me to discuss a session for your team.