Prompt templates that actually work

Most prompt failures are missing constraints, not weak models.

Chen YiyuPublished on 2026-01-18Read in about 6 minutesPrompts · Templates · Workflow

By the fifth rewrite of the same instruction, people do not write it more carefully — they write it shorter. And what gets cut is usually exactly the part that decided quality: who the reader is, what format the output takes, and what counts as unacceptable.

Four constraints worth hard-coding

A prompt that says only “summarise this” leaves every judgement to the model. Add these four and the output for the same text is usually visibly better:

  • Who the reader is The same document compresses differently for a peer and for a newcomer.
  • Length or item count “At most five bullet points” is executable; “keep it concise” is not.
  • Output format A list, a paragraph or JSON decides whether the result can feed a downstream step.
  • What not to do Do not speculate, do not invent numbers, say so when unsure. This is the most-omitted item and the most valuable.

Variables belong where they are used

There is a counter-intuitive trade-off in template design: fewer variables is better, not more.

A template with twelve placeholders is really a form you have to refill. Templates that survive daily use tend to have three: target language, audience, and the payload. Everything else is written as fixed text, because it was never supposed to vary. The prompt template filler enforces the same rule — unfilled variables never reach the output.

Empty fields should vanish, not leave a placeholder

Sending an unsubstituted [[variable]] to a model is a reliable way to derail the output: the model tries to interpret the bracketed phrase instead of ignoring it.

So the correct behaviour is to remove the whole fragment. That also means the person filling the template notices immediately — an incomplete sentence is far more noticeable than a placeholder they have learned to skim past.

A template is a checklist, not an incantation

One last point about mindset. A template does not promise a better answer. It promises that this time you will not forget the constraints.

Read it as a checklist: is the audience set? Is the length set? Is the format set? Are the prohibitions written? Answer those four and the rest is the model's job.

Keep reading

The value of a template is not the typing it saves. It is the constraints it refuses to let you omit. A good template reads like a checklist, not like an incantation.