Practical Prompt Engineering for AI Tools
Better prompts are less about magic words and more about clear thinking. Here are the habits that reliably get more useful answers from AI tools.
Ask ten people about prompt engineering and you will hear about secret phrases and clever tricks. In practice, the biggest gains come from something plainer: treating the model like a capable new colleague who knows a lot but knows nothing about your situation. The clearer your brief, the better the work that comes back.
Start with the task, not the trick
A vague prompt produces a vague answer. "Write about marketing" gives you filler. "Write three subject lines for a launch email aimed at small-business owners who already use our free plan" gives you something you can actually use. Specificity is the single highest-leverage habit.
Give the model a role and a goal
Setting a role — "you are a careful copy editor" — nudges tone and priorities. Pairing it with a clear goal sharpens the result: what should the output achieve, and for whom? These two lines often improve quality more than any formatting trick.
Show, do not only tell
When output style matters, include an example. One sample of the format you want teaches the model more than a paragraph describing it. This is especially useful for structured outputs like tables, product descriptions, or code in your house style.
| Weak prompt | Stronger prompt |
|---|---|
| "Summarise this" | "Summarise in five bullets, each under 12 words, for a busy manager" |
| "Make it better" | "Tighten this to 80 words, keep the tone friendly, remove jargon" |
| "Write code" | "Write a Python function that validates emails and returns True or False" |
Constraints sharpen output
Limits force decisions. Tell the model the audience, the length, the reading level, the format, and what to avoid. "Explain compound interest to a teenager in under 150 words, no formulas" is a far more useful brief than "explain compound interest".
Iterate instead of restarting
The first answer is a draft, not a verdict. Reply with specific feedback: "shorter", "more concrete", "keep the second paragraph, rewrite the third". Working in steps usually beats rewriting the whole prompt from scratch.
Watch for confident mistakes
Models can state wrong facts with total confidence. Treat outputs as a first draft to verify, especially for numbers, dates, legal or medical claims, and citations. Asking the model for its sources can help, but verifying them is still your job.
A repeatable workflow
- State the task and the audience in one line.
- Add a role and the goal.
- Give an example of the format you want.
- Set clear constraints: length, tone, what to avoid.
- Review, then refine in small steps.
- Verify anything factual before you rely on it.
Break big tasks into steps
One of the most reliable techniques is to ask for a plan before asking for the work. Request an outline, review it, adjust it, then ask the model to fill in one section at a time. Working this way keeps quality high and keeps you in control, rather than accepting a long output you then have to untangle.
Know the common failure modes
Models tend to be agreeable, so they may praise a weak idea instead of challenging it. They can also drift off-brief in long conversations, forgetting constraints set earlier. And they may produce text that reads smoothly but says little. Spotting these patterns lets you correct course: ask explicitly for criticism, restate key constraints, and demand concrete specifics over generalities.
Match the effort to the stakes
Not every prompt deserves the same care. A quick question for your own thinking can be loose; a prompt whose output goes to a client deserves a precise brief, an example, and a careful review. Spending thirty extra seconds on the brief often saves several minutes of correction later, but only for work that actually matters. Learning to judge that balance is part of the skill.
The five-part skeleton
A prompt that works most of the time has five parts. You do not need all five every time — but when an answer disappoints, one of them is usually missing.
| Part | Question it answers | Example |
|---|---|---|
| Role | Who is answering? | "You are a technical editor for a developer blog." |
| Task | What exactly must be produced? | "Rewrite this paragraph for clarity." |
| Context | What does the model need to know? | "The audience is junior developers; the tone is plain." |
| Format | What shape should the output take? | "One paragraph, under 90 words, no bullet points." |
| Constraints | What must it avoid? | "No jargon, no em dashes, do not change the meaning." |
If you remember nothing else, remember that format and constraints do most of the work — and they are the two parts people skip.
A worked example
Here is the same request written three ways. The third is not longer for the sake of length: every extra line removes a decision the model would otherwise make for you.
Write a product description.
Write a product description for a stainless steel water bottle.
You are a copywriter for an outdoor brand.
Write a product description for a 750ml stainless steel water bottle.
Context: the buyer hikes on weekends and cares about weight and
whether the lid leaks in a backpack. The brand voice is plain and
dry, never salesy.
Format: one paragraph of 60-80 words, then three bullet points of
specs. Open with the problem, not the product.
Constraints: no exclamation marks, no "premium", no health claims.
Do not invent a price.
The third prompt takes ninety seconds to write and saves three rounds of editing. That trade is the whole discipline.
Templates worth keeping
These are starting points, not magic. Replace the brackets and delete any line that does not apply.
EDIT
You are a [role] editing for [audience].
Rewrite the text below so that [goal].
Keep [what must not change]. Cut it to [length].
Return only the rewritten text.
---
[text]
SUMMARISE
Summarise the text below for [audience] who will read it once,
without access to the original.
Give: (1) the main claim in one sentence, (2) three supporting
points, (3) one question the text does not answer.
No preamble. Maximum 120 words.
---
[text]
STRESS-TEST A PLAN
You are a sceptical [domain] reviewer.
Here is my plan: [plan].
List the three strongest objections to it, the assumption each one
tests, and the cheapest experiment that would show whether the
objection is real.
Rank the experiments by cost. Do not compliment the plan.
CODE
Write a [language] function that [behaviour].
Input: [shape and two examples]. Output: [shape].
Edge cases to handle: [list]. Do not add dependencies.
Include three unit tests, and no explanation outside the code.
Structured output is a prompt problem
If you need JSON, say so and show the shape. Models drift into prose when the format is implied rather than specified.
Return valid JSON only, with no markdown fence, matching exactly
this shape:
{"title": string, "risk": "low" | "medium" | "high", "reasons": string[]}
If a field is unknown, use null. Do not add fields.
Two habits make structured output reliable: give the schema before the content, and ask for null instead of a guess. The second one prevents the most common failure, which is invention.
How to tell whether a prompt is actually better
Most prompt advice is folklore. Treat it as an experiment instead.
- Fix a test set. Five to ten real inputs that represent the work, including two difficult cases.
- Write the output you would accept. Not perfect — acceptable. This is your bar.
- Change one thing at a time. Adding a role, a format and an example simultaneously teaches you nothing.
- Score blind. Strip the labels and read the outputs without knowing which prompt produced them.
- Keep the smallest prompt that clears the bar. Longer prompts cost money, latency and attention.
This is also how you catch a prompt "improvement" that only made outputs longer. Length is not quality, and models are agreeable enough to produce more of whatever you seem to want.
Match the model to the job
Two kinds of model exist for practical purposes, and the difference changes how you should write.
- Fast models answer immediately. They reward tight briefs and examples. Do not ask them to reason in five steps; they do it badly and slowly.
- Reasoning models think before answering. They reward a clear problem statement and a stated success criterion, and they punish over-specification of how to think. Give them the goal and the constraints; let them choose the steps.
The practical rule: for extraction, rewriting and formatting, use a fast model with a precise brief. For planning, diagnosis and anything with a trade-off, use a reasoning model and ask it to state its assumptions.
When the model refuses or stalls
Three fixes, in order of usefulness:
- Restate the task as a transformation. "Rewrite this paragraph" is easier to comply with than "be creative about this topic".
- Add the missing context. Most refusals are ambiguity, not policy. Say who the audience is and what the output is for.
- Ask a narrower question. Split the request into two prompts. If the second one still fails, the problem is the goal, not the wording.
A genuine policy boundary is not a wording problem. Change the approach or the tool instead of arguing with it.
The habit that outlasts the tricks
Keep a file of prompts that worked, with one line about why. Six months from now the models will have changed twice, and your file will still describe what your audience needs — the part no model update replaces.
The bottom line
Prompt engineering is mostly clear writing aimed at an unusual reader. Be specific, show examples, set limits, and iterate. Those habits will outlast any particular tool or prompt hack.
Note: AI tools change quickly. The principles here are stable, but always check your tool's current privacy and usage terms.
📚 Recommended reading
Print editions of books covered on this site that go deeper into this topic.
See all 8 books ranked in “Best AI Books for Beginners” →
Frequently asked questions
What is prompt engineering, in one sentence?
It is the practice of writing instructions precise enough that a model can do your task without guessing — closer to briefing a new colleague than to programming.
Do I need special syntax or magic words?
No. Phrases that circulate as "magic" words are mostly placebo. Clear constraints, an example of the format you want, and one change at a time will outperform any secret phrase.
What is the single highest-impact technique?
Specify the output format. Deciding the shape — length, structure, tone, what to exclude — removes the largest number of decisions the model would otherwise make for you.
Why does the same prompt behave differently in another AI tool?
Tools use different models with different defaults, context windows and safety settings. Treat a prompt as portable in intent but not in wording, and re-test it when you change tool.
Is a longer prompt always better?
No. Length helps only when it adds context the model cannot infer. Beyond that it costs money, adds latency and dilutes the instructions that matter.
How do I stop the model from making things up?
Give it the source text and tell it to answer only from that text, ask for null instead of guesses in structured fields, and verify anything numeric, legal or medical before you rely on it.