• Module 1 · Foundations of Prompt Engineering
  • 2 min read · about 20 min lab
  • Builds: Your own prompt library

The Anatomy of a Prompt: Instruction, Context, Input, and Output Format

The four building blocks of a strong prompt: instruction, context, input, and output format.

Key takeaway & what you'll build

Every strong prompt has four parts: an instruction (what to do), context (role, audience, and purpose), input (the material to work on), and an output format (the shape of the answer). Most weak prompts are missing one or two of them. Label the parts of your own prompt and you'll see what to add.

You'll build: Your own prompt library

Four parts, one prompt

Almost every effective prompt is built from the same four parts.

1. Instruction: what to do

The task, usually led by a verb: summarize, rewrite, compare, list, draft, critique. "Help me with" is not an instruction; it leaves the task to the model.

2. Context: who, why, and for whom

The role the model should take, the audience, the purpose, and any constraints. "You are a recruiter who hires marketing managers" or "for first-time founders who hate jargon."

3. Input: the material to work on

The text, data, or examples the task applies to. If you want your resume improved, paste the resume. Models can't improve what they can't see.

4. Output format: the shape of the answer

Length, structure, and style: "three bullets under 20 words each", "a Markdown table with these columns", "return only the rewritten text."

The same request, before and after

Before: "Help me with my resume." A model answers with generic tips, because that's the most likely answer to a request with no task, context, or input.

After: "You are a recruiter who hires mid-level marketing managers. Rewrite the three bullet points below from my current role so they show results, not duties. Use a strong verb and a number in each, and keep each under 20 words. Return only the three bullets." followed by the bullets.

Now the model knows the job, the reader, the material, and the shape. It still can't invent your real numbers, so the best version of this prompt includes them in the input.

Use it as a checklist

You don't need all four parts every time. "Translate this into Spanish" plus the text is a fine prompt. But when an answer misses, check the four parts first: the missing one is usually the cause.

Try it

Take your "before" prompt from lesson 1 and label its parts. Then rewrite it so it has all four, send it in Ask Ace, and compare the two answers. The lab is next.

Before and after

A resume request (example)

Before

Prompt

Help me with my resume.

Output

Of course! Here are some general tips: tailor your resume to each job, use action verbs, quantify your achievements, keep it to one or two pages, and proofread carefully. Would you like help with a specific section?

After

Prompt

You are a recruiter who hires mid-level marketing managers. Rewrite the three bullet points below from my current role so they show results, not duties. Use a strong verb and a number in each, and keep each under 20 words. Return only the three bullets.

- Responsible for the company newsletter
- Managed social media accounts
- Worked with sales on campaigns

Output

- Grew newsletter subscribers 42% in 12 months by redesigning the welcome sequence
- Built social channels to 18,000 followers, lifting referral traffic 3x
- Co-led 6 sales campaigns that sourced $1.2M in qualified pipeline

The second prompt adds a role, a specific task, the actual input, and a format. The numbers in the example answer are placeholders: a real answer needs your real figures, which is a good reason to include them in the input.

Hands-on lab

Dissect a Prompt

Label the instruction, context, input data, and output format in the example prompt. Then rewrite the vague prompt "Help me with my resume" into a well-structured prompt that uses all four components, and say in one or two sentences what each part you added does.

What the AI grader checks for

  • Component identification (40%): Correctly identifies all four components of the example prompt: the instruction, the context (the nutritionist role), the input (the meal plan), and the output format (the table).
  • Prompt rewrite quality (40%): The rewritten resume prompt is specific and includes all four components, including real or placeholder input to work on.
  • Clear explanation (20%): The learner explains what each added part does, and the submission is organized and easy to follow.

Ask the AI course tutor

The tutor knows this whole course. Pick a question to start a conversation about this lesson.