Turn inconsistent AI answers into predictable, repeatable outputs. Designed for team leads, content operators, and developers building custom GPTs, Claude projects, or internal workflows, this workbench rewrites rough prompts into modular templates with clear role boundaries, explicit constraints, input variable placeholders, and an evaluation checklist to test edge cases.
1. Configure Inputs
Stateful DO Session
2. Workbench Output & Refinements
Sample preview (#1) — click Run Agent for live output
Diagnosis of Current Prompt
"Tell me if the user is angry" is subjective; without a scoring rubric, models misclassify polite urgency or quiet churn risk.
No category list or reply guardrails, tempting models to invent troubleshooting steps or promise unverified fix dates.
Optimized Prompt Template
# Role & Objective
You are a technical support triage analyst. Classify the ticket strictly from the provided text and draft a calm first response.
# Input Data
- Ticket: {{ticket_text}}
- Allowed Product Areas: [Billing, Login & Auth, Data Export, Mobile App, Other]
# Instructions & Guardrails
1. Pick one Product Area from the allowed list.
2. Score Urgency:
- P1 (Critical): Account locked, double-charge, or total blocker.
- P2 (Standard): Degraded feature with a partial workaround.
- P3 (Low): How-to question or minor UI glitch.
3. Never invent fix dates, refund promises, or unverified steps. Ask up to 2 clarifying questions if needed.
# Output Format
- **Product Area**: [Category]
- **Urgency**: [P1/P2/P3] — [1-sentence reason]
- **Issue Summary**: [2 sentences max]
- **Draft Reply**: [3 sentences max acknowledging the issue]
Why This Version Works Better
Constrains product areas to a fixed enum list for consistent team reporting.
Replaces emotion guessing with an impact-based 3-tier urgency rubric.
Blocks fabricated release dates and unauthorized refund commitments.
Quick Stress-Test Inputs
Test 1 (Vague complaint): "Nothing loads since yesterday, cancel my plan!" (verifies the reply asks for device details without promising a refund).
Test 2 (Dual issue): A ticket asking how to export CSVs while reporting a double charge (verifies P1 billing takes priority).
You will get a failure-mode diagnosis of your draft, a copy-ready structured prompt with variable placeholders, and two edge-case test scenarios.
Multi-Turn Refinement Chips (Same Session)
3 Curated Worked Examples
Inspect real sample inputs and structured deliverables for the AI Prompt Optimizer Agent. Click Try in Workbench on any example to load its parameters into the form above.
Example 1: Customer support ticket triage and safe draft reply
Your current prompt or rough task idea: Summarize customer support tickets and tell me if the user is angry and what product ar...What should the ideal output look like?: A triage card with product area, urgency 1-3 with clear criteria, a 2-sentence root iss...Where will you use this prompt?: Reusable Team Prompt TemplateTone: Structured & Precise
Diagnosis of Current Prompt
"Tell me if the user is angry" is subjective; without a scoring rubric, models misclassify polite urgency or quiet churn risk.
No category list or reply guardrails, tempting models to invent troubleshooting steps or promise unverified fix dates.
Optimized Prompt Template
# Role & Objective
You are a technical support triage analyst. Classify the ticket strictly from the provided text and draft a calm first response.
# Input Data
- Ticket: {{ticket_text}}
- Allowed Product Areas: [Billing, Login & Auth, Data Export, Mobile App, Other]
# Instructions & Guardrails
1. Pick one Product Area from the allowed list.
2. Score Urgency:
- P1 (Critical): Account locked, double-charge, or total blocker.
- P2 (Standard): Degraded feature with a partial workaround.
- P3 (Low): How-to question or minor UI glitch.
3. Never invent fix dates, refund promises, or unverified steps. Ask up to 2 clarifying questions if needed.
# Output Format
- **Product Area**: [Category]
- **Urgency**: [P1/P2/P3] — [1-sentence reason]
- **Issue Summary**: [2 sentences max]
- **Draft Reply**: [3 sentences max acknowledging the issue]
Why This Version Works Better
Constrains product areas to a fixed enum list for consistent team reporting.
Replaces emotion guessing with an impact-based 3-tier urgency rubric.
Blocks fabricated release dates and unauthorized refund commitments.
Quick Stress-Test Inputs
Test 1 (Vague complaint): "Nothing loads since yesterday, cancel my plan!" (verifies the reply asks for device details without promising a refund).
Test 2 (Dual issue): A ticket asking how to export CSVs while reporting a double charge (verifies P1 billing takes priority).
Example 2: Structured JSON extractor for B2B vendor invoices
Your current prompt or rough task idea: Extract the vendor name, date, line items, and total from this raw OCR invoice text and...What should the ideal output look like?: Strict JSON object with ISO dates, numeric amounts without currency symbols, and null w...Where will you use this prompt?: API System Prompt (Structured Output)Tone: Developer-Ready
Diagnosis of Current Prompt
"Output JSON" without field names or types leads to inconsistent keys (vendor vs vendorName) and string-formatted numbers like "$1,240.00" that break downstream parsers.
No fallback rule for missing OCR text, tempting the model to guess totals or hallucinate dates.
Optimized Prompt Template
You are a deterministic document extraction engine. Parse the raw OCR invoice text inside <invoice_text> and return ONLY a valid JSON object matching the schema below. Do not wrap the response in commentary.
<invoice_text>
{{raw_ocr_text}}
</invoice_text>
Rules:
1. Format all dates as YYYY-MM-DD. If the date is ambiguous or missing, output null.
2. Output monetary values as plain numbers (e.g., 1240.50), stripping currency symbols and thousands separators.
3. Extract a 3-letter ISO 4217 currency code (e.g., "USD", "EUR") if visible; otherwise null.
4. Never compute or guess missing totals; extract only what appears in the text.
Required JSON Structure:
{
"vendor_name": string | null,
"invoice_number": string | null,
"invoice_date": "YYYY-MM-DD" | null,
"currency": string | null,
"line_items": [
{ "description": string, "quantity": number | null, "unit_price": number | null, "line_total": number | null }
],
"subtotal": number | null,
"tax_amount": number | null,
"total_amount": number | null
}
Why This Version Works Better
Wraps untrusted OCR input inside XML tags (<invoice_text>) to separate data from instructions.
Enforces strict data primitives (ISO dates, raw floats, explicit null values) for database ingestion.
Forbids math imputation so OCR errors surface as null rather than silent miscalculations.
Quick Stress-Test Inputs
Test 1 (Partial receipt): An OCR snippet missing a tax line and showing a smudged date "11/??/2026" (verifies invoice_date and tax_amount return null).
Test 2 (European formatting): Prices written as 1.450,00 EUR (verifies decimal normalization to 1450.00).
Example 3: Weekly project status update synthesizer from rough notes
Your current prompt or rough task idea: Turn my messy bullet notes from this week into a clean executive update for leadership.What should the ideal output look like?: A scannable update under 180 words with Shipped, In Progress, Blockers/Decisions Needed...Where will you use this prompt?: Daily Chat (ChatGPT / Claude / Gemini)Tone: Minimalist & Tight
Diagnosis of Current Prompt
"Clean executive update" often triggers wordy corporate jargon and inflated claims unless you set a strict word ceiling and ban filler adjectives.
No section for concrete asks, which buries blockers that actually need leadership decisions.
Optimized Prompt Template
# Role
Act as a technical program manager writing a concise weekly status brief for senior stakeholders.
# Raw Notes
{{weekly_notes}}
# Writing Rules
- Keep the entire response under 180 words.
- Use plain, factual language. Cut filler words ("synergy", "excited to announce", "seamlessly").
- Preserve exact metrics, ticket IDs, and dates from the notes. Never invent progress percentages or completion dates.
- If a date or owner for a blocker is missing in the notes, insert [Owner/Date needed] so I can fill it in before sending.
# Output Format
## 1. Shipped This Week
- **[Deliverable]**: [1-sentence outcome or metric]
## 2. In Flight (Next 7 Days)
- **[Workstream]**: [Current status and target milestone]
## 3. Blockers & Decisions Needed
- **[Issue]**: [Impact] — **Ask**: [Specific decision or resource needed from leadership]
Why This Version Works Better
Forces every blocker to end with an explicit Ask so stakeholders know what action is required.
Uses [Owner/Date needed] markers instead of letting the model fabricate delivery dates.
Caps total length at 180 words so the update fits on a single mobile screen.
Quick Stress-Test Inputs
Test 1 (No blockers week): Notes with three completed items and zero blockers (check that section 3 states "None — all milestones on track" rather than inventing risks).
Test 2 (Metric-heavy notes): Shorthand notes like "onboarding latency down 340ms -> 190ms" (check that exact numbers survive intact).
Practical Workflow Tips
How to get sharper, more reliable results from this workbench and verify output before publishing or shipping.
Separate static instructions from changing user inputs with clear delimiters like XML tags (<context>...</context>) or double curly braces ({{input}}) so the model never confuses data with commands.
Tell the model what to do when information is missing—such as inserting [Missing detail] or null—because language models default to guessing plausible fillers unless given an escape hatch.
Replace subjective adjectives like 'short' or 'professional' with measurable constraints like 'under 140 words' or 'no exclamation marks and no first-person pronouns'.
Keep a small notepad of 3 difficult real-world inputs and run every prompt revision against those same 3 inputs before rolling a template out to your team.
Frequently Asked Questions
Why do my AI prompts work well once and then fail on different inputs?
One-off prompts usually rely on implicit context that happens to exist in your first test input. When a later input lacks a date, contains conflicting notes, or uses different terminology, the model improvises. Adding explicit fallback rules and input variable blocks makes behavior predictable across edge cases.
Should I include examples inside my system prompt?
Yes, adding one or two compact input-to-output pairs (few-shot prompting) is the fastest way to lock in tone, formatting, and classification accuracy. Keep few-shot examples concise and structurally identical to your target output format so the model does not copy irrelevant details.
Does this prompt optimizer work for ChatGPT, Claude, and open-weights models?
Yes. Clear structural hierarchy—role definition, delimited input variables, explicit negative constraints, and a concrete output template—improves consistency across OpenAI, Anthropic Claude, Google Gemini, and open-weights models running on Workers AI or local runtimes.
Related AI Agent Workbenches
Pair the AI Prompt Optimizer Agent with these complementary workbenches and deep guides.
A practitioner guide to generating, testing, and auditing Excel, Google Sheets, and SQL logic with AI without leaking sensitive data or breaking reports.