A template is a prompt with holes in it that are filled at runtime.
The fixed part carries the instructions and the holes carry the data.
That separation is what makes prompting repeatable rather than artisanal.
The same template runs a thousand times, so a small improvement is worth a great deal.
Templates make prompts testable, since you can run a fixed set of inputs through a change.
They belong in version control, because a prompt edit is a behaviour change like any other.
Naming and versioning them lets you roll back when a change quietly makes things worse.
Never build one by pasting untrusted text straight into the instruction area.
That is prompt injection by construction, and it is the same class of bug as SQL injection.
Put user content inside clear delimiters and say that everything within them is data.
Keep the variable parts small, since a template whose holes carry most of the content is not a template.
Watch the token budget, because a template plus retrieved documents can overflow quietly.
Libraries help but the discipline matters more than the tool.
Log the filled prompt in development, as most surprises are visible the moment you read it.
Treat a template as a function, with inputs, a contract and tests.