Prompting
Prompt engineering
Prompt engineering is the practice of structuring the text sent to a language model so that its output is reliable enough to build on.
The techniques that survive contact with production are unglamorous: state the task as one imperative, specify the output format exactly, delimit reference material, group constraints, and show two or three examples covering the boundaries rather than the obvious case.
Ordering matters because models weight the start and end of a prompt more heavily than the middle. Role and task go first, bulk context in the middle, output constraints last.
In practice
The measurable part is small and boring: state the task first, delimit the data, show two examples rather than describe a format, and decide the edge cases in writing. The unmeasurable part — collecting clever phrasings that seemed to help once — is where most of the time goes and almost none of the improvement.
Common questions
What actually improves a prompt?
State the task in the first two sentences, delimit the data from the instructions, show two examples instead of describing a format, and decide the edge cases in writing. Most measured improvement comes from those four.
Is prompt engineering still necessary with newer models?
Less of the clever phrasing, none of the structure. Newer models need fewer tricks but the same clarity: an ambiguous instruction is still resolved differently on different runs, and an undefined edge case is still where hallucination lives.
Measure it
- Structured Prompt BuilderDeterministic, not AI-generated. Six sections, live token cost, copy as plain text or XML tags.
- Prompt LinterStructural review of a prompt: what is costing you money and what will fail.
- Prompt Diff and Token ComparisonBefore and after, with the token delta priced. The missing half of every prompt rewrite.