AI CompendiumA public chart of the language
Home / Prompting & Structure / Prompt Engineering
Prompting & Structure

Prompt Engineering

The craft of writing instructions a model reliably follows.

Definition

Designing the input that produces the output you want: role, task, constraints, examples, and format. It is specification writing where the executor is literal and cannot ask clarifying questions.

It is less about magic phrases and more about clarity, specificity and giving the model something checkable to work with. When a prompt fails, ask what a new contractor would misunderstand.

The framing that ages well is that this is evaluation-driven specification work. A technique is worth adopting because it moved a number on a test set you trust, and it is worth dropping when it stops moving that number. Techniques that helped one model generation frequently do nothing for the next, which is why the practice has to be empirical rather than remembered.

How people use it
A failing feature.
"The prompt says 'be concise'. Concise relative to what? Give it a length and an example."
Worked examples

Specifying instead of pleading

A summariser keeps producing vague summaries.

"Be concise" is unmeasurable, so the model picks a definition at random. "Three bullets, each under fifteen words, no preamble, name the decision in the first bullet" is checkable by a human and by a grader — and the output stops drifting.

A prompt change with no test

A prompt edge case is fixed and something else quietly breaks.

Prompts interact: tightening one rule often loosens another. Keep a small set of cases with expected outcomes, and run it before shipping the change. Twenty cases catch most of it and take an afternoon to build.

Avoid

Collecting incantations without understanding why they work. Approaches that helped one model often do nothing for another.

Sources
  • docsPrompting best practices ↗Claude platform docs · 2026

    The current house guidance on explicit instructions, output constraints, examples, XML structure and role prompting.

  • docsPrompt engineering overview ↗Claude platform docs · 2026

    Ties each prompting technique to a success criterion and to empirical evaluation, rather than presenting them as a bag of tricks.

  • docsEvaluation best practices ↗OpenAI API docs · 2026

    Evals as structured tests: task-specific test sets, continuous evaluation, logging, and human calibration of automated scoring.

Related terms