TryBench
Applied AI & Prompt Workflows · Foundation lesson 2 of 19

How to Write a Good AI Prompt: Goal and Context

Build reliable prompts using the three core pillars: Goal, Context, and Constraint.

Why this matters

Most bad AI answers come from a missing detail, not a bad AI. A clear goal, some background, and a few rules fix that quickly.

The Three Parts of a Good Prompt

A strong prompt has three parts. Goal: what to do. Context: the background. Constraints: the rules, such as length and tone.

In real life: Picture a taxi ride. Goal: take me to Ikeja. Context: I have a meeting at 6 PM. Constraint: use the fastest road. Take away any one of these and the driver has to guess.

Rules Make Answers Consistent

Without limits on length, tone, and format, answers change a lot each time. Clear limits keep them steady.

In real life: Without limits, the same request can give you three words one time and three paragraphs the next. A rule like 'under 30 words' makes the answer the same size every time.

Goal: Apologize for delay
Context: Rain in Abuja
Constraint: Under 30 words

Your practice task

Draft an apology SMS to customer Babatunde Ade whose parcel in Abuja was delayed by rain. State the Goal (apologize and offer ₦2,000 credit), provide Context, and enforce Constraints (under 30 words, professional tone).

How to do it

  1. Write the Goal: what you want the AI to do.
  2. Add the Context: who the customer is, what happened, and the credit amount.
  3. Add the Constraints: how long it can be and what tone to use.
  4. Press Run proof.

Practice it for free in the app. You get instant checks that show what you got right and what to fix. A lesson takes about two minutes and you can try as many times as you like.

Quick reference: Three-Pillar Prompt Format

Prevents models from missing essential facts or writing rambling responses.

Goal: [Objective]
Context: [Key data]
Constraint: Under [N] words, professional tone.

Practice this lesson free

More lessons in this course

See all 19 lessons in Applied AI & Prompt Workflows