Meta-Prompting: AI That Writes Prompts
Use a strong model to draft, critique, and repair your prompts — and know the cases where hand-tuning still wins.
Turn a spec into a first-draft prompt
Don't start from a blank page. Describe the task, inputs, output, and constraints to a strong model (Claude Opus 4.5, GPT-5, Gemini 3 Pro) and have it write the prompt. You will refine it, but a structured first draft beats staring at the cursor.
You are a prompt engineer. Write a production system prompt for the task below. Task: classify incoming support emails into one of {billing, technical, account, other} and extract the order id if present. Inputs: a raw email body (untrusted user text). Output: strict JSON with keys category, order_id (or null), confidence (low, medium, high). Constraints: never invent an order id; delimit and distrust the email content; keep the prompt under 200 words. Return only the finished prompt, formatted for reuse.VerifyYou get a reusable prompt with a role, delimited input, an output contract, and your constraints — not an essay about prompting.Make the model critique against a rubric
A strong model is a sharp reviewer of prompts, especially with a rubric. Ask it to find ambiguities, missing edge cases, and injection risks, and to rate each by severity so you can triage.
Critique the prompt below as a senior prompt engineer. For each issue give: severity (high/med/low), the exact line, why it fails, and a concrete rewrite. Check specifically for: ambiguous instructions, missing edge cases (empty input, multiple order ids, non-English), a weak output contract, and prompt-injection exposure. <prompt> {{PASTE YOUR PROMPT}} </prompt>VerifyThe critique names specific lines and edge cases (empty email, two order ids) with concrete rewrites, not vague praise.Close the loop on a real failure
Meta-prompting shines as a loop. When your prompt fails a case, hand the model the prompt, the input, the wrong output, and the desired output, and ask for the minimal change that fixes it without regressing other cases.
This prompt produced the wrong output on one case. Propose the smallest edit that fixes it without regressing other inputs. Explain the change in one line, then give the full revised prompt. PROMPT: {{PASTE PROMPT}} INPUT: {{THE FAILING EMAIL}} GOT: {{WRONG OUTPUT}} WANTED: {{CORRECT OUTPUT}}VerifyThe revision targets the specific failure (for example, adds a rule for multiple order ids) rather than rewriting the whole prompt.Generate few-shot examples on demand
Examples teach better than rules, but writing them is tedious. Have the model synthesize diverse, hard examples — including edge cases — in your exact output format, then you curate down to the keepers.
Generate 6 few-shot examples for the prompt above, as input-to-output pairs in the exact JSON output format. Cover: a clear billing case, a technical case with an order id, an email with two order ids, an empty email, a non-English email, and an ambiguous case. Make the inputs realistic and varied. Return them as a JSON array.VerifyYou get six realistic pairs including the tricky ones — drop any weak ones and paste the keepers into your prompt.Know when to stop, and when to hand-tune
Meta-prompting is fastest for cold starts, critiques, and generating examples. It is weaker when the fix needs domain knowledge only you have, or when 'better' is a subjective house-voice call. Always validate meta-prompted changes against your fixed test set — a model's confident rewrite can still regress.
VerifyYou can state, for your task, which parts to delegate to a model and which to hand-tune — and every change goes through your test set first.