Skip to content
Visual explainer 2h to learn 5 steps

Write a prompt with a goal, context, constraints and format

Rewrite a vague prompt into one with a goal, audience, context, constraints and answer format, and show the difference on the same fixture.

By Invicly Tech, , in Prompt Engineering and Vibe Coding. About 10 minutes to read.

Topic 1 of 29

In short

A good prompt says what you want, who the answer is for, what background matters, what limits apply and what shape the answer should take. A model cannot read your mind, so anything you leave out it has to guess. Writing these five parts down is the quickest way to get better answers.

Think of it like this: Think of briefing a new colleague on their first day: they are clever, but they know nothing about your project until you tell them.

Explained simply

A prompt is the message you send to an AI model. The model reads it and writes the most likely useful reply. It only knows what is in the prompt, plus what it learned in training. So if your message is short and vague, the model has to guess your goal, your reader and your preferred style.

You can remove most of the guessing with five parts. The goal is the single job to do. The audience is who will read the result. The context is the background facts that matter. The constraints are the limits, such as a word count or things to avoid. The format is the shape of the answer, such as three bullets.

You do not need all five every time. A quick question to a chat window can be short. But when you will reuse the prompt, or when a wrong answer would cost time, writing the five parts takes two minutes and saves many retries.

The best way to see the value is to test it. Pick one fixed input, called a fixture. Run a vague prompt and a specific prompt on it. Put the two answers next to each other and ask which one you could use without editing.

Press Play on a diagram to walk through it one step at a time.

LayersThe five parts of a clear prompt
  1. 1
    Goal

    The one job the model should do

  2. 2
    Audience

    Who will read the answer

  3. 3
    Context

    Only the facts that change the answer

  4. 4
    Constraints

    Length, tone, things to avoid

  5. 5
    Format

    Bullets, table, JSON, number of items

CompareVague versus specific on the same task
Vague
  • Summarise this ticket
  • No reader named
  • No length limit
  • Free-form answer
Specific
  • Summarise this support ticket for the on-call engineer
  • Reader is technical and in a hurry
  • Maximum 60 words
  • Three bullets: symptom, impact, next step
SequenceBriefing a model step by step
You
Model
  1. 1Vague prompt on the fixture
    You to Model: Vague prompt on the fixture
  2. 2Generic answer
    Model to You: Generic answer
  3. 3Add audience, limit and format
    You to Model: Add audience, limit and format
  4. 4Focused, usable answer
    Model to You: Focused, usable answer

In depth

Goal and audience decide the answer

The goal is a verb and an object: summarise this ticket, rewrite this paragraph, list the risks in this plan. If you cannot say it in one sentence, split the task. The audience then tunes the answer. The same ticket summary for an on-call engineer, a customer and a manager would use different words and details.

Name the reader's situation, not just their job title. 'An engineer with two minutes who must decide whether to wake someone' tells the model what to keep and what to drop. This one sentence often improves an answer more than a long list of style rules.

  • Goal: one verb and one object
  • Audience: who reads it and what they must decide
  • Split two jobs into two prompts
  • State the reader's time or skill level

Context: give less, but give the right facts

Context is the information the model cannot guess: your product, the policy, the text to work on, earlier decisions. Models read all of it, and unrelated text can pull the answer off course. So pick the facts that change the answer.

A useful test is to imagine a smart stranger doing the task. What would they need to ask you? Put those answers in. Things the model already knows, such as what an email is, can stay out. If the context is long, mark it clearly with tags, so the model can tell it apart from your instructions.

FlowChoosing context for a prompt
  1. Step 1
    Imagine a stranger

    Smart, but new to your project

  2. Step 2
    List their questions

    What would they ask you first?

  3. Step 3
    Answer in the prompt

    Only those facts

  4. Step 4
    Cut the rest

    Remove text that does not change the answer

Constraints and format make answers checkable

A constraint is a rule you can test. 'Short' is hard to test. 'At most 60 words' is easy. 'Professional' is fuzzy; 'no slang, no exclamation marks' is clear. State both what to do and what to avoid, but prefer the positive form when you can: 'write in plain sentences' works better than a long list of bans.

Format is the shape of the answer. If a person reads it, bullets or short headings help. If a program reads it, ask for a strict structure such as JSON, which later topics cover. Giving a small skeleton of the answer is often the clearest way to set the format.

  • Use numbers: words, items, sentences
  • Name forbidden things explicitly
  • Show a skeleton of the answer
  • Match the format to who or what reads it

Comparing prompts fairly

To learn what works, change one thing at a time and keep the input fixed. Save the fixture, the prompt version and the answer. Read both answers against the same simple question: could I use this as it is?

Models are not perfectly repeatable. The same prompt can give slightly different answers on different runs. For a first comparison, run each version two or three times. If a version only wins once, that is weak evidence. Later modules show how to measure this properly with evaluation fixtures.

Learn it in 5 short steps

About 25m each. Track them with a timer in your plan.

  1. 1
    State the goal and the audience~25m
  2. 2
    Give only the context that matters~25m
  3. 3
    Set constraints and a length limit~25m
  4. 4
    Specify the answer format~25m
  5. 5
    Compare vague and specific versions on one fixture~25m

Key points

  • State one goal per prompt. Two jobs in one prompt usually means one is done badly.
  • Name the audience. It changes vocabulary, depth and tone more than any other detail.
  • Give context the model could not guess, and leave out the rest. Extra text can distract.
  • Say the format and the length. A table, three bullets or 60 words is easy to check.
  • Test vague and specific versions on the same fixture, a saved input you reuse, so you see real differences.

Key terms

Tap a card to flip it. 0/5 known

Examples

text
Goal: Summarise the support ticket below.
Audience: the on-call engineer, who has two minutes.
Context: we run a booking app; tickets mention the web or mobile client.
Constraints: maximum 60 words. No greetings. Do not guess a cause.
Format: three bullets labelled Symptom, Impact, Next step.

Ticket:
Customer says the Pay button does nothing on their phone since this morning.

A specific version of the ticket summary prompt.

Rewriting a vague prompt

Start: 'Write something about our new feature.' Step 1: set the goal, announce the feature in one release note. Step 2: name the audience, existing customers who are not technical. Step 3: add context, the feature is CSV export of invoices. Step 4: add constraints, 80 words, no jargon, no exclamation marks. Step 5: set the format, a title line and two sentences. Run both prompts on the same feature notes and compare.

text
Goal: write one release note for the feature below.
Audience: existing customers, not technical.
Context: Fabrikam Billing now exports invoices as CSV.
Constraints: at most 80 words. No jargon. No exclamation marks.
Format: a title line, then two sentences.

Same fixture, two versions

You have one fixture: a pasted customer email asking for a refund. Version A says 'Reply to this email.' Version B names the audience (an upset customer), sets the tone (calm, direct), asks for 3 short paragraphs and tells the model not to promise a refund it cannot approve. Save both answers in a file named after the prompt version. Score each against a three-line checklist: tone, length, no false promise.

Quick reference

  • Five parts: goal, audience, context, constraints, format
  • One prompt, one goal. Split tasks that have two jobs
  • Make rules testable: numbers beat adjectives
  • Give facts the model cannot guess, and cut the rest
  • Compare versions on the same saved input
  • Change one thing at a time between versions
  • Run each version two or three times before you decide

Common mistakes

  • Pasting a whole document as context when only two paragraphs matter.
  • Asking for a good answer without saying what good means.
  • Changing three things at once, so you cannot tell which change helped.

Quick quiz

Pick an answer to see if you're right and why.

Question 1

1Which prompt part tells the model who will read the answer?

Question 2

2Which constraint is easiest to check?

Question 3

3Why use the same fixture for a vague and a specific prompt?

Question 4

4A prompt asks for a summary and a rewrite and a translation. What is the best fix?

0/4 answered

Practice exercises

Try each one yourself first. Use the hint if you get stuck, then compare with the solution.

  1. Exercise 1easy

    Take the prompt 'Explain Git.' and rewrite it with a goal, audience, a word limit and a format.

  2. Exercise 2medium

    Save one fixture (a short customer email). Write a vague and a specific reply prompt, run both, and record the two answers with a three-item checklist.

  3. Exercise 3hard

    Take a prompt that does three jobs and split it into three prompts. Explain what you gained.

Check yourself

Answer in your head, reveal, then be honest with yourself.

Feel confident about this topic?

Frequently asked questions

How long should a prompt be?
As long as it needs to be to remove guessing, and no longer. A short prompt is fine for a simple task. Long prompts need clear structure.
Do I need all five parts every time?
No. Use them when the task matters, when you will reuse the prompt, or when a first try gives a poor answer.
Why does the same prompt give different answers?
Models choose words with some randomness, so wording can change between runs. Clear constraints reduce the spread.

Go deeper

ShareXLinkedInWhatsApp