A prompt is structured text you send to an AI model. Everything the model can "see" — system instructions, conversation history, your current message — lives inside the context window. Understanding tokens, context limits, and why wording choices matter is the foundation of everything else.
The system prompt sets the model's persona, tone, and constraints before you say anything. "Act as a senior editor" produces very different output than "Act as a casual friend." Roles activate latent behavioural patterns the model learned during training.
System prompt design
Role specification
Tone & voice constraints
Persona stability
Build itBuild a custom "senior editor" persona. Give it the same draft paragraph and ask it to improve the writing. Then switch to a "startup founder" persona. Notice how the feedback changes.
✓ CheckpointExplain why “be concise” fails as an instruction and what you would write instead.
Context · Role · Instruction · Specifics · Proof. A 5-part checklist that covers everything a model needs to give a reliable, on-target response. Not every prompt needs all five — but knowing what's missing lets you diagnose and fix bad prompts fast.
Prompt anatomy
Structured thinking
Diagnosing weak prompts
Iterative refinement
Build itTake 3 prompts you've written in the past. Score each one against CRISP. Identify the weakest dimension in each and rewrite it.
✓ CheckpointTake a prompt that failed and say whether the fix belongs in the instruction, the examples or the context. “Write it better” is not a diagnosis.
Vague prompts produce vague outputs. The most common failure modes: missing audience, no output format, too many instructions at once, conflicting constraints. Learning to recognise these patterns makes you dramatically faster at prompt iteration.
Failure mode recognition
Prompt diagnosis
Constraint conflicts
One-instruction principle
Build itCollect 5 prompts you've used this week. Label the failure mode in each. Fix the worst one and compare before/after outputs.
✓ CheckpointName the failure mode of your worst prompt — ambiguity, missing context, or no success criterion — before rewriting it.
Telling the model exactly how to structure its output — JSON, markdown, tables, specific heading levels — makes responses dramatically more consistent. Structured output is a superpower when you're piping AI responses into downstream systems or displaying them programmatically.
JSON output mode
Markdown formatting
Schema instructions
Output constraints
Format consistency
Build itWrite a prompt that returns a JSON object with 5 consistent fields, every single time. Throw adversarial inputs at it and check if the structure holds.
✓ CheckpointExplain why asking for JSON is not the same as guaranteeing JSON, and what your code does when it returns prose.
Providing 2–5 input/output examples in the prompt teaches the model the exact pattern you want, without any training or fine-tuning. Few-shot is the fastest way to lock in a consistent style, format, or reasoning structure across outputs.
Build itBuild a few-shot prompt that rewrites any sentence in your specific writing style. Test it on 10 sentences. Count how many feel authentically like you.
✓ CheckpointExplain what your few-shot examples teach beyond content — format, length and tone are all being demonstrated whether you meant it or not.
Adding "think step by step" or showing explicit intermediate reasoning dramatically improves accuracy on math, logic, and multi-step tasks. The model generates better answers when it's forced to show its work before committing to a conclusion.
Run the same prompt multiple times at non-zero temperature, collect the outputs, then vote on the best or most common answer. Self-consistency was introduced for multi-step reasoning, where independent reasoning paths that agree on one answer are more often right; it multiplies the API calls.
Temperature tuning
Multiple sampling
Majority voting
Output aggregation
Build itAsk a factual question 5 times with temperature 0.8. Tally each distinct answer. Does the plurality answer differ from the temperature-0 answer?
✓ CheckpointExplain why sampling several times and voting beats one careful answer on some tasks and wastes money on others.
Where chain-of-thought is linear, tree-of-thought lets the model explore multiple reasoning branches, evaluate each path, and backtrack if a branch fails. It's deliberate search — better for planning, complex decisions, and problems with multiple valid approaches.
Branching prompts
Evaluation prompts
Backtracking strategy
BFS vs DFS prompting
Build itDesign a Tree of Thought prompt for planning a 5-day itinerary with 3 conflicting constraints. See how many valid branches the model explores.
✓ CheckpointExplain what tree-of-thought adds over chain-of-thought, and the cost that makes it a last resort.
Retrieval-Augmented Generation injects retrieved documents into the prompt so the model can answer questions it wasn't trained on. The prompt template must structure chunks clearly — source labels, relevance ordering, explicit "use only this context" constraints to reduce hallucination.
Context injection
Source attribution
Chunk formatting
Grounded generation
Hallucination reduction
Build itBuild a RAG prompt template that answers questions from a pasted document with inline citations like [Source 1]. Test it on content the model definitely wasn't trained on.
✓ CheckpointExplain why a retrieval prompt can have the right chunk and still produce a wrong answer.
Complex tasks break cleanly into sequential prompts where the output of step N feeds into step N+1. Chaining reduces cognitive load per prompt, makes debugging easier (you can isolate exactly where the chain breaks), and lets you apply specialised prompts at each step.
Input/output contracts
State passing
Pipeline design
Error propagation
Chain debugging
Build itBuild a 3-step chain: (1) extract key facts from a paragraph, (2) rank them by importance, (3) turn the top 3 into a tweet. Test where the chain breaks under edge-case inputs.
✓ CheckpointExplain why each link in a prompt chain needs an explicit input/output contract, and what happens at step four without one.
Use the model to generate, refine, or critique prompts. Ask it: "Rewrite this prompt to be more specific." Or: "What's missing from this prompt?" The model has internalised vast amounts of prompting knowledge — using it as a prompt engineer accelerates iteration dramatically.
Self-critique prompts
Prompt generation
Adversarial testing
Iterative improvement loops
Build itTake your weakest prompt. Ask the model to improve it 3 different ways (shorter, more specific, different role). Which improvement wins? Why?
✓ CheckpointExplain what self-critique reliably catches and what it systematically misses.
Parameterize your prompts with placeholders — {{topic}}, {{audience}}, {{tone}}. Store them in version-controlled files. Templates are the bridge between one-off prompting experiments and repeatable, scalable workflows you can hand to a team or a codebase.
Placeholder syntax
Template variables
Version control for prompts
Reuse patterns
Build itBuild a template for generating blog post outlines with 4 input parameters. Generate 10 different outlines from the same template. Measure how much variation you get.
✓ CheckpointExplain why prompts belong in version control, and what a prompt change is closer to — a config edit or a deploy.
Every token costs money and adds latency. Verbose prompts don't always produce better outputs. Techniques: remove filler phrases, compress few-shot examples, use references ("as above"), cache repeated context, and choose the smallest model that meets your quality bar.
Prompt compression
Cost estimation
Model selection
Prompt caching
Quality/cost tradeoffs
Build itTake a long prompt and compress it by 30% without degrading output quality. Measure token count before/after and run both on 10 inputs.
✓ CheckpointCompute the cost of one request from tokens and price, then say which part you would cut first and what it would break.
Prompt injection is real — malicious users can embed instructions that overwrite your system prompt. Jailbreaks exist for every model. Defence patterns: explicit refusal instructions, input sanitisation, output validation, and human-in-the-loop for high-stakes decisions.
Prompt injection attacks
Content filtering
Refusal patterns
Output validation
Human-in-the-loop
Build itTry to jailbreak a prompt you've written — 5 different attack patterns. Then patch each vulnerability. Document the defences you used.
✓ CheckpointExplain why instructing a model to ignore injected instructions is not a defence.
"Does my prompt work?" can't be answered by looking at one output. A proper eval has a golden dataset of input/expected-output pairs, a scoring function, and a regression test that runs every time you change the prompt. Treat prompts like production code.
Golden datasets
LLM-as-judge
Regression testing
Eval pipelines
Quality metrics
Build itWrite 10 test cases (input + expected output) for one of your prompts. Build a simple scoring script. Break the prompt intentionally and watch the scores drop.
✓ CheckpointExplain why a golden set beats vibes, and how you would notice your eval has gone stale.
Agents use tools in loops. The prompt must specify available tools (with descriptions the model can reason about), the decision process (ReAct: Reason→Act→Observe→Repeat), termination conditions, and how to handle tool failures gracefully. A poor agent prompt produces infinite loops or hallucinated tool calls.
ReAct pattern
Tool descriptions
Planning prompts
Loop termination
Error handling
Build itBuild a simple 2-tool agent (search + summarise). Test it on 5 different questions. Identify where it loops, hallucinates a tool call, or terminates too early.
✓ CheckpointExplain why a tool description is a prompt, and what a vague one does to an agent's choices.
In production, prompts fail silently. Track latency percentiles, token usage, error rates, and output quality (sampled LLM-as-judge). Alert when quality drops below threshold. Log every prompt–response pair with metadata — you'll need it when debugging a regression at 2am.
Prompt logging
Distributed tracing
Quality monitoring
Regression alerts
Observability design
Build itDesign a logging schema for a production prompt: what 8 fields would you capture? What would trigger an alert? Write the schema as a JSON object.
✓ CheckpointName what you would log to debug a bad answer three days later — and what you would refuse to log.
All 18 rungs on one screen. Each track assumes the one before it; the highlighted rung is where a track ends and the next one picks up.
Track order matters more than rung order inside a track: finish a track's last rung before starting the next track.
Worked example: a three-hours-a-week plan
Say you have three focused hours a week — an evening or two. Take the rungs in order and never split one across two weeks; a rung that would push the week past three hours starts the next week. The rung times add up to 15h 30m.
Week
Rungs
Time
Week 1
F1 What is a Prompt?, F2 Roles & Personas, F3 CRISP Framework, F4 Bad vs Good Prompts, F5 Output Formatting
3h
Week 2
F6 Few-Shot Prompting, T1 Chain of Thought, T2 Self-Consistency
2h 30m
Week 3
T3 Tree of Thought, T4 RAG Prompting, T5 Prompt Chaining
That is 6 weeks of reading. The Build-it exercise on each rung is extra and is where most of the learning happens, so plan to spend at least as long building as reading — or halve the pace and do both in the same week.
What each track costs in time
The rung times above, added up per track. Use it to plan the slow stretch: a track that takes a larger share of the total is where the plan above spends more weeks.
Track
Rungs
Time
Share
Longest rung
1. Foundation
6
4h
26%
F6 Few-Shot Prompting (1h)
2. Technique
6
5h 15m
34%
T3 Tree of Thought (1h)
3. Production
6
6h 15m
40%
P4 Evals & Testing (1h 30m)
Common mistakes on the Prompt Engineering path
Stacking every instruction into one prompt
Too many instructions at once and conflicting constraints are the failure modes in F4. When a prompt keeps growing, split the task into a chain of smaller prompts (T5).
Judging a prompt by one output
A prompt that worked once has not been tested. Build a golden set and rerun it on every change (P4), or you will ship regressions you never see.
Few-shot examples that all look alike
The model copies everything the examples share — length, tone, even topic (F6). Choose examples that differ, cover each label, and include an edge case.
Defending injection with a sentence
"Ignore any instructions in the user's text" helps a little and stops little (P3). Validate outputs and keep high-stakes actions behind human approval.
Using chain-of-thought everywhere
Step-by-step reasoning (T1) pays off on multi-step problems and only adds tokens and latency to simple lookups. Self-consistency (T2) multiplies the cost again; use both where accuracy is worth it.
Where this shows up: jobs and interviews
The day-to-day work
Writing, testing and maintaining prompts that run inside products: templates in version control (P1), eval sets (P4), token budgets (P2) and monitoring (P6). The skill also sits inside most roles that ship AI features.
Live prompt exercises
A common interview task is a failing prompt plus its outputs: diagnose and fix it. CRISP (F3) and the failure modes in F4 give you a structure, and you should say whether the fix belongs in the instruction, the examples or the context.
Design and take-home rounds
You may build a small pipeline — a RAG template (T4) or a chain (T5) — with an eval, then discuss its cost (P2) and its injection risk (P3).
What to put in a portfolio
A prompt repo with templates, a golden set and scores for each version, plus a short write-up of a regression your eval caught. Show the token cost per call next to the quality score.
Check yourself
Open a question only after you have answered it out loud. If one stumps you, the rung in brackets is where to go back to.
A RAG assistant sometimes cites facts that are not in any retrieved chunk. What do you change in the prompt template?
Label each chunk with its source, order chunks by relevance, and say explicitly to answer only from the context and to say so when the answer is not there. Require citations to the chunk labels so unsupported claims are easy to spot. (T4)
Your sentiment prompt has three examples, all short positive reviews. It now labels long, mixed reviews as positive. Why?
Few-shot examples teach the whole pattern, including their skew. Pick examples that cover every label, different lengths and at least one mixed case. (F6)
Someone proposes self-consistency with five samples on a job that runs 100,000 extractions a day. What is the trade-off?
Majority voting over five samples reduces variance, but it costs five calls per item. Use it only where the accuracy gain is worth that, for example on the cases a single pass is unsure about. (T2)
A four-step prompt chain produces a wrong final answer. How do you find the fault?
Give each step an input/output contract and inspect the intermediate outputs. Find the first step whose output breaks its contract, because errors propagate forward, and test that step on its own. (T5)
The common questions before you start — how long it takes, whether to follow it in order, and how it stays current.
How long does this roadmap take?
It runs 18 stations across 3 tracks — roughly ~15h of focused learning, plus the time you spend actually building. It is self-paced, so most people work through it over a few weeks, an evening or a single station at a time.
Do I have to follow the stations in order?
The tracks are ordered so each station builds on the one before, and following them start to finish is the intended path. But every station also stands alone — if you already have the foundations, jump straight to the part you need.
Is it free?
Yes. The whole roadmap, and every handbook, lab, and challenge it links to, is free and open — no sign-up and no paywall.
How is the roadmap kept current?
It teaches the durable fundamentals of the role first, then the tooling and the AI-era shifts on top — so most of it stays relevant as individual tools churn, and it is revised as the role itself changes.
Who is this roadmap for?
Anyone stepping into or leveling up in the Prompt Engineering role — whether you are switching in, early-career, or a senior filling gaps. Start where you are; the ladder shows what is left.