Manuals / Prompt Engineering / Ch 2

A · StructureBeginner30 min read

2. Prompt anatomy: role, goal, context, constraints, format

Prompt Engineering · 48 pages source format

Structure beats adjectives. A good prompt names who the model is, what it must produce, what context it has, what it must not do, and how output should look.

What you'll learn

  • Prompt anatomy
  • Specificity
  • Output schemas

Rewrite a vague prompt

Turn "write about testing" into a structured brief: audience, length, tone, format, constraints.

Do this now

Side-by-side: vague vs structured. Compare outputs on the same topic.

Pro tip. One concrete example beats three adjectives.

Clear?

Add output format

JSON, markdown table, bullet list, numbered steps — tell the model exactly how to shape the answer.

# Structured prompt template
Role: You are a senior QA engineer reviewing test plans.
Goal: Review the test plan below and list gaps.
Context: [paste test plan]
Constraints: No generic advice. Reference specific sections.
Format: Markdown table with columns: Gap | Risk | Suggested test

Do this now

Ask for the same summary as JSON and as markdown. Note which is easier to use downstream.

Clear?

Checklist