Reliable AI prompts do more than ask a question: they define the task, provide the right context, set boundaries, and make the desired result easy to verify. This practical prompt engineering guide gives you a repeatable framework for turning vague requests into clear AI instructions, with scenario-based checklists, before-and-after examples, and a review process you can reuse as your tools and workflows change.
Overview
Prompt quality is usually less about finding a clever phrase and more about removing avoidable ambiguity. An AI model may produce a fluent answer even when the request is incomplete, but fluency does not guarantee accuracy, consistency, or usefulness. A strong prompt makes the intended job explicit and gives the model enough information to perform it within defined limits.
Use this six-part structure when you do not know how to write an AI prompt:
- Task: State the action the model should perform.
- Context: Provide the background, source material, audience, or operating situation.
- Constraints: Define what the response must include, avoid, or assume.
- Process: Describe useful criteria or stages without demanding hidden reasoning.
- Output: Specify the format, structure, length, and tone.
- Checks: Explain how uncertainty, missing information, or invalid input should be handled.
These elements can be written as headings, bullets, or short paragraphs. The format matters less than the clarity. For repeatable work, separate fixed instructions from changing input so the prompt can become a reusable template.
For tasks that require examples, see the guide to choosing and testing few-shot examples. If the output will be consumed by software, a structured response is usually easier to validate than free-form prose; the structured output prompts guide covers that pattern in more detail.
Checklist by scenario
For general questions and research
- State the exact question or decision you need help with.
- Describe your audience and current level of knowledge.
- Identify the time period, location, domain, or source boundary if relevant.
- Ask the model to distinguish known information, assumptions, and uncertainty.
- Request a format that supports review, such as a comparison table, ranked options, or a short briefing.
Template:
Act as a research assistant for [audience].
Answer this question: [question].
Use only the information in [provided sources or defined scope].
Separate facts from assumptions and flag information that cannot be verified.
Return: [format], using [length and tone].
For summarizing or transforming text
- Identify the source text with clear delimiters.
- Specify whether the goal is compression, extraction, rewriting, classification, or translation.
- Define what must be preserved, such as names, dates, figures, caveats, or technical terms.
- Set a target length or structure.
- Tell the model what to do when the source does not contain the requested information.
Template:
Summarize the text between <source> and </source> for [audience].
Preserve [specific facts, qualifications, and terminology].
Do not add information that is not present in the source.
Return three sections: key points, open questions, and a one-sentence summary.
Target length: [limit].
<source>
[paste text]
</source>
For coding and AI development
- Name the language, framework, runtime, and relevant version assumptions.
- Describe the current behavior, desired behavior, and error or failure case.
- Include the smallest useful code sample, schema, or log excerpt.
- Define constraints such as compatibility, performance, security, or dependencies.
- Ask for tests, edge cases, and a short explanation of the proposed change.
Template:
Help me modify this [language/framework] code.
Current behavior: [behavior].
Desired behavior: [behavior].
Constraints: [compatibility, dependencies, security, or performance requirements].
Return:
1. The revised code.
2. Tests for normal and edge cases.
3. A brief explanation of the change.
If the requirements are ambiguous, list the assumption before writing code.
For text-to-SQL work, add the database schema, permitted tables, expected result shape, and a validation step rather than asking for a query in isolation. The text-to-SQL prompting guide provides a more specialized pattern.
For classification, extraction, or automation
- Define every label or field, including what qualifies and what does not.
- Specify whether one or multiple labels are allowed.
- Provide a fallback such as
unknown,not_applicable, orneeds_review. - Require an exact output schema if another system will parse the response.
- Include representative examples, especially borderline cases.
Automation prompts should be designed for failure as well as success. If the workflow uses webhooks, agents, or downstream applications, define what happens when input is missing, a tool call fails, or the result does not pass validation. For broader workflow design, see the guide to AI workflow automation with webhooks.
Before-and-after example
Weak prompt: “Write a professional summary of this report.”
Improved prompt:
Summarize the report below for an operations manager who needs to decide whether to continue the project.
Include:
- the main outcome;
- three supporting facts;
- risks or unresolved issues;
- the recommended next action.
Use plain language, retain all figures and dates, and do not introduce claims that are absent from the report.
Limit the response to 250 words and use the headings Outcome, Evidence, Risks, and Next action.
If the report does not support a recommendation, say so explicitly.
<report>
[paste report]
</report>
The second version is more reliable because it defines the audience, decision context, required content, evidence boundary, length, structure, and uncertainty behavior.
What to double-check
Before using a prompt in a recurring workflow, review it as if you were testing a small application.
- Input clarity: Can the model tell which text is instruction and which text is data? Use delimiters and labels.
- Success criteria: Could a person judge whether the answer is correct without guessing what you meant?
- Scope: Does the prompt define what the model should not do, such as invent sources, alter figures, or exceed an authority boundary?
- Ambiguity: Are words such as “good,” “professional,” “recent,” or “brief” replaced with observable requirements?
- Output validity: If the response is JSON, a table, code, or a list, is the required structure explicit and testable?
- Edge cases: What should happen with empty input, conflicting instructions, unsupported requests, or uncertain evidence?
- Security: Could user-provided content contain instructions that conflict with the task? Treat external text as data and review prompt injection risks using the prompt injection prevention checklist.
- Consistency: Test the prompt with several normal examples and difficult examples. Look for changes in format, omissions, and unsupported additions.
When a prompt is important, keep a small evaluation set: representative inputs, expected qualities, known failure cases, and a simple scoring rubric. This makes revisions measurable instead of relying on one impressive response. The LLM evaluation test suite guide can help organize that process.
Common mistakes
Putting every instruction into one dense paragraph
Long prompts are not automatically better. Group related requirements under labels such as Task, Context, Constraints, and Output. This makes conflicts easier to spot and future edits safer.
Using contradictory requirements
“Be comprehensive,” “use no more than 50 words,” and “include every detail” cannot all be satisfied equally. Choose a priority order or explain which requirement wins when trade-offs are necessary.
Assuming the model knows hidden context
Terms familiar to your team may be ambiguous to a general model or a different AI tool. Define acronyms, audience, inputs, and the meaning of success.
Requesting certainty where the input is uncertain
A prompt should make uncertainty visible, not encourage confident guessing. Add an explicit fallback such as “state that the information is unavailable” or “mark this item for human review.”
Changing several variables at once
When improving a prompt, change one meaningful element at a time where practical. Otherwise, you will not know whether the new wording, examples, output format, or model setting caused the result to improve.
Relying on model-specific habits
Prompt behavior can vary across models, interfaces, context limits, tool support, and structured-output features. Treat a prompt as portable only after testing it in the target environment.
When to revisit
Review a prompt whenever the underlying task changes, not only when the answer looks wrong. Revisit it before a seasonal planning cycle, after changing the model or AI interface, when adding tools or retrieved documents, and whenever the audience, compliance requirements, data format, or output destination changes.
For production or team workflows, schedule a lightweight review at a sensible interval. Compare current outputs with your evaluation examples, remove instructions that no longer apply, and add any failure pattern discovered in real use. If the prompt manages a conversation or agent, also review memory, checkpoints, recovery behavior, and escalation rules; the guide to AI agent state management covers those concerns.
Use this final preflight checklist before you publish or reuse a prompt:
- Write the task in one unambiguous sentence.
- Add only the context needed to complete it.
- Define constraints, exclusions, and uncertainty handling.
- Show one or more examples if the desired judgment is difficult to describe.
- Specify the output format and validation requirements.
- Test normal, incomplete, ambiguous, and adversarial inputs.
- Record the prompt version and review it when tools or workflows change.
Start with a clear task and a small test set, then improve the prompt based on observable failures. That habit is more dependable than searching for a universal magic phrase, and it scales from everyday ChatGPT prompts to structured LLM application development.