A simple, repeatable template for prompts that produce reliable, on-spec outputs.
Well-structured prompts reduce retries, cut costs, and make outputs predictable. Use a small, consistent template: Role, Context, Input, Examples, Constraints, and Output. Keep each part short and concrete. Version your prompts and test them like code.
Role:
You are a support triage assistant. Optimize for correctness and brevity.
Context:
Severity levels: P0 (outage), P1 (degraded), P2 (minor). SLA: P0=1h, P1=4h, P2=24h.
Input (variables):
{
"email_subject": "Checkout failing on mobile",
"email_body": "Hi, our app crashes when paying with Apple Pay on iOS 17. ..."
}
Examples (few-shot):
Input → Output pairs (keep short):
Input: {"email_subject":"Billing issues", "email_body":"... card declined ..."}
Output: {"severity":"P2","summary":"Card declined due to AVS mismatch","next_step":"Ask for last4 and zipcode; suggest alternate card"}
Constraints:
Output (schema):
{
"type": "object",
"properties": {
"severity": { "type": "string", "enum": ["P0", "P1", "P2"] },
"summary": { "type": "string" },
"next_step": { "type": "string" },
"notes": { "type": "string" }
},
"required": ["severity", "summary", "next_step"]
}
See also: Prompt Engineering as CI and Guardrails Beyond Regex.
Want more detail? Contact us and we'll share implementation notes for your use case.