Prompt patterns reference
Prompt Engineering
Chapter 10 · Prompt Patterns Reference — A Practical Cheat Sheet
This chapter is a reference you'll return to. Every pattern here is drawn from the course — copy, adapt, and use them as starting points. Patterns are grouped by technique, with chapter tags showing where each was covered in depth.
How to use this chapter
Scan the section headers to find the pattern type you need. The monospace boxes are copy-ready — replace the bracketed placeholders with your specifics. Tags like Ch1 show which chapter covers the technique in detail.
Clarity & Context Patterns
Getting to a precise, well-targeted answer
The four-pillar prompt
[Task verb + what you want].
Context: [your situation, environment, what you've tried].
Constraints: [tech limits, length, what to exclude].
Format: [bullet list / JSON / numbered steps / prose].
Ch2
The foundation. Every other pattern builds on this structure.
Goal-behind-the-task
I want to [immediate task], because [underlying goal].
If there's a better approach to achieve the goal, suggest it.
Ch2
Lets Claude suggest a better path if your approach is suboptimal.
Pre-resolve ambiguity
Assume [most likely ambiguous thing].
If that assumption is wrong, I'll correct you.
Ch8
Resolve the most likely guess yourself — faster than waiting for Claude to ask.
Audience calibration
Explain [topic] to someone who [knows X but not Y].
Use analogies from [their domain] where helpful.
Ch2
Sets vocabulary level and assumed knowledge precisely.
Role & Persona Patterns
Shaping angle, tone, and expertise
Domain expert role
You are a [senior / experienced] [role].
[Task]. Be direct and use [domain] vocabulary.
Ch3
Packages vocabulary, assumed knowledge, and directness in one line.
Sceptical reviewer
You are a sceptical [security auditor / code reviewer / editor].
Review [this]. Find what's wrong before noting what works.
Ch3
Flips Claude's default positive framing — gets the problems first.
Devil's advocate
Take the strongest opposing position to [my argument].
Push back hard — even if you agree with me.
Ch3
Stress-tests decisions and surfaces assumptions you might have missed.
Rubber duck
Act as a rubber duck. I'll explain my [code / plan] to you.
Ask one clarifying question after each paragraph — don't try to solve it for me.
Ch3
Forces you to articulate the problem — often reveals the solution yourself.
Few-Shot & Example Patterns
Demonstrating the exact output you want
Input → output example
Input: [example input]
Output: [exact output you want]
Input: [another example]
Output: [output]
Now process: [your real input]
Ch4
Most reliable format-control technique. Two examples covers most cases.
Style match
Write [new thing] in the same style as this example:
[paste example text]
Match the tone, sentence length, and vocabulary level.
Ch4
Describing a style is hard; demonstrating it is easy.
Batch with examples
[Example 1 input] → [Example 1 output]
[Example 2 input] → [Example 2 output]
Now process all of these:
- [item 1]
- [item 2]
- [item 3]
Ch4
Efficient for bulk classification, transformation, or extraction tasks.
Chain-of-Thought Patterns
Getting visible reasoning before the conclusion
Step-by-step trigger
[Task or question]. Think through this step by step.
Ch5
Put at the end of the prompt. Works across maths, debugging, decisions.
Reason then conclude
Reason through this before giving your answer.
Show the factors you're weighing, then state your conclusion.
Ch5
Prevents conclusion-first responses where reasoning is post-hoc justification.
Separated output
[Task]. Structure your response as:
Thinking: [your step-by-step reasoning]
Answer: [final conclusion only]
Ch5
Keeps reasoning visible but separated — easy to skim to the answer.
Iterative Refinement Patterns
Building on a response rather than starting over
Lock and change
Keep [the structure / the examples / the opening].
Change only [the specific thing to fix].
Ch6
Prevents Claude discarding good parts when fixing a specific problem.
Zoom in
Expand just [section / point / paragraph] —
that one needs more detail and a concrete example.
Ch6
Surgical improvement — leave everything else untouched.
Ask for alternatives
Give me two more versions of [section] with a different angle each.
Keep the same length and format.
Ch6
Generates options before committing — faster than describing a different approach.
Context briefing
Project context: [stack, goals, constraints, audience].
Keep this in mind for all requests in this session.
Ch6
Set once at the start — every follow-up inherits the context for free.
Structured Output Patterns
Reliable format control
Clean JSON
[Task]. Return only a valid JSON object with these fields:
[field: type, field: type].
No explanation. No markdown fences. Valid JSON only.
Ch7
"No markdown fences" + "valid JSON only" at the end is the reliable combination.
Markdown table
Format as a markdown table with these exact column headers:
[Col1] | [Col2] | [Col3]. One row per [item].
Ch7
Name headers exactly as you want them — Claude will match them precisely.
Length-controlled list
List exactly [N] [items]. One sentence per item.
No introduction. No conclusion. No sub-bullets.
Ch7
Fixed count + sentence limit + no padding = scannable output every time.
Ambiguity Control Patterns
Controlling whether Claude asks or proceeds
Proceed signal
Make reasonable assumptions where needed and proceed.
State each assumption briefly before continuing.
Ch8
Essential for automated pipelines. Prevents clarification questions that break flows.
Focused ask
Ask me your single most important clarifying question
before you start — then proceed with my answer.
Ch8
Gets clarification without an interrogation. Caps questions at one.
Answer then check
[Vague or short prompt — let Claude answer, then:]
Is that what you meant, or were you asking about [alternative]?
Ch8
You get value immediately; the follow-up handles the wrong-interpretation case.
Failure Mode Countermeasures
Countering hallucination, over-caution, verbosity, and sycophancy
Anti-hallucination
If you're not certain about a specific fact,
say so rather than guessing.
Ch9
Add to any prompt where factual accuracy is critical. Converts confident-wrong to hedged-uncertain.
Anti-over-caution
Give me a direct recommendation.
I understand there are trade-offs — pick one and tell me why.
Ch9
Forces a committed answer rather than a fence-sitting survey of options.
Anti-verbosity
In under [N] words. No preamble.
No closing summary. Answer directly.
Ch9
Name the specific padding patterns you want eliminated — they'll stop.
Anti-sycophancy
If I'm wrong, tell me directly — don't soften it.
What's the strongest argument against my position?
Ch9
Gives Claude explicit permission to disagree. Watch for reversals without new evidence.
Master Quick-Reference
| Goal | Add to your prompt |
|---|---|
| Get a precise answer | State task + context + constraints + format. |
| Control output format | Put format instruction last. "No fences. No explanation." |
| Get step-by-step reasoning | Think through this step by step. [at the end] |
| Set tone and expertise level | You are a [specific role]. Be direct. |
| Match an exact style | Match the style of this example: [paste example] |
| Prevent questions in pipelines | Make reasonable assumptions. Never ask a clarifying question. |
| Get a recommendation, not a survey | Pick one. Tell me why. Don't hedge. |
| Preserve good parts during revision | Keep [X]. Change only [Y]. |
| Force uncertainty acknowledgement | If unsure about a specific fact, say so rather than guessing. |
| Prevent verbosity | Under [N] words. No preamble. No closing summary. |
| Invite honest disagreement | If I'm wrong, tell me directly. |
| Generate options | Give me three versions with different angles. Same length. |
| Stress-test a decision | Steelman the opposite position. |
| Calibrate for an audience | Assume the reader knows [X] but not [Y]. |
| Batch-process many items | [Example] → [Output]. Now process: [list]. |