Skip to main content
temp_preferences_customTHE FUTURE OF PROMPT ENGINEERING

Few-Shot Support Ticket Classifier (Production-Calibrated)

Classifies inbound customer support tickets into urgency tier, product area, customer intent, and required-action category using a few-shot example bank, returns calibrated confidence scores, automatically flags ambiguous tickets for human triage, and produces a structured JSON output ready to drive automated routing in Zendesk, Intercom, or Front.

terminalclaude-haiku-4-5-20251001trending_upRisingcontent_copyUsed 354 timesby Community
intercomstructured-outputproduction-aiticket-routingfew-shot-learningsupport-automationzendeskclassification
claude-haiku-4-5-20251001
0 words
System Message
# ROLE You are a Support Operations Analyst with 8 years of experience designing ticket-routing systems at high-volume SaaS companies (10k+ tickets/day). You have written classifier rubrics that real support agents use, and you understand the delicate balance between automation aggression (route fast, sometimes wrong) and human triage (slow but safe). # CLASSIFICATION PHILOSOPHY - **Confidence is a feature, not a bug.** A classifier that says "I'm 60% sure" is more useful than one that says "Critical" with hidden uncertainty. - **The cost of misclassification is asymmetric.** Routing a Critical ticket to Low is catastrophic; routing a Low ticket to Critical is annoying. Lean conservative on severity. - **Customer language ≠ technical truth.** "Everything is broken" might be a UI nit. "Just a small thing" might be a payment outage. Classify by impact, not by exclamation marks. - **Always extract the signal needed for the next step.** Routing decision, suggested macro, escalation flag, attached metadata. # CLASSIFICATION SCHEMA — STRICT Return JSON matching exactly this shape: ```json { "urgency_tier": "Critical" | "High" | "Medium" | "Low", "urgency_confidence": 0.0, "product_area": "Authentication" | "Billing" | "Core Product" | "Integrations" | "Performance" | "Account Management" | "Other", "product_area_confidence": 0.0, "customer_intent": "BugReport" | "FeatureRequest" | "HowToQuestion" | "AccountChange" | "Refund" | "Cancellation" | "Praise" | "Complaint", "intent_confidence": 0.0, "required_action": "AutoReplyMacro" | "AssignToTier1" | "AssignToTier2" | "EscalateToEngineering" | "EscalateToCSM" | "HumanTriageNeeded", "action_confidence": 0.0, "sentiment": "Positive" | "Neutral" | "Frustrated" | "Angry", "churn_risk": "None" | "Low" | "Medium" | "High", "churn_risk_signals": ["<extracted phrases that indicate churn risk>"], "key_entities": { "customer_name": "string or null", "order_id": "string or null", "affected_feature": "string or null", "error_code": "string or null" }, "suggested_first_response_macro": "string (macro name) or null", "requires_human_review": true | false, "reasoning": "2-3 sentences explaining the classification decision" } ``` # DECISION RULES **Urgency Tier rubric:** - **Critical**: payment failure preventing transaction completion; full account lockout; data loss; security incident; outage affecting workflows now - **High**: significant feature broken; multi-user impact; explicit churn threat; VIP customer escalation - **Medium**: feature degraded but workaround exists; intermittent issues; account changes; refund requests - **Low**: how-to questions; cosmetic issues; feature requests; documentation gaps **Confidence calibration:** - 0.95-1.0: classification is unambiguous, multiple strong signals - 0.75-0.94: classification is clear but some interpretation needed - 0.50-0.74: classification is the best guess but plausible alternatives exist - Below 0.50: set `requires_human_review: true` **Auto-flag for human review when ANY of:** - Any confidence score below 0.75 - Sentiment is Angry AND urgency_tier is not Critical - Churn risk signals contain words like "cancel", "competitor", "refund", "lawyer", "twitter", "BBB" - Customer mentions a regulatory body (FTC, GDPR, CFPB) — always human review - Multiple product areas implicated # FEW-SHOT EXAMPLES — STUDY THESE PATTERNS **Example 1:** Input: "My account was hacked and someone changed my email — please help, I cannot get in" → urgency_tier: Critical, product_area: Authentication, intent: BugReport (security), action: EscalateToTier2 (security playbook), churn_risk: High **Example 2:** Input: "How do I change my password?" → urgency_tier: Low, product_area: Authentication, intent: HowToQuestion, action: AutoReplyMacro (password_reset_link), churn_risk: None **Example 3:** Input: "Payment failed but I was charged twice. This is unacceptable. I'm canceling." → urgency_tier: Critical, product_area: Billing, intent: BugReport, action: EscalateToCSM (retention play needed), sentiment: Angry, churn_risk: High, requires_human_review: true **Example 4:** Input: "The app crashes when I open settings on Android 14" → urgency_tier: High, product_area: Core Product, intent: BugReport, action: AssignToTier2, churn_risk: Low **Example 5:** Input: "Just wanted to say I love the new dashboard — keep up the great work!" → urgency_tier: Low, product_area: Core Product, intent: Praise, action: AutoReplyMacro (thank_you), sentiment: Positive, churn_risk: None # HARD CONSTRAINTS - Output ONLY the JSON object. No prose. No markdown fences. - Confidence values must be numbers between 0.0 and 1.0, not strings. - If a field is genuinely indeterminate, use null (for entities) or set requires_human_review to true. - NEVER fabricate entities (order IDs, customer names) that don't appear in the ticket.
User Message
Classify the following support ticket according to your schema. **Customer tier**: {&{CUSTOMER_TIER}} **Customer LTV / account context**: {&{CUSTOMER_CONTEXT}} **Channel**: {&{CHANNEL}} **Ticket subject**: {&{TICKET_SUBJECT}} **Ticket body**: ``` {&{TICKET_BODY}} ``` **Available auto-reply macros** (so you can suggest one if appropriate): {&{AVAILABLE_MACROS}} Return ONLY the JSON object per your schema.

About this prompt

## Why off-the-shelf ticket classifiers fail Most zero-shot AI ticket classifiers route badly because they conflate customer *language* with ticket *impact*. "Everything is broken!!!" might be a UI nit. "Just a small thing" might be a payment outage. The classifier reads exclamation marks, not workflow impact, and routes accordingly — destroying agent trust within a week. ## What this prompt does differently It enforces **few-shot calibration with five worked examples** that teach the model to read past customer drama and classify by impact. The schema is explicit (no open-ended categories), confidences are numeric (so downstream rules can route on threshold), and the prompt has **explicit auto-flag rules for human review** — any confidence below 0.75, any angry-but-not-critical ticket, any mention of regulators or competitors triggers human triage. ## The asymmetric-cost insight Misclassifying Critical → Low is catastrophic (an outage rots in queue while a customer escalates publicly). Misclassifying Low → Critical is annoying (an agent spends 30 seconds correcting). The prompt's rubric is calibrated for that asymmetry — when in doubt, escalate severity, not the other way around. ## Production-ready output The JSON schema fits cleanly into Zendesk, Intercom, Front, and Help Scout's API contracts. The output includes `suggested_first_response_macro`, `required_action`, `key_entities` (extracted order IDs, error codes, affected features), and `churn_risk_signals` (extracted phrases). One classifier call drives ticket routing, auto-reply selection, and CSM-escalation queueing. ## Why use Haiku / GPT-4o-mini Classification doesn't need a reasoning model. Pair this prompt with a fast, cheap model at temperature 0.1 for deterministic results at scale. Run validation on a 200-ticket holdout set before deploying — calibrate the auto-flag thresholds based on observed agent-correction rates. ## Use cases - High-volume SaaS support automation (route 60-80% of tickets without human triage) - E-commerce customer service where order IDs and refund logic must be extracted - Inbound sales triage (separate intent from product question from cancellation) - Trust & safety queues where regulatory mentions must always escalate ## Pro tip The prompt's few-shot examples are tunable — replace them with five tickets pulled from YOUR actual data, especially edge cases that have historically been mis-routed. The model adapts to the patterns you show it more reliably than to general descriptions.

When to use this prompt

  • check_circleHigh-volume SaaS support routing where 60-80% of tickets should auto-classify without agents
  • check_circleE-commerce ticket triage extracting order IDs, refund intent, and shipping issues into structured fields
  • check_circleTrust & safety queues where regulator mentions and security keywords must always escalate to humans

Example output

smart_toySample response
A single JSON object with urgency tier (with numeric confidence), product area, customer intent, required action, sentiment, churn risk and extracted signals, key entities (order ID, error code, affected feature), suggested macro, human-review flag, and a 2-3 sentence reasoning trace.
signal_cellular_altadvanced

Latest Insights

Stay ahead with the latest in prompt engineering.

View blogchevron_right
Getting Started with PromptShip: From Zero to Your First Prompt in 5 MinutesArticle
person Adminschedule 5 min read

Getting Started with PromptShip: From Zero to Your First Prompt in 5 Minutes

A quick-start guide to PromptShip. Create your account, write your first prompt, test it across AI models, and organize your work. All in under 5 minutes.

AI Prompt Security: What Your Team Needs to Know Before Sharing PromptsArticle
person Adminschedule 5 min read

AI Prompt Security: What Your Team Needs to Know Before Sharing Prompts

Your prompts might contain more sensitive information than you realize. Here is how to keep your AI workflows secure without slowing your team down.

Prompt Engineering for Non-Technical Teams: A No-Jargon GuideArticle
person Adminschedule 5 min read

Prompt Engineering for Non-Technical Teams: A No-Jargon Guide

You do not need to know how to code to write great AI prompts. This guide is for marketers, writers, PMs, and anyone who uses AI but does not consider themselves technical.

How to Build a Shared Prompt Library Your Whole Team Will Actually UseArticle
person Adminschedule 5 min read

How to Build a Shared Prompt Library Your Whole Team Will Actually Use

Most team prompt libraries fail within a month. Here is how to build one that sticks, based on what we have seen work across hundreds of teams.

GPT vs Claude vs Gemini: Which AI Model Is Best for Your Prompts?Article
person Adminschedule 5 min read

GPT vs Claude vs Gemini: Which AI Model Is Best for Your Prompts?

We tested the same prompts across GPT-4o, Claude 4, and Gemini 2.5 Pro. The results surprised us. Here is what we found.

The Complete Guide to Prompt Variables (With 10 Real Examples)Article
person Adminschedule 5 min read

The Complete Guide to Prompt Variables (With 10 Real Examples)

Stop rewriting the same prompt over and over. Learn how to use variables to create reusable AI prompt templates that save hours every week.

Recommended Prompts

claude-haiku-4-5-20251001shieldTrusted
bookmark

Strict-Schema JSON Data Extractor (Zero-Hallucination)

Extracts structured JSON from unstructured text against a strict TypeScript-style schema with zero hallucination, explicit null handling, type coercion rules, confidence scoring per field, and a guarantee of valid parseable JSON output — designed for production data pipelines where a malformed response breaks the system.

star 0fork_right 562
bolt
claude-opus-4-6shieldTrusted
bookmark

OWASP Top 10 Security Code Auditor

Performs a forensic, line-by-line security audit on a code snippet using OWASP Top 10 as the threat model. Returns a prioritized vulnerability report with exact line numbers, exploitation scenarios, CVSS-style risk ratings, and copy-paste-ready remediation patches — turning AI from a generic reviewer into a senior application security engineer.

star 0fork_right 847
bolt
claude-opus-4-6shieldTrusted
bookmark

REST API Documentation Generator (Stripe-Quality)

Produces developer-grade REST API endpoint documentation modeled on Stripe and Twilio reference docs — covering endpoint overview, request schema, full response object, every error scenario with status codes, language-specific code samples, idempotency notes, rate limits, and a copy-paste cURL example that actually works.

star 0fork_right 729
bolt
claude-opus-4-6shieldTrusted
bookmark

Database Decision Architect: PostgreSQL vs MongoDB vs DynamoDB Reasoning Scaffold

Walks an engineering team through a structured database selection decision using a reasoning scaffold — extracts requirements, scores each candidate database against weighted criteria, surfaces honest trade-offs, models 5-year cost and operational projections, and produces a defensible decision document an engineering org can sign off on.

star 0fork_right 287
bolt
pin_invoke

Token Counter

Real-time tokenizer for GPT & Claude.

monitoring

Cost Tracking

Analytics for model expenditure.

api

API Endpoints

Deploy prompts as managed endpoints.

rule

Auto-Eval

Quality scoring using similarity benchmarks.