Every prompt created should be clear, specific, and optimized for the target model.
<context>
Background information the model needs
</context>
<task>
Clear, specific instruction of what to do
</task>
<requirements>
- Specific constraints
- Output format
- Edge cases to handle
</requirements>
<examples>
Input/output pairs demonstrating expected behavior
</examples>
<success_criteria>
How to know the task was completed correctly
</success_criteria>
- State exactly what you want
- Avoid ambiguous language ("try to", "maybe", "generally")
- Use "Always..." or "Never..." instead of "Should probably..."
- Provide specific output format requirements
See: references/clarity-principles.md
Claude was trained with XML tags. Use them for:
- Separating sections:
<context>, <task>, <output>
- Wrapping data:
<document>, <schema>, <example>
- Defining boundaries: Clear start/end of sections
See: references/xml-structure.md
Provide 2-4 input/output pairs:
<examples>
<example number="1">
<input>User clicked signup button</input>
<output>track('signup_initiated', { source: 'homepage' })</output>
</example>
</examples>
See: references/few-shot-patterns.md
Add explicit reasoning instructions:
- "Think step by step before answering"
- "First analyze X, then consider Y, finally conclude Z"
- Use
<thinking> tags for Claude's extended thinking
See: references/reasoning-techniques.md
System prompts set the foundation:
- Define Claude's role and expertise
- Set constraints and boundaries
- Establish output format expectations
See: references/system-prompt-patterns.md
Start Claude's response to guide format:
Assistant: {"result":
Forces JSON output without preamble.
For Claude 4.5 with context awareness:
- Inform about automatic context compaction
- Add state tracking (JSON, progress.txt, git)
- Use test-first patterns for complex implementations
- Enable autonomous task completion across context windows
See: references/context-management.md
What is the prompt's purpose?
- Generate content
- Analyze/extract information
- Transform data
- Make decisions
- Other
What model will use this prompt?
- Claude (use XML tags)
- GPT (use markdown structure)
- Other/multiple
What complexity level?
- Simple (single task, clear output)
- Medium (multiple steps, some nuance)
- Complex (reasoning, edge cases, validation)
Output format requirements?
- Free text
- JSON/structured data
- Code
- Specific template
<context>
[Background the model needs to understand the task]
</context>
<objective>
[Clear statement of what to accomplish]
</objective>
<instructions>
[Step-by-step process, numbered if sequential]
</instructions>
<constraints>
[Rules, limitations, things to avoid]
</constraints>
<output_format>
[Exact structure of expected output]
</output_format>
<examples>
[2-4 input/output pairs if format matters]
</examples>
<success_criteria>
[How to verify the task was done correctly]
</success_criteria>
- Simple: Clear instructions + output format
- Medium: Add examples + constraints
- Complex: Add reasoning steps + edge cases + validation
See: references/anti-patterns.md
Techniques:
- references/few-shot-patterns.md - Example-based prompting
- references/reasoning-techniques.md - Chain of thought, step-by-step
- references/system-prompt-patterns.md - System prompt templates
- references/context-management.md - Context windows, long-horizon reasoning, state tracking
Best practices by vendor:
- references/anthropic-best-practices.md - Claude-specific techniques
- references/openai-best-practices.md - GPT-specific techniques
Quality:
- references/anti-patterns.md - Common mistakes to avoid
- references/prompt-templates.md - Ready-to-use templates
- Clear, unambiguous objective
- Specific output format with example
- Relevant context provided
- Edge cases addressed
- No vague language (try, maybe, generally)
- Appropriate technique selection for task complexity
- Success criteria defined
1---2name: create-prompt3description: Expert prompt engineering for Claude, GPT, and LLMs. ALWAYS use when the user says "write a prompt", "create a prompt", "optimize this prompt", "improve my prompt", "system prompt", "few-shot", "écrire un prompt", "améliorer mon prompt", or mentions prompt engineering. Covers clarity, structure, examples, reasoning patterns, and advanced techniques from Anthropic/OpenAI research.4---5
6<objective>
7Create highly effective prompts using proven techniques from Anthropic and OpenAI research. This skill covers all major prompting methodologies: clarity, structure, examples, reasoning, and advanced patterns.
8
9Every prompt created should be clear, specific, and optimized for the target model.
10</objective>
11
12<quick_start>
13<workflow>
141. **Clarify purpose**: What should the prompt accomplish?
152. **Identify model**: Claude, GPT, or other (techniques vary slightly)
163. **Select techniques**: Choose from core techniques based on task complexity
174. **Structure content**: Use XML tags (Claude) or markdown (GPT) for organization
185. **Add examples**: Include few-shot examples for format-sensitive outputs
196. **Define success**: Add clear success criteria
207. **Test and iterate**: Refine based on outputs
21</workflow>
22
23<core_structure>
24Every effective prompt has:
25
26```xml
27<context>
28Background information the model needs
29</context>
30
31<task>
32Clear, specific instruction of what to do
33</task>
34
35<requirements>
36- Specific constraints
37- Output format
38- Edge cases to handle
39</requirements>
40
41<examples>
42Input/output pairs demonstrating expected behavior
43</examples>
44
45<success_criteria>
46How to know the task was completed correctly
47</success_criteria>
48```
49</core_structure>
50</quick_start>
51
52<core_techniques>
53<technique name="be_clear_and_direct">
54**Priority**: Always apply first
55
56- State exactly what you want
57- Avoid ambiguous language ("try to", "maybe", "generally")
58- Use "Always..." or "Never..." instead of "Should probably..."
59- Provide specific output format requirements
60
61See: [references/clarity-principles.md](references/clarity-principles.md)
62</technique>
63
64<technique name="use_xml_tags">
65**When**: Claude prompts, complex structure needed
66
67Claude was trained with XML tags. Use them for:
68- Separating sections: `<context>`, `<task>`, `<output>`
69- Wrapping data: `<document>`, `<schema>`, `<example>`
70- Defining boundaries: Clear start/end of sections
71
72See: [references/xml-structure.md](references/xml-structure.md)
73</technique>
74
75<technique name="few_shot_examples">
76**When**: Output format matters, pattern recognition easier than rules
77
78Provide 2-4 input/output pairs:
79```xml
80<examples>
81<example number="1">
82<input>User clicked signup button</input>
83<output>track('signup_initiated', { source: 'homepage' })</output>
84</example>
85</examples>
86```
87
88See: [references/few-shot-patterns.md](references/few-shot-patterns.md)
89</technique>
90
91<technique name="chain_of_thought">
92**When**: Complex reasoning, math, multi-step analysis
93
94Add explicit reasoning instructions:
95- "Think step by step before answering"
96- "First analyze X, then consider Y, finally conclude Z"
97- Use `<thinking>` tags for Claude's extended thinking
98
99See: [references/reasoning-techniques.md](references/reasoning-techniques.md)
100</technique>
101
102<technique name="system_prompts">
103**When**: Setting persistent behavior, role, constraints
104
105System prompts set the foundation:
106- Define Claude's role and expertise
107- Set constraints and boundaries
108- Establish output format expectations
109
110See: [references/system-prompt-patterns.md](references/system-prompt-patterns.md)
111</technique>
112
113<technique name="prefilling">
114**When**: Enforcing specific output format (Claude-specific)
115
116Start Claude's response to guide format:
117```
118Assistant: {"result":
119```
120
121Forces JSON output without preamble.
122</technique>
123
124<technique name="context_management">
125**When**: Long-running tasks, multi-session work, large context usage
126
127For Claude 4.5 with context awareness:
128- Inform about automatic context compaction
129- Add state tracking (JSON, progress.txt, git)
130- Use test-first patterns for complex implementations
131- Enable autonomous task completion across context windows
132
133See: [references/context-management.md](references/context-management.md)
134</technique>
135</core_techniques>
136
137<prompt_creation_workflow>
138<step_0>
139**Gather requirements** using AskUserQuestion:
140
1411. What is the prompt's purpose?
142 - Generate content
143 - Analyze/extract information
144 - Transform data
145 - Make decisions
146 - Other
147
1482. What model will use this prompt?
149 - Claude (use XML tags)
150 - GPT (use markdown structure)
151 - Other/multiple
152
1533. What complexity level?
154 - Simple (single task, clear output)
155 - Medium (multiple steps, some nuance)
156 - Complex (reasoning, edge cases, validation)
157
1584. Output format requirements?
159 - Free text
160 - JSON/structured data
161 - Code
162 - Specific template
163</step_0>
164
165<step_1>
166**Draft the prompt** using this template:
167
168```xml
169<context>
170[Background the model needs to understand the task]
171</context>
172
173<objective>
174[Clear statement of what to accomplish]
175</objective>
176
177<instructions>
178[Step-by-step process, numbered if sequential]
179</instructions>
180
181<constraints>
182[Rules, limitations, things to avoid]
183</constraints>
184
185<output_format>
186[Exact structure of expected output]
187</output_format>
188
189<examples>
190[2-4 input/output pairs if format matters]
191</examples>
192
193<success_criteria>
194[How to verify the task was done correctly]
195</success_criteria>
196```
197</step_1>
198
199<step_2>
200**Apply relevant techniques** based on complexity:
201
202- **Simple**: Clear instructions + output format
203- **Medium**: Add examples + constraints
204- **Complex**: Add reasoning steps + edge cases + validation
205</step_2>
206
207<step_3>
208**Review checklist**:
209
210- [ ] Is the task clearly stated?
211- [ ] Are ambiguous words removed?
212- [ ] Is output format specified?
213- [ ] Are edge cases addressed?
214- [ ] Would a person with no context understand it?
215</step_3>
216</prompt_creation_workflow>
217
218<anti_patterns>
219<pitfall name="vague_instructions">
220❌ "Help with the data"
221✅ "Extract email addresses from the CSV, remove duplicates, output as JSON array"
222</pitfall>
223
224<pitfall name="negative_prompting">
225❌ "Don't use technical jargon"
226✅ "Write in plain language suitable for a non-technical audience"
227</pitfall>
228
229<pitfall name="no_examples">
230❌ Describing format in words only
231✅ Showing 2-3 concrete input/output examples
232</pitfall>
233
234<pitfall name="missing_edge_cases">
235❌ "Process the file"
236✅ "Process the file. If empty, return []. If malformed, return error with line number."
237</pitfall>
238
239See: [references/anti-patterns.md](references/anti-patterns.md)
240</anti_patterns>
241
242<reference_guides>
243**Core principles:**
244- [references/clarity-principles.md](references/clarity-principles.md) - Being clear and direct
245- [references/xml-structure.md](references/xml-structure.md) - Using XML tags effectively
246
247**Techniques:**
248- [references/few-shot-patterns.md](references/few-shot-patterns.md) - Example-based prompting
249- [references/reasoning-techniques.md](references/reasoning-techniques.md) - Chain of thought, step-by-step
250- [references/system-prompt-patterns.md](references/system-prompt-patterns.md) - System prompt templates
251- [references/context-management.md](references/context-management.md) - Context windows, long-horizon reasoning, state tracking
252
253**Best practices by vendor:**
254- [references/anthropic-best-practices.md](references/anthropic-best-practices.md) - Claude-specific techniques
255- [references/openai-best-practices.md](references/openai-best-practices.md) - GPT-specific techniques
256
257**Quality:**
258- [references/anti-patterns.md](references/anti-patterns.md) - Common mistakes to avoid
259- [references/prompt-templates.md](references/prompt-templates.md) - Ready-to-use templates
260</reference_guides>
261
262<success_criteria>
263A well-crafted prompt has:
264
265- Clear, unambiguous objective
266- Specific output format with example
267- Relevant context provided
268- Edge cases addressed
269- No vague language (try, maybe, generally)
270- Appropriate technique selection for task complexity
271- Success criteria defined
272</success_criteria>