liveBook · Manning

Prompt engineering

As explained in Prompt Engineering in Practice

The deliberate construction of a prompt's instructions, context, constraints, and output requirements.

Prompt engineering is the deliberate composition, evaluation, and refinement of prompts for reliable, predictable language-model outputs. Unlike casual prompting, it treats a prompt as a shared interface: instructions, context, constraints, inputs, and output requirements are specified so others can review, test, and maintain them. It changes the text at the model interface, not the model’s weights or training data. section 1.2 section 1.7

A reusable prompt makes its contract explicit:

  • Task: state what the model must do and who will use the result. section 1.3
  • Context and inputs: supply the facts needed for the task and mark what constitutes the input. section 1.7
  • Constraints and output: specify limits, required content, and a format that can be checked against acceptance criteria. section 1.3 section 1.2

Pull-request orientation prompt

Task: Summarize the pull request for reviewers before they read the diff. Input: Authentication middleware now delegates session validation to a new SessionValidator class instead of parsing sessions itself. Constraints: Use only the supplied change description; do not infer test results or effects not stated. Output: A short change summary followed by a list of points reviewers should verify. Check the result for accurate scope, the requested format, and unsupported claims. This contract is more reviewable than “Summarize this pull request.” section 1.2 section 1.3

Work in a cycle: draft the contract, test it on representative inputs, compare outputs with acceptance criteria, revise observed failures, and preserve the prompt’s owner and change history. Diagnose vague or unusable output against the task, supplied facts, constraints, and output shape before changing wording at random. Precision costs some up-front effort but can reduce downstream editing; an API migration notice, for example, needs operational facts and required actions rather than a merely plausible generic summary. section 1.7 section 3.1.1 section 3.4.2

How Prompt Engineering in Practice covers it

How deep it goes
Defines the practice and lays out composition, testing, iteration, and management; stops short of changing model weights.
Examples
Uses a pull-request summary, an API migration notice, and revisions of architecture-diagram and ADR-summary prompts.
What it assumes
Assumes familiarity with software engineering and basic chat use, but requires no machine-learning background.
What you can do after
Build it from scratch as a testable prompt contract, then refine failures and maintain its change history.
How it connects
Connects prompt specifications to API contracts, acceptance criteria, version control, and systematic debugging.

Also explained in

Compare how 38 books explain prompt engineering →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Prompt Engineering in Practice. The section links point to the parts of the book it draws on.