How to Write Effective AI Prompts (Step by Step)
A guide to Phase 1 — Define the Task Before You Type, Phase 2 — Add Context, Limits and Examples, Phase 3 — Specify the Output and Behaviour, Phase 4 — Test, Fix and Reuse
Most disappointing AI answers come from vague instructions, not weak models. This guide turns a loose request into a precise prompt in 28 concrete steps, covering the role, the context, the constraints, one good example and the exact output format. We test small and change one variable at a time, so you learn which words actually moved the result instead of guessing. Work through it once and you will leave with a short library of reusable prompts rather than an empty text box every time you sit down. Browse all illustrated guides or the Artificial Intelligence category for more illustrated walkthroughs on Howcompass.
How do you write Effective AI Prompts (Step by Step)?
Howcompass | How to Write Effective AI Prompts (Step by Step)Phase 1 — Define the Task Before You Type
HowcompassWrite the desired result in one sentence
Write the desired result in one sentence. Finish this: 'I want a _ that _ for ___.' A sentence like 'a 200-word email that declines a meeting politely' is checkable; 'help with email' is not. If you cannot state the outcome, the model cannot hit it. For the primary source behind this phase, see Anthropic — AI research and documentation.
HowcompassChoose the right model and mode
Choose the right model and mode. Use a fast model for rewriting and sorting, and a reasoning-focused one for analysis, maths or long planning. Match the tool to the job before spending effort on wording.
HowcompassName the task type explicitly
Name the task type explicitly. Start with a verb: summarise, classify, compare, draft, critique or extract. Stating the operation stops the model from answering a slightly different question than you intended.
HowcompassDecide the audience and the voice
Decide the audience and the voice. Say who will read it and how it should sound — 'a busy clinic manager, plain and reassuring'. Audience and tone are among the highest-leverage words you can add, and they are easy to forget.
HowcompassAssign one specific expert role
Assign one specific expert role. Open with 'You are a pediatric nurse educator' rather than 'You are an expert'. A narrow role pulls the right vocabulary and level of detail; a vague one produces generic prose.
HowcompassState what that role should not do
State what that role should not do. Add a line like 'Do not invent citations or medical advice.' Negative boundaries prevent the most damaging failures, especially where accuracy or safety matters.
HowcompassSet the scenario in a single line
Set the scenario in a single line. Give the situation in one sentence: 'I am replying to a client who is unhappy about a delay.' A little context removes dozens of assumptions the model would otherwise fill in on its own. Related on Howcompass: plan a holiday dinner.
Phase 2 — Add Context, Limits and Examples
HowcompassPaste the source material it must use
Paste the source material it must use. Include the actual notes, contract or data between clear markers such as triple quotes. When the answer must be grounded in your material, saying 'use only the text below' is far safer than hoping it remembers. For the primary source behind this phase, see NIST — AI Risk Management Framework.
HowcompassDefine any specialist terms
Define any specialist terms. If a word has a company-specific or technical meaning, spell it out in a short glossary line. Models guess at jargon, and one wrong guess can derail an otherwise sound answer.
HowcompassList the hard constraints
List the hard constraints. Write each limit as its own short line: word count, banned phrases, required terms, date range, reading level. Separate constraints are easier for a model to satisfy than a long sentence packed with conditions.
HowcompassSay what to do when a fact is missing
Say what to do when a fact is missing. Add 'If you need a figure I have not given, ask me before continuing.' This turns a silent invention into a visible question, which you can answer in one reply. Browse all illustrated guides or the Artificial Intelligence category for more.
HowcompassShow one answer you would be happy with
Show one answer you would be happy with. A single real example of the style and depth you want does more than a paragraph of adjectives. Examples set an implicit pattern for structure, tone and detail all at once.
HowcompassShow one answer to avoid
Show one answer to avoid. Include a short counter-example marked 'do not write like this', and name the flaw — too formal, too long, invented numbers. Contrast is a quick way to remove a habit you keep getting back.
HowcompassMark the exact pattern to copy
Mark the exact pattern to copy. If the format matters, bracket the repeated structure: '[Date] — [Issue] — [Action]'. Pointing out the pattern tells the model what to reproduce rather than what to merely take inspiration from. Related on Howcompass: change your car's oil.
Phase 3 — Specify the Output and Behaviour
HowcompassName the exact output format
Name the exact output format. Ask for 'a JSON object with keys title, summary and tags' or 'a three-column Markdown table'. A named format is unambiguous and makes the result usable in the next tool without reformatting. For the primary source behind this phase, see Microsoft Learn.
HowcompassSet the length and structure
Set the length and structure. Give a word range and the section order: 'under 250 words, with a heading, three bullets and a one-line close.' Both numbers and sequence are checkable, so you can tell at a glance whether it complied.
HowcompassChoose the level of detail
Choose the level of detail. Say 'explain it as if to a new hire, with no jargon' or 'give me the technical detail and skip the introduction'. Without this, the model picks a default that often misses your reader.
HowcompassAsk for sources or a short rationale
Ask for sources or a short rationale. Request 'a one-line reason under each recommendation' or 'cite the section of the document you used'. A stated basis makes the answer auditable and easier to trust or challenge.
HowcompassAsk it to ask clarifying questions first
Ask it to ask clarifying questions first. End with 'Ask me up to three questions before you answer.' For ambiguous tasks this one line prevents a confident answer to the wrong problem and costs you nothing.
HowcompassRequest a draft before the final version
Request a draft before the final version. For longer work, ask for an outline or first draft to approve before it writes the whole piece. Reviewing a skeleton is faster than rewriting three thousand words that went the wrong direction.
HowcompassTell it to flag uncertainty
Tell it to flag uncertainty. Add 'Mark anything you are not sure about with [verify].' Honest uncertainty is far more useful than smooth confidence, and it tells you exactly which claims to check elsewhere. Related on Howcompass: plan a holiday dinner.
Phase 4 — Test, Fix and Reuse
HowcompassRun a short test before the real job
Run a short test before the real job. Try the full prompt on one small, representative input first. A two-minute test exposes a missing constraint before you apply it to a hundred records or a document you cannot redo. For the primary source behind this phase, see Mozilla — web and browser resources.
HowcompassCheck it against written success criteria
Check it against written success criteria. Judge the output against the outcome, format and constraints you wrote in Phase 1, not a vague feeling. Three explicit checks — correct, complete, right shape — keep the edits objective.
HowcompassChange only one variable at a time
Change only one variable at a time. If the result is off, edit a single thing — add one constraint, or swap one example — and rerun. Changing five words at once makes it impossible to know which fix actually worked.
HowcompassReplace the vague word that failed
Replace the vague word that failed. Words like 'good', 'professional' and 'concise' are interpreted differently every time. Swap them for something testable — 'under 120 words' or 'no passive voice' — and the result steadies immediately.
HowcompassAdd the single missing constraint
Add the single missing constraint. Look at what the output got wrong and turn it into one new line in the prompt. Each corrected failure becomes a permanent guardrail rather than a one-off edit to the answer.
HowcompassSave the working prompt as a template
Save the working prompt as a template. Copy the version that passed into a note and bracket the parts that change, such as [AUDIENCE] and [SOURCE TEXT]. A saved template turns a twenty-minute puzzle into a two-minute fill-in.
HowcompassBuild a small prompt library
Build a small prompt library. Keep templates grouped by task — summaries, emails, extraction, review — with a one-line note on what each is for. After a dozen entries you will reuse good prompts instead of starting from scratch. Related on Howcompass: change your car's oil.
Frequently Asked Questions
Question: Do longer prompts always work better?
No. Length helps only when it adds relevant context, constraints or an example. Padding a prompt with background the model does not need can dilute the important instructions and raise the chance of a missed detail.
Question: Why does the same prompt give different answers?
Generative models sample from possibilities, so identical wording can vary between runs. Reduce drift by pinning down format, adding an example, and keeping a saved copy of the version that produced a good result.
Question: Can a prompt stop the model from inventing facts?
It can help a lot but cannot guarantee it. Supply the source text, say 'use only this material', and ask it to mark uncertain claims as [verify]; then check anything important against a primary source.
Warnings
- Asking something vague: 'Make this better' gives the model no direction to improve toward. State the outcome, the reader and at least one measurable constraint so there is something concrete to be right or wrong about.
- Never giving an example: A single sample of the tone and structure you want removes more ambiguity than several paragraphs of description. Add a counter-example too when there is a specific habit you keep needing to correct.
- Changing everything after a bad answer: Rewriting the whole prompt hides which edit fixed the problem. Change one variable, rerun on the same input, and keep the version that improved the result.
References (4)
- Anthropic — AI research and documentationanthropic.com
- NIST — AI Risk Management Frameworknist.gov
- Microsoft Learnlearn.microsoft.com
- Mozilla — web and browser resourcesmozilla.org
Sources are listed so you can read the underlying guidance yourself. Our editorial policy explains how guides are reviewed.
Did this article help you?
0 readers found this helpful — add your vote.


No comments yet — be the first to share your results.