The prompt engineering patterns that still pay off are reusable fixes for recurring failures, and nearly all of them come down to clarity and structure, not clever phrasing. That means an explicit goal, context, constraints and output contract; delimited inputs; a few varied examples when zero-shot falls short; native structured outputs; and chained steps for big tasks.
As of November 2026, the biggest shift is that reasoning models are the default. Telling them to "think step by step" or scripting every move is redundant and can make results worse, so state the goal and what success looks like instead. Vague or contradictory instructions also cost more than they used to, because the model burns reasoning tokens trying to reconcile them.
The useful test is simple: write what a smart new colleague would need to hear.
Match the failure to the pattern
Most inconsistent output traces back to one of eight failures, and each has a standard fix.
| Symptom | Pattern | Best fit / caveat |
|---|---|---|
Unclear or generic output | Base prompt: goal, context, constraints, output contract | Fix this first; many other symptoms shrink |
Model mixes up instructions and pasted data | Delimiters or XML sections | Aids clarity, but it's no defense against prompt injection |
Wrong tone, length or format | Output contract plus varied examples | Try zero-shot first; models copy example surface features |
Weak reasoning | Reasoning before the answer (non-reasoning models); effort setting (reasoning models) | Drop scripted steps on reasoning models |
Unparseable JSON | Native structured outputs with a schema | Prompt-only JSON is a fallback |
Fabricated facts over your documents | Grounded answering with citations and a "not found" option | Documents first, question last |
Multi-step drift | Prompt chaining, a verification pass or a ReAct-style tool loop | Adds latency and glue code |
High-stakes classification or math | Self-consistency: sample several answers, then vote | Multiplies cost; reserve it for decisions that matter |
Start with a clear goal and output contract
Every other pattern sits on top of one base prompt. It opens with an action verb that names the task, then gives the context the model can't guess, the constraints, and an explicit output contract: what the answer must include, how long it runs and what format it takes. OpenAI's reasoning model guidance says its reasoning-capable GPT-5 models work best with "a clear goal, strong constraints, and an explicit output contract." Anthropic is blunter: be clear and direct, and if you want more than the task strictly requires, ask for it.
That's why "You are a world-class expert" does so little. A role earns its line only when it carries information, like who the audience is, which standards apply and what's off limits. "You're reviewing pull requests for a team that ships to regulated banks" changes the output. "You're an expert" doesn't.
Describe the target instead of banning things. "Write flowing prose paragraphs" beats "don't use bullets," because a ban says what to avoid without saying what to produce.
Before you add another rule, hunt for contradictions. OpenAI's GPT-5 guide warns that conflicting instructions hurt these models more than older ones. System prompts that grew over months are the usual culprits, with "always be brief" in one paragraph and "always explain fully" a few paragraphs later. Resolve the conflict or scope each rule: "brief for status updates, full explanations for errors."
Before:Summarize this.
After:Summarize the incident report below for engineering managers who weren't on call.Length: 150 words or fewer.Format: a one-sentence headline, then one paragraph covering cause, impact and current status.Use only facts stated in the report. If the cause isn't stated, write "Cause not yet confirmed."
<report>{{report_text}}</report>The audience line sets vocabulary and depth. The length and format lines tell the model when it's done, and the source rule with its fallback keeps it from filling gaps with guesses.
Ground answers in your own documents
Fabrication over your own material drops when the model can see exactly where each source starts and stops, and when it's allowed to admit a gap. Give instructions, context, examples and the user's input their own sections. Anthropic recommends XML tags such as <documents> and <question> for Claude; clearly headed Markdown sections work well with OpenAI models. Put the documents at the top and the question after them, so the model reads the material before the request.
Then constrain the answer: "Answer only from the documents above. Quote the passage that supports each claim and name its source. If the documents don't contain the answer, reply 'Not found in the provided sources.'" That last line matters most. Without a sanctioned way out, the model treats every question as one it has to answer, and a plausible guess fills the gap. Quotes also make checking cheap, since you can match each one against the source text in code.
Few-shot or zero-shot
Start without examples. OpenAI's reasoning best practices say to try zero-shot first and add examples only if the output still misses. That order works for any model, because a clear output contract fixes most format problems at no extra cost.
Few-shot prompting goes back to the GPT-3 paper (Brown et al., 2020), which showed a model could pick up a task from a handful of demonstrations in the prompt. The catch is that models learn more from examples than you meant to teach. They copy length, phrasing, sentence openers and even topic. Show three short summaries of headphone reviews, and your laptop review summaries will come back short and full of audio vocabulary.
When you do add examples, follow Anthropic's guidance. Use several that match your real inputs but vary in length, subject and edge cases, and wrap each in <example> tags so the model can tell a demonstration from an instruction. Extended thinking doesn't make them irrelevant: Anthropic notes that multishot examples still shape how the model reasons, so an example that takes a shortcut teaches that shortcut. Yes, examples cost tokens and invite copying. Nothing else holds format and tone as steady.
Does chain-of-thought still help?
It depends on the model. The technique comes from Wei et al. (2022), who showed that worked reasoning examples improved multi-step problem solving. Kojima et al. (2022) then got a similar lift from one line: "Let's think step by step." Both results came from models that answer in a single pass, with no hidden thinking phase.
On non-reasoning models, and on reasoning models run at minimal effort, it still works. Ask for reasoning, or place a reasoning field before the answer field so the model works through the problem before it commits. OpenAI's GPT-5 guide says that at minimal effort, prompted planning and a brief summary of reasoning at the top of the answer help.
Reasoning models already plan internally, so the old trick mostly adds noise. OpenAI's reasoning best practices say to avoid "think step by step" and "explain your reasoning" prompts, and a scripted procedure can do worse than the plan the model would build on its own. Anthropic says the same about extended thinking: a plain "think thoroughly" often beats a hand-written step plan.
When quality falls short, don't start by raising the effort setting. OpenAI calls reasoning effort "a tuning knob, not the primary way to recover quality", so spend your words on the goal and constraints. In OpenAI's API, answer length is a verbosity setting separate from reasoning effort, and a "pro" mode offers heavier reasoning. These names and parameters change often.
BEFOREReview this pull request.Step 1: Read each changed file.Step 2: List every function that was modified.Step 3: Check each function for bugs.Step 4: Write your findings.
AFTERReview this pull request before it merges to main.Goal: catch defects that would break production or corrupt data.Ignore style nits; the linter handles those.Success: every finding names the file and line, explains the failureit causes, and suggests a fix. If you find nothing blocking, say so.The After version says what a good review accomplishes and how to judge one, then leaves the model free to plan its own route through the diff.
Get structured output you can parse
If your API offers native structured outputs, use them. You pass a JSON schema and the platform constrains the response to match it, a guarantee "respond only in valid JSON" can't give you. Field order still shapes the answer. OpenAI's Playground prompt generator puts reasoning before conclusions because whatever the model writes first conditions everything after it. This matters most on non-reasoning models. A schema ordered rationale then label lets the label build on the argument. Put label first and the model commits to a verdict, then writes a rationale to justify it after the fact.
Stuck with prompt-only formatting? Describe the shape positively here too. "Return one JSON object with the keys summary and risk_level" beats "no prose, no Markdown." Include one example of the exact output shape. Either way, parse and validate the result in code, and on failure, retry with the validation error so the model knows what to fix.
Split big tasks into chains and loops
Anthropic's advice for complex, multi-stage work is to chain prompts, because "each prompt should do one thing well," and the same logic tells you when a single prompt is still enough.
| Option | When to use | Debuggability | Latency/cost | Main risk |
|---|---|---|---|---|
Single prompt | One task under one set of instructions | Easy: one input, one output | Lowest | Dropped requirements as the prompt grows |
Prompt chain | Steps need different instructions, you want to inspect intermediate output, or a failed step should be caught before the next one runs | Good: you can log and validate every handoff | One call per step, plus glue code to pass and check outputs | An early error flows downstream if nothing validates it |
Agent loop (ReAct) | The path depends on what tools return. ReAct (Yao et al., 2022) interleaves reasoning with tool calls and underpins most agent loops | Hardest: the trajectory changes from run to run | Open-ended unless you cap steps | Loops, wrong tool calls, prompt injection through tool output |
Two add-ons work with any of these. A verification pass hands the draft back with explicit criteria, such as "every claim cites a source passage, under 200 words, no recommendation without a cost," and asks the model to list each failure and fix it. A generic "check your work" gives it nothing to check against. Self-consistency (Wang et al., 2022) samples several answers and takes the majority vote; you pay for every sample, so save it for high-stakes classification or math.
Start with one prompt. Move to a chain once you can name the step that keeps failing, and reach for an agent loop only when the steps can't be known in advance.
How well patterns transfer between models
The principles carry over between vendors, but the packaging doesn't always. A clear goal, firm constraints, an output contract, grounded sources and chained steps help on GPT, Claude or Gemini alike, because each one simply tells the model what you want. Prompts tend to break on syntax. Anthropic recommends XML tags to separate instructions, context and examples. OpenAI leans on Markdown sections and, on its reasoning models, developer messages that replace system messages. Most models parse either style, but each vendor's documented convention gives the most predictable results.
Defaults move too. How much a model writes, and how literally it takes "be brief," varies by vendor and by version. Re-run your test cases after every upgrade, point releases from the same vendor included.
Prove a prompt change actually helped
Without evals, prompt engineering is guesswork. Score every change against the same fixed set of inputs.
- Collect 10–30 real inputs, including the hard cases: messy formatting, long documents, questions your sources can't answer. Write a one-line note for each describing what a good answer looks like. You can score against those notes by hand, or grow them into a fuller LLM evaluation framework later.
- Run the base prompt and tally the failures by the types in the map above. Fix only the most common failure with its matching pattern, then re-run the full set. The change worked if that failure count drops and nothing that passed before now fails.
- Version every prompt in your repo with an ID, and log which version produced each output. Rolling back should mean swapping one ID.
- Put the static instructions at the start and the variable input at the end, so prompt caching can reuse the shared prefix. Your provider's usage data should show cached input tokens on repeat calls.
- Have a model draft or critique the prompt with OpenAI's Playground prompt generation or Anthropic's console prompt tools. The result is just another version: run it on your set and keep it only if it beats what you have.
Sources
- Reasoning models · developers.openai.com
- Prompt generation · developers.openai.com
- Reasoning best practices · platform.openai.com
- Prompting best practices - Claude Platform Docs · platform.claude.com
Want more from ScriptHill in Google? Add us as a preferred source



