Prompt Engineering#

A prompt is the instruction you give an AI model, and the answer is only as good as the instruction. This course teaches prompt writing one habit per chapter. Every chapter shows a real before prompt, an after prompt, the kind of reply each one produces and why the change works. You can run a small prompt checker and a test kit that come with the course.

Note

No special tool needed. Use any chat assistant or API. The replies shown are typical, not exact; models vary, which is why the last chapters teach you to test prompts instead of trusting one result.

The parts of a good prompt Six parts. Only the task is required; each extra part removes one thing the model would otherwise guess. Role who to be Context background Task what to do Examples show, don't tell Format shape of answer Limits length, rules Prompt = Role + Context + Task + Examples + Format + Limits Green is required. Blue sets the scene. Amber shapes the answer. Start with the task, then add parts only where the answer was wrong.
Six parts. Only the task is required; each extra part removes one thing the model would otherwise guess.

How the course is organised#

Part

What you learn

Foundations

The parts of a prompt, being specific, giving context

Shaping the answer

Roles, output formats, few-shot examples, constraints

Reliability

Step-by-step reasoning, delimiters and injection, prompt chaining, grounding against made-up facts

Production habits

System prompts and templates, evaluating prompts, a capstone with five broken prompts

How each chapter works#

  1. The big idea in plain words, with an everyday example.

  2. A picture of the before and after.

  3. Before and after: two real prompt pairs, with typical replies and a score from promptcheck.py.

  4. Worked code where it helps (validate JSON, build templates, grade replies).

  5. Rules of thumb and common mistakes.

  6. Try it yourself: questions first, answers hidden until you open them.

Tip

Keep a prompt notebook. For every prompt that works, save the version, the test inputs and the score. Your best prompts are reusable assets.

Code that comes with the course#

File

What it does

code/promptcheck.py

Scores a prompt on seven visible habits (task, context, audience, format, limits, example, delimiters)

code/evalkit.py

Grades saved replies with pass/fail rules so you can compare two prompts

Both run with plain Python 3 and need no API key.