From Vague to Precise: 12 Prompt-Engineering Formulas That Turn Fuzzy Requests into Exact LLM Instructions
You ask an LLM "write a summary of this article" and get back a bland paragraph that says nothing. You ask again, this time with a bit more detail, and the model still misses the point. The problem is almost never the model — it is the prompt. A vague request gives a vague answer, and no amount of re-rolling the generation will fix a prompt that never told the model what "good" looks like.
Prompt engineering is the discipline of closing that gap. It is not about magic words; it is about structure. The core building blocks — role and context, explicit output format, few-shot examples, chain-of-thought (CoT), and constraints — are documented in Anthropic's prompt-engineering guide and OpenAI's prompt guide, and they hold up across GPT-class, Claude, and open-weight models. What most people lack is a repeatable way to apply them on demand.
Below are 12 formulas I actually use. Each one is a reusable template, a real usage example, and the reasoning behind why it works. Copy them, adapt the variables, and keep them in a snippet file. The goal is consistency: the same input should produce a reliably shaped output every time.
1. The Role + Context + Task + Format skeleton
This is the base frame every other formula plugs into. Four slots: who the model is, what background it needs, what to do, and how to return it. Anthropic explicitly recommends putting context and instructions in clearly separated sections.
You are a {role} with {years} of experience in {domain}.
Context: {relevant background, audience, constraints}.
Task: {single, concrete verb + object}.
Output format: {structure, length, tone}.
Example: You are a senior technical writer for a B2B SaaS blog. Context: readers are backend engineers evaluating observability tools. Task: write a 150-word comparison of OpenTelemetry and a proprietary agent. Output: two short paragraphs, no marketing adjectives, one concrete metric per paragraph. The four slots force you to state what you were previously leaving implicit.
2. The Few-Shot Anchor
When style or format matters more than content, show 2–3 input→output pairs. Few-shot prompting is one of the oldest and most reliable techniques (see the GPT-3 paper, Brown et al., 2020). The model infers the pattern instead of guessing.
Convert the user review into a JSON object.
Examples:
Input: "Fast shipping but box was crushed."
Output: {"sentiment":"mixed","topics":["shipping","packaging"]}
Input: "Terrible support, never again."
Output: {"sentiment":"negative","topics":["support"]}
Now: Input: "{review}"
Output:
Keep examples diverse and label the field names exactly as you want them. Two well-chosen examples usually beat five mediocre ones.
3. Chain-of-Thought with an explicit stop
"Think step by step" is the folk version of chain-of-thought (Wei et al., 2022). The problem: models sometimes leak the reasoning into the final answer. Force a separation.
Reason through the problem in a section marked REASONING.
Then output only the final answer in a section marked ANSWER.
Do not repeat reasoning inside ANSWER.
Example: Determine whether this SQL query will cause a full table scan. REASONING: inspect WHERE, indexes, functions on columns. ANSWER: yes/no + one-sentence fix. This is essential for anything downstream that parses the output.
4. The Constraint Sandwich
Put hard requirements both before and after the task. Models attend to the start and end of a prompt more reliably than the middle. State the non-negotiables up front, restate the critical one at the end.
Rules: never invent numbers; cite sources inline as [source]; max 200 words.
Task: {task}.
Reminder: no fabricated statistics, max 200 words.
This single change cuts invented facts noticeably on summarization tasks, because the model sees the anti-hallucination rule twice.
5. The Persona Critic (self-review loop)
Have the model critique its own draft against an explicit rubric, then rewrite. This mirrors the "reflexion" pattern and is cheap to implement.
Step 1: Draft the answer.
Step 2: Score the draft 1-5 on: accuracy, clarity, concreteness. List one weakness per criterion.
Step 3: Rewrite fixing the weaknesses. Return only the final version.
Use it for anything a human will read directly — emails, docs, release notes.
6. The Decompose-First Planner
For multi-step tasks, ask for a plan before execution. This prevents the model from charging into step one and losing the thread.
First, output a numbered plan (max 6 steps).
Wait for my "go" before executing.
Then execute step by step, showing the artifact after each step.
Example: Plan how to migrate a Flask app from SQLite to PostgreSQL: schema, data migration, connection config, tests. Reviewing the plan takes ten seconds and saves a broken migration.
7. The Output-Contract Formatter
When the result feeds into code, define the schema precisely — types, allowed values, null handling. This is the manual ancestor of structured outputs / JSON mode.
Return JSON matching this schema exactly:
{"title": string, "tags": string[], "score": int 0-100, "notes": string|null}
No prose outside the JSON. If a field is unknown, use null.
Always add the null policy and the "no prose outside JSON" line — those two omissions cause most parse failures.
8. The Negative-Space Prompt
Tell the model what NOT to do. Vague prompts fail because they never rule out the wrong answer.
Write a product description.
Do NOT: use the words "revolutionary", "seamless", "game-changer"; exceed 80 words; make comparative claims about competitors.
This is especially effective for brand voice and compliance, where the failure mode is a specific banned phrase rather than a missing fact.
9. The Retrieval-Grounded Answer
When you supply documents, force the model to answer only from them and to admit gaps. This is the prompting half of RAG.
Use ONLY the CONTEXT below. If the answer is not present, reply exactly: "Not found in provided context."
Cite the paragraph number for each claim.
CONTEXT:
{chunks}
QUESTION: {q}
The explicit fallback string is what makes the system trustworthy — it turns silent hallucination into a visible miss.
10. The Temperature-of-Thought (variants)
Ask for multiple candidate answers, then select. Useful for naming, copy, and design decisions where one shot is too narrow.
Generate 5 distinct options. For each, one-line rationale.
Then recommend the single best option and explain why in 2 sentences.
Run this at higher temperature for the brainstorm, then a fresh low-temperature call to pick. Separating generation from selection improves quality.
11. The Rubric Scorer
Turn subjective judgment into a checklist. Define criteria and weights, and require scores.
Score this support reply 1-5 on: empathy, accuracy, resolution, conciseness (equal weights).
Output a table: criterion
| score | one-line justification.
Final: overall score and the single biggest improvement.
This turns an LLM into a consistent first-pass reviewer for QA queues.
12. The Meta-Prompt (prompt that writes prompts)
The highest-leverage formula: use the model to upgrade your own prompt.
Here is my draft prompt: "{draft}".
Rewrite it using: explicit role, context, task, output format, constraints, and one few-shot example.
Return the improved prompt only, plus a 3-bullet note on what you changed and why.
Run it once and you get a version of formulas 1–4 applied automatically. Over time this builds your personal prompt library.
| Formula | Best for | Key line |
|---|---|---|
| Role+Context | everything | separate sections |
| Few-shot | format/style | 2–3 examples |
| CoT+stop | reasoning tasks | REASONING/ANSWER split |
| Constraint sandwich | accuracy | rule at start and end |
| Self-critic | human-facing text | rubric then rewrite |
A quick word on model behavior: reasoning-focused models (the o-series and similar) already do internal chain-of-thought, so formulas 3 and 6 sometimes need less hand-holding there, while formulas 1, 2, 7, and 8 stay essential everywhere. Match the formula to the model, not the other way around.
The through-line across all twelve is the same: replace implicit expectations with explicit instructions. Role and context set the frame, few-shot and format lock the shape, chain-of-thought and decomposition handle complexity, and constraints plus rubric-scoring keep the output honest. None of these are secrets — they are documented techniques — but applied as a repeatable set, they turn a chatty model into a predictable tool. Pick two formulas today, wrap your next real request in them, and notice how often you stop re-rolling the answer.
Comments