Context engineering

Spec

Also called: specification

A spec is a written description of what to build and why, handed to the agent up front. Specs-as-context reliably beat vague one-line requests.

James Phoenix
Understanding Data Updated July 2, 2026

A spec is a written description of what you want built and why, handed to the agent before it starts. It does not have to be long. It has to be clear: the goal, the constraints, what "done" looks like, and any edge cases you already know about.

Why a spec beats a one-liner

"Add auth" leaves a thousand decisions to the model, and it will guess at every one, sometimes well, often not in the way you meant. A spec is context you provide up front so the agent solves your problem instead of a plausible nearby one. Vague input reliably produces vague output; specific input is the cheapest quality lever you have.

A workable spec usually states:

  • The goal, in one or two plain sentences.
  • Constraints: the stack, the patterns, what not to touch.
  • Acceptance criteria: how you will know it worked.
  • Known edge cases and how they should behave.

Spec, ticket, artifact

A spec is close kin to a ticket and a handoff artifact. All three are just written context that tells an agent what to do. The label matters less than the discipline of writing the thing down before you set the agent loose.

Tip
Have the agent restate the spec in its own words before it writes any code. If the readback is wrong, you caught the misunderstanding for the price of a sentence rather than a wrong implementation.

Related terms

Building with AI agents?

This dictionary is part of how I think about agentic engineering. If you want the same thinking applied to your codebase, that is what I do.

See how I can help