Prompt Engineering

A vague request forces a language model to guess what success means. The result may be fluent but aimed at the wrong audience, missing required constraints, or formatted so it cannot be used.

Prompt engineering is the practice of making the task and its evaluation criteria visible in the input.

A Practical Prompt Structure

A useful prompt can state:

  1. the goal;
  2. relevant context and source material;
  3. constraints and boundaries;
  4. the specific input to transform or analyze;
  5. the required output format; and
  6. examples when the desired pattern is otherwise ambiguous.

Not every task needs all six parts. Add information that changes the answer, not ceremony.

Examples Change the Contract

A prompt with no worked example is often called zero-shot. One example is one-shot, and several are few-shot. Examples are especially useful when the output must follow a classification scheme, tone, or exact structure.

Examples also create risk: the model may copy incidental details or infer a rule that was not intended. Use representative examples and accompany them with an explicit rule when correctness matters.

Roles Are Context, Not Guarantees

“Act as a cloud architect” can suggest vocabulary and perspective, but it does not grant expertise or make an answer correct. A more useful instruction describes the actual audience, decision, constraints, and evidence available.

Compare:

Act as an architect. Design a network.

with:

Propose two network layouts for three regional services.
The operations team needs one place to maintain firewall policy.
Compare failure isolation and administrative complexity in a table.
State assumptions and flag any missing information.

The second prompt gives the result an inspectable shape.

Provide Repository Context for Code Work

A coding assistant cannot reliably infer conventions that are visible only elsewhere in a repository. Supply the context that changes the implementation:

Prefer pointing to small, representative files over dumping an entire repository into the prompt. State which details are requirements and which are merely examples.

For a code review, define both the scope and the evidence expected. Asking for findings about correctness, security, performance, readability, or test coverage is more useful when each finding must identify the affected location, explain the risk, and suggest a verification method.

Handle Uncertainty Explicitly

A language model generates plausible output and can produce unsupported claims. Instructions can reduce ambiguity, but they cannot prove factual accuracy.

For consequential work:

Prompting improves the interface to a model. Tool access may expand what the model can attempt, but neither prompting nor tools replace evidence, review, or engineering accountability.