The Prompt Engineering Pyramid: Before vs After

A vague prompt has no foundation. A refined prompt has five layers — and each one multiplies precision.

Two side-by-side pyramids labeled Before and After. The Before pyramid (red) has empty layers labeled No role, No context, No examples, No format, ending in a question-mark apex. The After pyramid (green) has the same layer positions filled with Role and goal, Context, Examples, Format, and a star apex marked specific output. The visual implies that the After pyramid is structurally sound while the Before pyramid is missing every supporting layer.
Figure: prompt engineering before/after pyramid. SVG is CC BY 4.0 — credit prompt-improver-indol.vercel.app.

What the layers mean

  • Role & goal: who Claude is acting as and what it's optimizing for.
  • Context: the data, constraints, and history Claude needs to ground the answer.
  • Examples: 2–5 input/output pairs that pin down the desired pattern (few-shot).
  • Format: JSON schema, XML tags, or markdown structure for downstream parsing.
  • Specific output: the precise artifact you want — the apex sits on the other four.
Paste a prompt to see it refined →

Image license: CC BY 4.0. Embed via <img> or download and re-host with attribution.

🔥 Tonight: Claude Code Power Prompts · £5 £3 first 10Get PDF →