Mastering Prompt Engineering
Prompt engineering is the closest thing the AI era has to typing — a small, almost embarrassingly simple skill that turns out to make a huge difference in productivity. It is not a job title. It is a craft. Here is what actually matters once you get past the LinkedIn fluff.
The four principles
1. Be specific about the output shape
Models are obedient about format. If you want JSON, say "return strict JSON only, with keys A, B, C and no markdown fences". If you want a five-bullet summary, ask for exactly five bullets. Vague output requests produce vague outputs.
2. Give role, then context, then task
The order matters more than people think. The model is doing prefix-conditioned generation; the first tokens disproportionately shape the rest. You are a senior security analyst… followed by the relevant context, followed by the question, beats the reverse every time.
3. Show, don't just tell
One or two worked examples (few-shot) lifts performance dramatically on most extraction and classification tasks. The examples don't need to be representative; they need to be format-correct.
4. Decompose
Hard prompts work better as a chain of small ones. "Summarise then critique then rewrite" beats "do all three at once". Chain-of-thought is just this principle in disguise.
The five anti-patterns
- The kitchen sink. Three pages of instructions confuse the model rather than constrain it. Aim for the shortest prompt that produces the right output.
- Politeness inflation. "Please could you possibly, if you don't mind…" wastes tokens and does not improve quality. Be direct.
- Negative-only constraints. "Do not include X" is much weaker than "Include only A, B, C".
- Ambiguous quantifiers. "A few", "some", "comprehensive" mean different things to different models. Use numbers.
- Trusting the first response. Always sample twice on important outputs and compare.
System vs user prompts
The system prompt is the model's persona and rules; the user prompt is the question. Treat them like a contract: the system prompt is the constitution, the user prompt is the day's law. Avoid putting volatile facts in the system prompt — it makes them hard to update.
The honest truth
Most "prompt engineers" are not engineers and there is rarely much to engineer. The real skill is understanding the underlying task well enough to describe it precisely. That is the same skill that makes a good product manager, a good lawyer, a good editor. Prompt engineering is just that skill applied to a particularly literal new colleague.
One trick worth memorising
"Before you answer, restate the problem in your own words. Then list any assumptions. Then answer."
That single instruction lifts accuracy on multi-step reasoning tasks by a measurable margin across every model I have tested. Steal it shamelessly.