For recurring tasks — summarising tickets, drafting replies, classifying documents — a prompt template with variables keeps quality consistent.
What a Template Looks Like
You summarise customer support tickets for the {team_name} team.
Summarise the ticket below in {max_bullets} bullet points, then give a priority: low, medium or high.
<ticket>
{ticket_text}
</ticket>
Code fills in the variables for each request.
Benefits
- Consistent instructions across every use.
- Easy to improve once and apply everywhere.
- Versionable and testable.
Good Practice
- Keep fixed instructions separate from variable inputs.
- Delimit inserted content clearly with tags.
- Validate and limit inserted values (length, allowed characters).
- Provide defaults for optional variables.
- Name variables clearly.
Security
Inserted content — user input, documents, emails — may contain instructions. Treat it as untrusted: delimit it, limit the assistant's capabilities, and validate outputs.
Version and Test
Store templates in source control. When changing a template, run it against a test set of real inputs and compare results.
Share Templates
For teams, a small library of approved templates for common tasks spreads good practice and reduces risky improvisation.