Engineering Prompts
LEVEL 1: QUICKSTART ⚡
Foundation First (Always Apply):
- Clarity: Explicit instructions + success criteria
- Context & Motivation: Explain WHY, not just WHAT
- Positive Framing: Say what TO do, not what NOT to do
Then Assess:
- Simple task? → Stop here. Foundation is enough.
- Complex task? → Add advanced techniques sparingly
- Test & Iterate: Measure effectiveness, refine based on results
Key insight: The best prompt achieves goals with minimum necessary structure.
LEVEL 2: DIAGNOSTICS 🔧
Output Problems → Solutions:
| Problem |
Solution |
| Too generic |
Add specificity + examples |
| Off-topic |
Add context explaining goals |
| Wrong format |
Examples or prefilling |
| Unreliable on complex tasks |
Prompt chaining |
| Unnecessary preambles |
Prefill or "start directly with..." |
| Hallucinations |
"If unsure, acknowledge uncertainty" |
| Shallow reasoning |
Chain of thought |
Process Problems → Fixes:
| Mistake |
Fix |
| Over-engineering |
Start minimal, add only what helps |
| Negative framing |
Say what TO do instead |
| No motivation |
Explain the WHY |
| No iteration |
Test, measure, refine |
LEVEL 3: THE 12 TECHNIQUES 🛠️
Foundation (Always Apply)
| Technique |
What It Does |
Cost |
| 1. Clarity |
Explicit instructions, success criteria |
Minimal |
| 2. Context & Motivation |
Explain WHY you want something |
Minimal |
| 3. Positive Framing |
Say what TO do, not what NOT to do |
Minimal |
| 4. XML Structure |
Separate sections in complex prompts |
~50-100 tokens |
Note: XML is less essential with Claude 4.x - use when genuinely needed.
Advanced (Apply When Needed)
| Technique |
When to Use |
Cost |
| 5. Chain of Thought |
Reasoning, analysis, math |
2-3x output |
| 6. Prompt Chaining |
Multi-step, complex tasks |
Multiple calls |
| 7. Multishot Examples |
Pattern learning, format |
200-1K each |
| 8. System Role |
Domain expertise needed |
Minimal |
| 9. Prefilling |
Strict format requirements |
Minimal |
| 10. Long Context |
20K+ token inputs |
Better accuracy |
| 11. Context Budget |
Repeated use, conversations |
90% savings |
| 12. Tool Docs |
Function calling, agents |
100-500/tool |
LEVEL 4: DESIGN CHECKLIST 📋
Before Writing:
Complexity Assessment:
- Simple (extraction, Q&A) → Foundation only
- Medium (analysis, code gen) → + CoT, examples
- Complex (research, novel problems) → + Chaining, role
Cost Optimization:
- Cache system prompts + reference docs (90% savings)
- Batch non-urgent work (50% savings)
- Skip CoT for simple tasks (saves 2-3x)
Deliverable:
- Prompt + techniques used + rationale + token estimate
LEVEL 5: ADVANCED TOPICS 🚀
Tool Integration
When to use MCP tools during prompt engineering:
Need latest practices?
└─ mcp__plugin_essentials_perplexity
Complex analysis needed?
└─ mcp__plugin_essentials_sequential-thinking
Need library docs?
└─ mcp__plugin_essentials_context7
Context Management
Prompt Caching:
- Cache: System prompts, reference docs, examples
- Savings: 90% on cached content
- Write: 25% of standard cost
- Read: 10% of standard cost
Long Context Tips:
- Place documents BEFORE queries
- Use XML tags:
<document>, <source>
- Ground responses in quotes
- 30% better performance with proper structure
Token Optimization
Reducing Token Usage:
- Concise, clear instructions (no fluff)
- Reuse examples across calls (cache them)
- Structured output reduces back-and-forth
- Tool use instead of long context when possible
Cost-Specific Anti-Patterns
❌ Ignoring caching - Not leveraging repeated content (90% savings lost)
❌ Over-requesting CoT - Chain of thought for simple tasks (2-3x wasted)
❌ Redundant examples - 5 examples when 2 suffice
❌ No batching - Real-time calls for non-urgent work (50% savings lost)
See LEVEL 2: Diagnostics for general fixes.
LEVEL 6: REFERENCES 📚
Deep Dive Documentation
Detailed Technique Catalog:
reference/technique-catalog.md - Each technique explained with examples, token costs, combination strategies
Real-World Examples:
reference/examples.md - Before/after pairs for coding, analysis, extraction, agent tasks
Research Papers:
reference/research.md - Latest Anthropic research, benchmarks, best practices evolution
1---2name: engineering-prompts3description: Engineers effective prompts using systematic methodology. Use when designing prompts for Claude, optimizing existing prompts, or balancing simplicity, cost, and effectiveness. Applies progressive disclosure and empirical validation to prompt development.4---5
6# Engineering Prompts
7
8---
9
10## LEVEL 1: QUICKSTART ⚡
11
12**Foundation First (Always Apply):**
13
141. **Clarity**: Explicit instructions + success criteria
152. **Context & Motivation**: Explain WHY, not just WHAT
163. **Positive Framing**: Say what TO do, not what NOT to do
17
18**Then Assess:**
19
204. **Simple task?** → Stop here. Foundation is enough.
215. **Complex task?** → Add advanced techniques sparingly
226. **Test & Iterate**: Measure effectiveness, refine based on results
23
24> **Key insight**: The best prompt achieves goals with minimum necessary structure.
25
26---
27
28## LEVEL 2: DIAGNOSTICS 🔧
29
30**Output Problems → Solutions:**
31
32| Problem | Solution |
33|---------|----------|
34| Too generic | Add specificity + examples |
35| Off-topic | Add context explaining goals |
36| Wrong format | Examples or prefilling |
37| Unreliable on complex tasks | Prompt chaining |
38| Unnecessary preambles | Prefill or "start directly with..." |
39| Hallucinations | "If unsure, acknowledge uncertainty" |
40| Shallow reasoning | Chain of thought |
41
42**Process Problems → Fixes:**
43
44| Mistake | Fix |
45|---------|-----|
46| Over-engineering | Start minimal, add only what helps |
47| Negative framing | Say what TO do instead |
48| No motivation | Explain the WHY |
49| No iteration | Test, measure, refine |
50
51---
52
53## LEVEL 3: THE 12 TECHNIQUES 🛠️
54
55### Foundation (Always Apply)
56
57| Technique | What It Does | Cost |
58|-----------|--------------|------|
59| **1. Clarity** | Explicit instructions, success criteria | Minimal |
60| **2. Context & Motivation** | Explain WHY you want something | Minimal |
61| **3. Positive Framing** | Say what TO do, not what NOT to do | Minimal |
62| **4. XML Structure** | Separate sections in complex prompts | ~50-100 tokens |
63
64> **Note**: XML is less essential with Claude 4.x - use when genuinely needed.
65
66### Advanced (Apply When Needed)
67
68| Technique | When to Use | Cost |
69|-----------|-------------|------|
70| **5. Chain of Thought** | Reasoning, analysis, math | 2-3x output |
71| **6. Prompt Chaining** | Multi-step, complex tasks | Multiple calls |
72| **7. Multishot Examples** | Pattern learning, format | 200-1K each |
73| **8. System Role** | Domain expertise needed | Minimal |
74| **9. Prefilling** | Strict format requirements | Minimal |
75| **10. Long Context** | 20K+ token inputs | Better accuracy |
76| **11. Context Budget** | Repeated use, conversations | 90% savings |
77| **12. Tool Docs** | Function calling, agents | 100-500/tool |
78
79---
80
81## LEVEL 4: DESIGN CHECKLIST 📋
82
83**Before Writing:**
84- [ ] Core task clear?
85- [ ] Output format defined?
86- [ ] Constraints known? (latency/cost/accuracy)
87- [ ] One-off or repeated use?
88
89**Complexity Assessment:**
90- Simple (extraction, Q&A) → Foundation only
91- Medium (analysis, code gen) → + CoT, examples
92- Complex (research, novel problems) → + Chaining, role
93
94**Cost Optimization:**
95- Cache system prompts + reference docs (90% savings)
96- Batch non-urgent work (50% savings)
97- Skip CoT for simple tasks (saves 2-3x)
98
99**Deliverable:**
100- Prompt + techniques used + rationale + token estimate
101
102---
103
104## LEVEL 5: ADVANCED TOPICS 🚀
105
106### Tool Integration
107
108**When to use MCP tools during prompt engineering:**
109
110```
111Need latest practices?
112└─ mcp__plugin_essentials_perplexity
113
114Complex analysis needed?
115└─ mcp__plugin_essentials_sequential-thinking
116
117Need library docs?
118└─ mcp__plugin_essentials_context7
119```
120
121### Context Management
122
123**Prompt Caching:**
124- Cache: System prompts, reference docs, examples
125- Savings: 90% on cached content
126- Write: 25% of standard cost
127- Read: 10% of standard cost
128
129**Long Context Tips:**
130- Place documents BEFORE queries
131- Use XML tags: `<document>`, `<source>`
132- Ground responses in quotes
133- 30% better performance with proper structure
134
135### Token Optimization
136
137**Reducing Token Usage:**
138- Concise, clear instructions (no fluff)
139- Reuse examples across calls (cache them)
140- Structured output reduces back-and-forth
141- Tool use instead of long context when possible
142
143### Cost-Specific Anti-Patterns
144
145❌ **Ignoring caching** - Not leveraging repeated content (90% savings lost)
146❌ **Over-requesting CoT** - Chain of thought for simple tasks (2-3x wasted)
147❌ **Redundant examples** - 5 examples when 2 suffice
148❌ **No batching** - Real-time calls for non-urgent work (50% savings lost)
149
150See **LEVEL 2: Diagnostics** for general fixes.
151
152---
153
154## LEVEL 6: REFERENCES 📚
155
156### Deep Dive Documentation
157
158**Detailed Technique Catalog:**
159- `reference/technique-catalog.md` - Each technique explained with examples, token costs, combination strategies
160
161**Real-World Examples:**
162- `reference/examples.md` - Before/after pairs for coding, analysis, extraction, agent tasks
163
164**Research Papers:**
165- `reference/research.md` - Latest Anthropic research, benchmarks, best practices evolution