Skip to content

Guide · 4 min read

Prompt engineering basics: how to get reliably good answers from AI

AI Tool Garage editors·

Most disappointing AI answers come from prompts that leave too much unsaid. The model fills the gaps with safe, generic guesses. Prompt engineering sounds technical, but for everyday use it mostly means briefing the model the way you'd brief a smart new colleague: who they're writing for, what you already know, what you want back and what good looks like. This guide gives you a simple structure, a way to improve prompts that aren't working, and tips for getting output in a format you can paste straight into a spreadsheet or app.

The five parts of a good prompt

PartWhat to includeExample
RoleThe perspective or expertise you wantYou are an experienced B2B copy editor.
ContextBackground the model can't guess: audience, goal, constraints, source materialThis email goes to existing customers who haven't logged in for a while.
TaskOne clear instruction with a verbRewrite the email below to be shorter and friendlier.
FormatLength, structure, tone and output shapeUnder 120 words, plain text, a subject line plus three short paragraphs.
ExamplesOne or two samples of what good looks likeHere's an email from us that performed well: …

You don't need all five every time. A quick question needs only the task. But when an answer misses the mark, the missing piece is almost always one of these, and context is the usual culprit. The model can't know your audience, your product or the decision you're trying to make unless you say so.

Habits that make a big difference

  • Put long material first and the question last. Paste the document, then ask about it.
  • Separate instructions from content. Use headings, quotes or labelled sections so the model can tell your request from the text it's working on.
  • Say what to do, not only what to avoid. “Use short sentences” works better than “don't be wordy”.
  • Ask for reasoning on hard problems. Asking the model to work through the steps, or to list its assumptions first, often improves the answer.
  • Give permission to say “I don't know”. Telling the model to flag missing information reduces confident guessing.
  • Ask for sources and check them. When facts matter, request quotes from your documents or citations, then verify a few.

Iterate like an editor

Good prompts are rarely written in one go. Treat the first answer as a draft and your prompt as something you edit. When an answer is off, work out why before rewriting everything: was it the wrong audience, the wrong length, missing facts or a misunderstood task? Change one thing at a time so you know what helped.

  1. Run the prompt and read the answer critically.
  2. Name the problem in one sentence (“too formal”, “ignored the pricing section”).
  3. Fix the prompt, not just the answer. Add the missing context or constraint.
  4. Re-run with the same input and compare.
  5. When it works, save it as a template so you don't start from scratch next time.

You can also ask the model to critique its own work: generate a draft, ask it to review the draft against your criteria, then ask for a revision. This critique-and-revise loop is one of the most reliable ways to lift quality without writing a longer prompt.

Getting structured output

If you plan to paste the answer into a spreadsheet, a database or code, ask for a fixed structure. JSON is the most common choice because tools can read it directly. Describe the exact fields, give a small example, and tell the model to return only the structure with no extra commentary.

A structured-output prompt

Extract every product mentioned in the review below. Return only JSON in this shape, with no other text: [ { "product": "string", "sentiment": "positive | neutral | negative", "quote": "string" } ] If a field is unknown, use null. Review: """ <paste review here> """

Many AI platforms also offer a structured-output or JSON mode in their developer tools, which enforces the format rather than just requesting it. Either way, check the result before relying on it: our JSON validator points to the exact line of any error, and the schema validator checks the fields match what you asked for.

When you're ready to go further

If you're building prompts into a product, move from trial and error to testing. Developer playgrounds such as the Claude Console, Google AI Studio and the OpenAI Playground let you try prompts with exact settings. Promptfoo runs a set of prompts against test cases so you can catch regressions, and DSPy goes further by optimising prompts automatically against a metric. For learning, the Prompt Engineering Guide and Learn Prompting are thorough, free references.

Once a prompt works, keep it. A small library of tested prompts, or an agent skill that packages one, saves more time than any clever new technique.

Put it into practice

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Written by the AI Tool Garage editors. Tool details link to their catalogue pages, which are refreshed weekly; spotted something out of date? Tell us.