Lesson 03 · Core Skills

Prompt Engineering as an FDE Skill

Wording moves the distribution — and a handful of techniques move it reliably.

FDE skill · turn a flaky prompt into a dependable one, on evidence
🎧 Listen to this lesson · ~6 min · narrated audiobook edition

⏱ ~7 min read · 🎧 6 min listen · ✎ 3 quizzes · 🧪 ~30 min lab

Here's the situation this lesson trains you for: the demo works, mostly. The customer's ticket classifier gets it right four times out of five, and the fifth answer is chatty, wrongly formatted, or just wrong. The customer asks "can you make it reliable?" — and the cheapest, fastest lever you own is the prompt. Not folklore, not magic words: a small set of techniques with a mechanical reason for working, applied against test cases.

Why wording works: you're steering a distribution

Remember the machine from Lesson 01: the model turns your input into a probability distribution over next tokens and samples from it. The prompt is the only input. So changing the prompt literally changes the distribution every output token is drawn from.1 "Prompt engineering" is just the craft of conditioning that distribution on purpose — writing clear instructions, supplying the context the model needs, and arranging both for the best result.2

That mechanism also tells you what prompting can't do. It can't add facts the model never saw (that's grounding — RAG, Lesson 06), and it can't make sampling deterministic (that's a decoding setting). An FDE who knows which failures are prompt-shaped fixes them in minutes instead of proposing a week of engineering.

Not every fix is a prompt fix Anthropic's own prompt-engineering guide opens with this warning: some failing success criteria — latency, cost — are better solved by choosing a different model than by prompt wizardry. Keep Lesson 02's levers next to this lesson's; part of the skill is knowing which drawer to open.

The five techniques that reliably move the needle

Anthropic's documentation orders its techniques from broadly effective to narrowly effective, and the top of that list is remarkably unglamorous.2 These five cover most of what you'll ever need at a customer site.

1. Be clear and direct — write for a brilliant new hire

The single highest-leverage move. Treat the model like a very capable contractor on their first day: state the task, the audience, the constraints, and what "done" looks like. Say what to do rather than what to avoid, and say why — context about the goal measurably improves compliance. Most "the model is dumb" complaints dissolve when the instruction stops being vague.

2. Show, don't tell — use examples (few-shot prompting)

Include two or three worked input→output examples in the prompt and the model imitates their pattern — format, tone, length, edge-case handling. From Lesson 01 you know why: the examples are in the context, so continuations that match the pattern become the most probable tokens. Examples are the most reliable way to pin down output format in particular.1

3. Fence your data — separate instructions from content with tags

Real prompts mix your instructions with pasted customer content — a ticket, a contract, an email thread. Fence the content in delimiters, e.g. <ticket>…</ticket>, and refer to it by name. Now the model can tell the difference between "text that commands me" and "text I'm operating on" — which is also your first line of defense when a pasted document contains something that looks like an instruction.2

4. Set the frame — system prompts and roles

API calls take a system prompt: standing instructions that frame the whole conversation — "You are a support assistant for Acme; answer only from the provided policy; escalate anything about refunds." Role and framing shift the distribution toward the register you want: terse vs. warm, cautious vs. decisive, domain-expert vs. generalist.

5. Give it room to think — ask for reasoning before the answer

For multi-step problems, prompt the model to work through its reasoning before stating the answer. The mechanism is pure Lesson 01: the model computes with tokens, so intermediate reasoning tokens are literally its scratch space — an answer demanded in the first token gets no computation at all. (Modern "reasoning" modes build this in; the prompt-level version is still the portable skill.)

System vs. user prompt Two channels, one context window. The system prompt is yours — the app developer's standing frame, sent with every call. The user prompt is the end-user's turn. Nothing mystical separates them; both are tokens the model conditions on. But convention and training make models weight the system frame heavily, which is why it's where FDE-you encodes the customer's rules.

The real skill: iterate against test cases

Here's what separates an FDE from a prompt hobbyist: treating prompting as an empirical loop, not an incantation. Anthropic's applied-AI team describes the practice as building test cases, finding failure patterns, and encoding the fix back into the prompt — version by version.3 You never ask "is this prompt good?" — you ask "how many of my test cases does version 3 pass that version 2 failed?" Hold that thought; it becomes a whole lesson when we get to evals.

You don't start from a blank page The Claude Console ships a prompt generator and a prompt improver — give either a task description and it drafts a structured prompt using these same techniques. Anthropic's docs position them as the fast path to a first draft; your job is the loop that comes after.

🧪 Lab: upgrade one prompt three times, and measure it

The lab file is labs/0003-prompt-upgrades.py — same setup as Lesson 02 (your ANTHROPIC_API_KEY in the environment, then run it with Python).

The task is real FDE work: extract structured fields from messy customer support tickets. You'll run three versions of the same prompt against the same five tickets: v1 is the vague one-liner most people start with; v2 adds clear, direct instructions and fenced data; v3 adds few-shot examples. A small checker scores every run against expected answers, so you don't vibe the improvement — you watch the pass-rate climb, and see exactly which ticket each version still fails.

🤖 Get your work reviewed

No chat here — this box replaces it. Copy the prompt into any AI assistant (Claude, ChatGPT, Gemini…), then paste your work after it.

You are a senior AI engineer reviewing my work: the output of my prompt-engineering lab (labs/0003-prompt-upgrades.py). My paste includes the pass-rates of three prompt versions on five ticket-extraction test cases, plus my own v4 prompt and its score, and a short note on which technique fixed which failure.

Grade each item as Strong / Adequate / Missing, with one sentence of evidence:
- I can name which of the five techniques (clarity, examples, fenced data, system framing, room to think) each version change applied, and why it moved the score.
- My v4 prompt targets the specific tickets v3 still failed, not a generic rewrite.
- I treated it as an empirical loop: claims are backed by pass-rate changes, not impressions.
- I can say which remaining failures are NOT prompt-shaped (missing facts, sampling randomness) and what lever those need instead.

Be skeptical — challenge my weakest claim first. Then ask me 2–3 follow-up questions a customer would ask before trusting this in production. Finish with the single highest-leverage improvement.

My work follows below.

Check yourself — pick the right technique

Three customer complaints. Don't scroll up — name the technique that fixes each, from the mechanism. Wrong picks stay live.

Scenario A

A summarizer's outputs vary wildly in structure — sometimes bullets, sometimes prose, sometimes a table. The customer needs them consistent. Cheapest reliable fix?

Scenario B

A bot that summarizes forwarded emails suddenly replied to one email's content ("Sure, I'll schedule that meeting!") instead of summarizing it. What's the fix?

Scenario C

A pricing assistant must apply a three-step discount policy. It answers instantly and gets the arithmetic wrong on complex cases. Best prompt-level fix?

Primary source — read this
The living reference for every technique in this lesson, maintained by the people who train the model. Start at the overview, then read the prompting best-practices page it links first — notice how it insists on success criteria and empirical testing before any technique.
Your one tangible win A customer shows you a flaky prompt. You can now (1) diagnose whether the failure is even prompt-shaped, (2) apply the right technique for the failure — clarity, examples, fencing, framing, or room to think — and (3) prove the fix with a pass-rate, not a feeling. That loop is the difference between "prompt tinkerer" and engineer.
Questions? Not sure why your v3 prompt still fails one ticket? Curious when to reach for the prompt improver vs. hand-tuning? Paste the relevant lesson section — or your lab output — into any AI assistant (Claude, ChatGPT, Gemini…) and ask. For a structured review of your lab, use the box above.

Recommended learning

Hand-picked follow-ups if you want more reps on prompting. None are required — the primary source above comes first.

References

  1. Chip Huyen, AI Engineering (O'Reilly, 2025) — prompt engineering chapter: conditioning, few-shot prompting, and defensive prompting.
  2. Anthropic, Prompt engineering documentation — technique catalogue and when-to-prompt-engineer guidance (verified July 2026).
  3. Anthropic Applied AI, "Prompting 101" (Code w/ Claude, 2025) — prompting as an iterative, empirical practice.