Prompt Engineering

The AI does what you mean, not what you say. So say it well.

▶ the lesson · narrated sketch video · tap for sound

the intro

Prompt engineering is the skill of writing instructions that get useful output out of AI models. The core moves never change: be specific, show an example, give the model a role, and iterate on the result. It is less magic, more clear communication.

the sample

same request, different results

bad:  "write code"

good: "write a TypeScript function
       that debounces user input,
       with unit tests"

fun fact ✦

“Prompt engineer” became a real job title with a real salary. Your typing finally pays off.

the docs

the deep dive

the ideas behind the video — concepts, diagrams, a walkthrough and the traps to avoid

The model cannot ask you follow-up questions, so every detail you leave out gets filled in with a guess. Prompting is just removing the guesses: say who the model is, what exactly you want, and what done looks like. The good news is that this is a skill with fast feedback — change one line, rerun, compare.

every missing detail is a guess

a good promptroletaskconstraintsexample
four slots to fill — leave one empty and the model guesses it

key terms

role

A persona line that steers tone, vocabulary, and depth in one sentence.

"You are a senior reviewer."

few-shot

Teaching by example: give two input-output pairs and the model copies the pattern better than it follows specs.

2 examples > 2 paragraphs of rules

chain of thought

Ask for reasoning before the answer. Accuracy climbs on math and multi-step tasks because each step gets attention.

"think step by step" is a baseline

delimiter

Markers that separate your instructions from the data, so user text cannot blur into commands.

triple quotes, XML tags, ###

how it works

  1. 1
    State the role

    One line: who the model is and how expert it should sound.

  2. 2
    Describe the task exactly

    Say the format, length, and audience you want. Specific beats polite every time.

  3. 3
    Show an example

    One or two input-output pairs teach the pattern faster than paragraphs of rules.

  4. 4
    Separate the data

    Put the text to process inside quotes or tags so it cannot read as instructions.

  5. 5
    Iterate on failures

    When output misses, fix the prompt like a failing test: change one variable at a time.

the code, explained

a prompt with all four slots filled

1const prompt = [
2 "You are a senior code reviewer.",
the role sets tone and depth in one line
3 "Review the TypeScript below.",
4 "Flag only real bugs, not style.",
say what TO do — "don't" rules are weak
5 "Reply as: bug, why, fix.",
an output format the model can repeat
6 input,
7].join("\n")

side by side

one mega-prompt

  • one shot at everything
  • middle steps quietly dropped
  • a restart redoes all the work
VS

chained prompts

  • full attention on each step
  • each stage is debuggable
  • more calls, more latency
💡 tip

Models are trained to be agreeable, so "is this good?" gets a yes. Ask "what is wrong with this approach, specifically?" and watch the real review appear. Phrase questions so that disagreement is the expected answer.

quick answers

Do prompt techniques go stale?

Models get better at intent, so tricks age out. But specificity, examples, and iteration have worked on every model shipped so far.

System prompt or user message?

Standing rules go in the system prompt, per-request content from the user. Mixing them makes both harder to change.

Is "prompt engineer" a real job?

As a standalone title it is fading. As a skill it is now table stakes for anyone building on models.

quick hits about Prompt Engineering

short answers · interviews, tips, trivia & hidden gems

🎤 interview

What is a hallucination?watch ↗

📚 tutorial

Why does “act as a senior reviewer” work?watch ↗

🔧 useful

Big task in one prompt?watch ↗

🔧 useful

Long instructions or examples?watch ↗

💎 deep

The model always agrees with you?watch ↗

💎 deep

Do “don’t” instructions work?watch ↗