Contact, if you are interested in this website / domain name / Sponsorship / Advertisement / Partnership

Prompt engineering guide: a practical playbook for AI

A hands-on playbook for writing prompts that get reliable, usable answers from AI assistants, with before-and-after examples.

Most disappointing AI answers are not caused by a weak model. They are caused by a prompt that left the model guessing. When you type a one-line request, the assistant has to invent the audience, the purpose, the length, the tone and the format. It usually picks the safest, most generic option, and you get a bland answer that needs heavy editing.

Prompt engineering sounds technical, but in practice it is the same skill as writing a good brief for a capable colleague who knows nothing about your situation. This guide gives you a repeatable structure, a set of techniques that work across chat assistants such as ChatGPT, Claude and Gemini, and before-and-after examples you can adapt immediately.

If you are new to how these systems generate text, read how large language models work first. It explains why context matters so much.

The four-part structure: role, context, task, format

A reliable prompt answers four questions. You do not need headings or a template every time, but checking a prompt against these four will fix most weak results.

  1. Role. Who should the model act as? "An experienced bookkeeper" or "a patient secondary-school maths tutor" shifts vocabulary, assumptions and depth.
  2. Context. What does the model need to know about your situation? The audience, the goal, relevant background, and anything you have already tried.
  3. Task. What exactly should it do? Use a clear verb: draft, summarise, compare, classify, rewrite, critique.
  4. Format. What should the output look like? Length, structure, tone, reading level and file-ready formats such as a table or a bulleted list.

Here is the difference in practice.

BEFORE
Write an email about the price increase.
AFTER
You are a customer success manager at a small software company.

Context: We sell a scheduling tool to independent hair salons.
Our monthly plan is going up next quarter because our hosting
and support costs have risen. Customers who pay annually keep
their current price until renewal. Most readers are salon owners
who read email on their phone between appointments.

Task: Draft the announcement email.

Format: Under 180 words. Friendly, direct, no corporate jargon.
Put the key change in the first two sentences. End with one
clear next step (switch to annual billing) and a line inviting
replies. Give me three subject line options.

The second prompt is longer, but it takes less total time because the first draft is close to usable.

Give examples (few-shot prompting)

Describing a style in adjectives is unreliable. "Punchy but professional" means different things to different people, and to a model. Showing an example is far more precise. This is called few-shot prompting: you include a few sample inputs and outputs, then give the new input.

BEFORE
Write product descriptions for our candles. Make them punchy.
AFTER
Write a product description for each candle below. Match the
style of the examples: two sentences, sensory first line,
practical second line, no exclamation marks.

Example
Input: Cedar and smoke, 220 g, 45-hour burn
Output: Dry cedar and a curl of woodsmoke, like a cabin after
the fire has settled. A 45-hour burn in a 220 g glass jar.

Example
Input: Fig and black tea, 180 g, 38-hour burn
Output: Ripe fig over a strong cup of black tea, sweet but
never sugary. Burns for 38 hours in a 180 g jar.

Now write:
1. Sea salt and juniper, 220 g, 45-hour burn
2. Orange peel and clove, 180 g, 38-hour burn

A few practical rules for examples:

  • Use two or three examples that differ from each other, so the model learns the pattern rather than copying one sample.
  • Make sure your examples are genuinely good. The model will reproduce their flaws as faithfully as their strengths.
  • Keep the format of every example identical. Consistency is the signal.

Want this working in your business, not just on paper? Get a free, written AI starting plan.

Get my free AI plan

Set clear constraints

Constraints tell the model where the edges are. Without them it fills space with caveats, generic advice and invented detail. Useful constraints include:

  • Length: a word range or a number of bullets.
  • Scope: what to cover and, just as important, what to skip.
  • Sources: "Use only the text I pasted below" reduces made-up facts.
  • Missing information: "If something is not stated in the document, write 'not specified' rather than guessing."
  • Audience level: "Assume the reader has never used a spreadsheet formula."

Ask for structured output

If you plan to paste the answer into a spreadsheet, a database or another tool, ask for a precise structure and show it. Name the fields, their order and what to do with empty values.

BEFORE
Pull out the important details from these customer reviews.
AFTER
Read the customer reviews below. For each review, return one
line of JSON with exactly these keys:

{"review_id": number,
 "sentiment": "positive" | "neutral" | "negative",
 "product_mentioned": string or null,
 "main_issue": short phrase or null,
 "wants_reply": true | false}

Rules:
- Return only the JSON lines, no commentary.
- Use null when a field is not mentioned.
- "wants_reply" is true only if the customer asks a question
  or explicitly requests contact.

Reviews:
[paste reviews here]

For tables, give the column headings. For reports, give the section headings. The more exact the skeleton, the less clean-up you do afterwards. Always spot-check structured output, especially classification fields, before relying on it.

Iterate instead of restarting

The first response is a draft. The fastest route to a good result is usually targeted feedback in the same conversation, because the model keeps your earlier context. Vague feedback such as "make it better" produces random changes. Specific feedback produces specific fixes.

  • Point to the part: "The second paragraph is too technical for salon owners."
  • Say what to keep: "Keep the opening line and the subject lines as they are."
  • Give a direction: "Replace the feature list with one concrete example of a busy Saturday."

If a conversation has drifted badly after many rounds, start a fresh chat and write a better first prompt that includes what you learned. Long, tangled threads can carry forward earlier mistakes.

Break big tasks into steps

Asking for a complete business plan, a full training course or a long report in one prompt tends to produce something shallow everywhere. Break the work into stages and review each one before moving on.

  1. Clarify: "Before you start, list the questions you would need answered to do this well." Answer them.
  2. Outline: ask for a structure only. Edit it until it is right.
  3. Draft section by section: paste the approved outline and ask for one section at a time.
  4. Review: ask for a critique of the full draft against your goal.
  5. Polish: finish with a consistency pass for tone, terminology and length.
BEFORE
Create a two-week onboarding plan for a new receptionist.
AFTER (step 1 of 3)
I run a four-person physiotherapy clinic and I'm hiring my first
full-time receptionist. I want a two-week onboarding plan.

Do not write the plan yet. First, ask me up to eight questions
about our systems, the person's experience and what "fully
onboarded" should mean by day ten. Number your questions.

This approach also gives you natural checkpoints to catch errors early, when they are cheap to fix. The same idea underpins multi-step AI automation workflows, where each step does one job well.

Prompt the model to critique

Models are often better at spotting weaknesses in a piece of text than at avoiding them on the first pass. Use that. After a draft, ask for a structured critique against criteria you care about, then ask for a revision that addresses the critique.

Review the draft above as a sceptical salon owner who is busy
and slightly annoyed about paying more.

1. List the three weakest points, quoting the exact sentence.
2. For each, explain in one line why it might irritate or
   confuse this reader.
3. Then rewrite the email fixing only those points.

You can also ask the model to check its own factual claims: "List every factual statement in your answer and mark which ones come from the document I provided and which are your general knowledge." That makes it much easier to see what you need to verify yourself.

Common prompting mistakes and fixes

MistakeWhat happensFix
No audience statedGeneric, middle-of-the-road toneName the reader and what they already know
Describing style with adjectives onlyOutput that matches the model's idea of "punchy", not yoursShow one to three examples
Asking for everything at onceShallow coverage of every partOutline first, then draft section by section
No rule for missing informationPlausible-sounding invented detailsTell it to write "not specified" or ask you
Vague feedback ("improve this")Random rewrites that lose good partsPoint to the exact part, say what to keep and what to change
Pasting sensitive data without thinkingPrivacy and confidentiality exposureRemove names and identifiers; check your tool's data settings
Accepting the first answerErrors and weak sections slip throughAsk for critique, then verify key facts yourself

The privacy point deserves its own attention. Before pasting client records, contracts or internal financials into any assistant, read our AI privacy and security checklist.

A reusable prompt template

Save this skeleton somewhere handy and fill it in for any important request:

Role: You are [expert role].

Context: [Who this is for, why it matters, relevant background,
what has already been tried.]

Task: [One clear verb and the deliverable.]

Constraints:
- Length: [range]
- Include: [must-haves]
- Avoid: [scope to skip]
- If information is missing: [ask me / write "not specified"]

Format: [Headings, table columns, JSON keys, tone, reading level.]

Examples (optional):
[One to three samples of the output you want.]

For ready-made starting points across marketing, operations and research tasks, browse the prompt library. If you want to choose the right assistant for a particular job, see choosing an AI model.

Frequently asked questions

Do longer prompts always give better results?

No. Longer prompts help when the extra words carry useful context, examples or constraints. Padding, repetition and contradictory instructions make results worse. Aim for complete, not long: every sentence should change what the model does.

Does assigning a role like "you are an expert" really help?

A role is useful when it implies a specific audience, vocabulary or standard, such as "a tax preparer explaining to a first-time freelancer". On its own, a generic "expert" label adds little. The context and task matter more.

Should I use the same prompt in different AI assistants?

The core structure transfers well between assistants, but each model has its own defaults for length and tone. Test an important prompt in the tool you will actually use and adjust the format instructions as needed.

How do I stop the model from making things up?

Give it the source material, tell it to answer only from that material, and tell it what to do when the answer is not there. For questions over large document collections, a retrieval setup helps; see retrieval-augmented generation explained. Always verify important facts yourself.

This guide is general information, not professional advice. Spotted an error? Tell us.