A lot of "prompt engineering" is people poking at a text box until something works, then never touching it again out of fear. That's not engineering. A prompt is a specification-it defines what the model should do, what shape the output takes, and what to do at the edges. Write it the way you'd write any spec the rest of the system depends on.
Be explicit, then constrain the output
Models don't generalize your intent the way a teammate would; they do what you actually said. When I built a grading engine, "grade this essay" produced inconsistent, unreviewable output. Anchoring the prompt to the rubric-score each criterion explicitly, justify each score-turned a vague request into a structured, auditable result. The same lesson holds everywhere: name the criteria, define the format, and where the output feeds code, constrain it to a schema so you parse data, not prose.
A good prompt reads like a spec a new hire could follow: what to produce, in what shape, and what to do when the input is weird.
Version it and test it
If a prompt is load-bearing, it deserves the same discipline as code: keep it in version control, change it deliberately, and check that a change didn't regress behavior on real examples. A one-word edit can shift outputs across thousands of requests-you want to catch that before users do.
What "treating prompts as specs" looks like in practice:
- Be explicit about the task, the format, and the constraints-don't rely on the model to infer.
- Constrain the output to a schema when code consumes it; parse data, not free text.
- Show examples of good output-they steer behavior better than more adjectives.
- Version and eval every load-bearing prompt; a small wording change is a real change.