What this prompt does
This meta-prompt acts as a prompt engineering consultant running inside the AI itself. You paste in a rough, unstructured prompt — the kind you fire off when you know what you want but haven't thought through how to ask for it — and it returns a fully engineered version with a defined persona, numbered task steps, output format specification, guardrails, and reusable [variable] placeholders.
What makes it work is that it does not just rewrite your prompt; it applies eight named techniques in sequence. That structure matters because each technique targets a different failure mode: vague prompts fail on role clarity, complex tasks fail without decomposition, inconsistent outputs fail without format specs. The meta-prompt addresses all of these in one pass.
The [test_input] variable is particularly valuable. The model is instructed to mentally run the optimized prompt against a real input and show expected output — so you are not just getting an improved prompt, you are getting a preview of whether it actually works before you commit to it.
When to use it
- You have a working prompt that produces inconsistent or unpredictable results and need to make it reliable at scale.
- You are building a prompt-driven feature (chatbot, document processor, classification pipeline) and need production-ready instructions, not a rough draft.
- You want to repurpose a prompt across multiple AI models (GPT-4o, Claude, Gemini) and need model-specific tuning baked in via
[target_model]. - You are onboarding a non-technical teammate to a prompt workflow and need clear, self-documenting prompt structure with labeled variables.
- You have written a prompt that works for the easy cases but breaks on edge inputs, and you need explicit edge-case handling added.
- You want to generate prompt variations for A/B testing different phrasings or output formats without rewriting from scratch.
Example output
For [rough_prompt] = "summarize this article", [target_model] = "Claude Sonnet", [output_format] = "bullet points", [use_case] = "newsletter digest", [example_count] = "2", [test_input] = "a 600-word article on LLM context windows":
You are a professional editor specializing in newsletter content.
Task: Summarize the article below into a newsletter-ready digest.
Steps:
1. Identify the 3-5 core claims or findings.
2. Discard background filler and restatements.
3. Write each point as a single, standalone bullet (max 20 words).
4. Add a one-sentence "Why it matters" conclusion.
Constraints:
- Do NOT include the author's name or publication date.
- Always write in present tense.
- If the article is opinion, prefix bullets with "Argues that:".
Output format:
• [Key point]
• [Key point]
Why it matters: [one sentence]
[ARTICLE]: ...
Expected output on test input: 4 bullets on context window tradeoffs, one "Why it matters" line on retrieval implications — ready to paste into a newsletter.
Pro tips
- Set
[example_count]to at least 2. One example teaches pattern; two examples teach boundary. Zero examples is asking for guesswork. - Be specific in
[use_case]. "Code review" is vague; "code review for junior engineers submitting PHP PRs" forces the optimizer to tune tone, depth, and assumed knowledge level correctly. - After you get the optimized prompt, run the
[test_input]yourself against the actual model — do not just trust the mental simulation. The mental run catches structure problems, not model-specific quirks. - If you are targeting Claude specifically, the optimized prompt will benefit from explicit XML-style tags (
<article>,<constraints>). Mention this in[target_model]as "Claude (prefers XML tags)" to get that output. - Use the "Variations for different scenarios" section the prompt requests. Those variations are often more useful than the primary version — they expose assumptions you did not know you were making.