Prompt engineering

Prompt engineering is the practice of crafting the instructions given to an AI model to get reliable, high-quality output — tuning the request itself, as distinct from the context the model works on.

Prompt engineering is the practice of designing and refining the instructions given to a large language model so it produces reliable, high-quality output. It covers how a request is phrased, what role or format is specified, whether examples are included, and how a task is decomposed — all the levers that live in the instruction itself.

It matters because the same model can produce very different results from differently worded requests. A vague prompt invites a vague answer; a precise one that states the goal, the constraints, and the desired format narrows the model toward what you actually want. Techniques like few-shot examples, step-by-step decomposition, and explicit output schemas are all forms of prompt engineering.

Prompt engineering is often confused with its neighbor, context engineering, but the two operate on different inputs. Prompt engineering tunes the instruction; context engineering curates the surrounding knowledge the instruction operates on. For coding agents in particular, the limiting factor is usually not how the request is phrased but whether the agent was given the decisions, gotchas, and invariants of the code it is about to change. A perfect prompt over missing context still produces a confident, wrong edit.