Spec-Driven Dev
BeginnerEngineers and technical product people who write, or are about to write, a system prompt, a structured-output call, or a template that ships in a product

Prompt Engineering for Engineers

Write instructions a model will follow, put the right facts in front of it, get back data your code can trust, and test the prompt like the code it is.

A prompt is a program written in English that a language model runs by predicting what comes next. This short, example-dense course teaches engineers to write instructions that hold, ground the model in the facts it needs, get structured output code can validate, use examples and caching well, and test every prompt change against a small eval set. You practice on two model-backed features of Shelf, the bookshop app from the platform's other courses, and Eve, the built-in tutor, is one highlight away.

7 lessons · about 6 hours of reading · quizzes graded by code and by Eve

What you will build
  1. 1prompts/draft.system.mdrole, voice, scope, refusal, priority
  2. 2Delimited contextorder record in, data is not instructions
  3. 3record_offers schemaforced tool call, nulls allowed
  4. 4zod validation + retryshape is not meaning
  5. 5prompts/intake.examples.mdthree to five, labeled, stable prefix
  6. 6evals/*/cases.jsonabout 20 cases per feature
  7. 7npm run evalsassertions and a judge, pass rate
  8. 8prompts/CHANGELOG.mdone change at a time
Instruct Structure Iterate

How the course is organized

PhaseQuestion it answersLessons
InstructWhat should the model do, for whom, with what facts, and what should it do when it cannot?L0–L2
StructureHow do you shape the input so data stays data, and shape the output so code can trust it?L3–L4
IterateHow do you know a prompt change made things better, and when is a prompt the wrong tool?L5–B1

Modules

Module 0

Start Here

How a model produces text, the three kinds of material in a request, system prompt versus user turn, and why "be helpful" does nothing.

0/1 done · 35 minStart
Module 1

Instructions and Context

Specific, positive instructions with a role, a scope, and a refusal; then the facts the model needs, delimited, placed well, and protected from injection.

0/2 done · 105 minStart
Module 2

Shaping Input and Output

Schemas and forced tool calls for output code can validate, nulls instead of guesses, and examples, templates, versions, and caching for the input.

0/2 done · 105 minStart
Module 3

Prompts as Code

A small eval set, assertions and a judge, one change at a time, thinking on or off, and knowing when the prompt is the wrong layer.

0/1 done · 60 minStart
Module 4

Bonus

A twelve-question review checklist for prompt changes and the five anti-patterns it catches.

0/1 done · 30 minStart

Every lesson

Module 0Start Here

  • L0Instruct· 35 min Not started
    What a Prompt Is (and Is Not)

    How a language model produces text, the three kinds of material in a request, what belongs in the system prompt versus the user turn, and why a prompt is code.

Module 1Instructions and Context

  • L1Instruct· 55 min Not started
    Instructions That Hold

    Turn wishes into checkable instructions: name the behavior, pair every never with an instead, set role, audience, and voice, write the refusal, resolve conflicts, and cut every line that changes nothing.

  • L2Instruct· 50 min Not started
    Context, Grounding, and Injection

    Put the order record in the request, wrap every piece of data in a labeled block, tell the model what to say when a fact is missing, place long data before the question, and defuse the email that tries to give orders.

Module 2Shaping Input and Output

  • L3Structure· 55 min Not started
    Structured Output

    Describe Intake's record as a JSON schema, force the model to fill it through a tool call, validate the result with zod, retry with the error, and let the model say unknown instead of guessing.

  • L4Structure· 50 min Not started
    Examples, Templates, and Caching

    Pick three to five examples that teach a pattern without being copied, move prompts into versioned files with variables, and order every request so the stable part is cached.

Module 3Prompts as Code

  • L5Iterate· 60 min Not started
    Testing and Iterating a Prompt

    Build a twenty-case eval set, check Intake with assertions and Draft with a rubric judge, run npm run evals, change one thing at a time, decide when thinking is worth it, and notice when the prompt is the wrong layer.

Module 4Bonus

  • B1Bonus· 30 min Not started
    Bonus: The Prompt Review Checklist

    Twelve questions to ask of every prompt change before it merges, the five anti-patterns they catch, a walk-through of a one-line pull request, and a short script for explaining to a product owner why a sentence needs a review and an eval run.

Meet Bramble Books, Shelf, Intake, and Draft

The same bookshop as the platform's other courses. Two features of Shelf call a language model: Intake turns a supplier's free-text email into title records Shelf can import, and Draft writes a reply to a customer email from the order record for Tessa, the Elm Street store manager, to approve. Six recurring cases (IN-1 to IN-3, DR-1 to DR-3) run through every lesson and seed the eval sets.

ToolWhat it doesRisk tier
prompts/draft.system.mdDraft's standing instructions: role, audience, voice, scope, refusal, priorityVersioned, reviewed, in CHANGELOG.md
prompts/intake.system.md + intake.examples.mdIntake's instructions and its three to five labeled examplesStable prefix, cached
record_offers schemaThe shape of an Intake record: nullable price, currency enum, confidenceForced tool call, then zod
src/llm/draft.ts, src/llm/intake.tsThe calls, the templates, the validation, the retryAnthropic TypeScript SDK shapes
evals/*/cases.json + evals/run.tsAbout 20 cases per feature; assertions for Intake, a rubric judge for Draftnpm run evals prints the pass rate
docs/prompt-review.mdThe twelve-question checklist for every prompt changeReviewed like code

Written as a short companion to the platform's other courses. The API shapes follow the Anthropic TypeScript SDK's documented Messages API, tool use, prompt caching, and adaptive thinking. All lesson text, examples, prompts, quizzes, the glossary, and the Intake and Draft features were written for this course.