Prompting Techniques Recap
Seven essential techniques — from clarity of instructions to XML tags and chain-of-thought — that separate single-query prompts from production-quality ones.
Why Prompt Engineering Matters in Production
A basic prompt is a one-off query. Prompt engineering is an iterative process of building reliable instructions that work consistently at scale.
Seven Key Techniques
1. Prompt Generator
Use the Anthropic Console Prompt Generator as a starting point. It generates prompts with chain-of-thought and separation of data from instructions.
2. Be Clear and Direct
Bad: "What do people think?" Good: "Provide a structured report with sections: summary (50–100 words), top-3 praised features, top-3 criticized features, UX issues"
3. Structure with XML Tags
<feedback>{{CUSTOMER_FEEDBACK}}</feedback>
XML separates data from instructions — critical when a prompt contains mixed content.
4. Use Examples (Multishot)
One or two concrete examples are more effective than lengthy verbal descriptions of the desired format.
5. Chain-of-Thought ("Let Claude Think")
Ask Claude to reason step-by-step before the final answer. This improves accuracy for risk analysis, legal, and medical tasks.
6. System Prompt for Role
system = "You are an experienced PR director specializing in crisis communications."
Role assignment is the only thing that should go in system_prompt. It sets tone and expertise across all messages.
7. Long Context: Documents First
With 30K+ tokens, put documents at the beginning of the prompt, instructions after. Claude performs noticeably better when context precedes the task.
Takeaway
These seven techniques in combination turn an unstable prompt into a production-ready tool.
Take any prompt from your project and sequentially apply all 7 techniques: add a system prompt with a role, wrap input data in XML tags, insert one example of the desired output, ask Claude to reason step-by-step, and specify the exact response format.
Copy and adapt to your context. Text in angle brackets should be replaced.
You are a [role with domain expertise].
<task>
[Clear task description without ambiguity]
</task>
<data>
{{INPUT_DATA}}
</data>
<example>
Input: [example input]
Output: [example desired output]
</example>
First think step-by-step inside <thinking> tags, then give your final answer in <output>.Mixing instructions and input data in one block without separators. Using vague verbs: 'analyze', 'help' — without specifying the exact output format. Putting user-level instructions in the system prompt and vice versa.
Run the Prompt Generator with the most detailed task description possible — it already applies best practices. If responses are unstable, first add XML tags around data: this single change often gives a 30–50% consistency improvement.
Any prompt that will run in production, process diverse inputs, or require a stable output format.
Quick one-off chat queries — excessive structure only gets in the way.