prompt-creator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<objective>
Create 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.
Every prompt created should be clear, specific, and optimized for the target model.
</objective>
<quick_start>
<workflow>
- Clarify purpose: What should the prompt accomplish?
- Identify model: Claude, GPT, or other (techniques vary slightly)
- Select techniques: Choose from core techniques based on task complexity
- Structure content: Use XML tags (Claude) or markdown (GPT) for organization
- Add examples: Include few-shot examples for format-sensitive outputs
- Define success: Add clear success criteria
- Test and iterate: Refine based on outputs </workflow>
<core_structure>
Every effective prompt has:
xml
<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></core_structure>
</quick_start>
<core_techniques>
<technique name="be_clear_and_direct">
Priority: Always apply first
- 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
</technique>
<technique name="use_xml_tags">
**When**: Claude prompts, complex structure needed
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
</technique>
<technique name="few_shot_examples">
**When**: Output format matters, pattern recognition easier than rules
Provide 2-4 input/output pairs:
xml
<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
</technique>
<technique name="chain_of_thought">
**When**: Complex reasoning, math, multi-step analysis
Add explicit reasoning instructions:
- "Think step by step before answering"
- "First analyze X, then consider Y, finally conclude Z"
- Use tags for Claude's extended thinking
<thinking>
See: references/reasoning-techniques.md
</technique>
<technique name="system_prompts">
**When**: Setting persistent behavior, role, constraints
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
</technique>
<technique name="prefilling">
**When**: Enforcing specific output format (Claude-specific)
Start Claude's response to guide format:
Assistant: {"result":Forces JSON output without preamble.
</technique>
<technique name="context_management">
**When**: Long-running tasks, multi-session work, large context usage
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
</technique>
</core_techniques>
<prompt_creation_workflow>
<step_0>
Gather requirements using AskUserQuestion:
-
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 </step_0>
<step_1>
Draft the prompt using this template:
xml
<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></step_1>
<step_2>
Apply relevant techniques based on complexity:
- Simple: Clear instructions + output format
- Medium: Add examples + constraints
- Complex: Add reasoning steps + edge cases + validation </step_2>
<step_3>
Review checklist:
- Is the task clearly stated?
- Are ambiguous words removed?
- Is output format specified?
- Are edge cases addressed?
- Would a person with no context understand it? </step_3> </prompt_creation_workflow>
<anti_patterns>
<pitfall name="vague_instructions">
❌ "Help with the data"
✅ "Extract email addresses from the CSV, remove duplicates, output as JSON array"
</pitfall>
<pitfall name="negative_prompting">
❌ "Don't use technical jargon"
✅ "Write in plain language suitable for a non-technical audience"
</pitfall>
<pitfall name="no_examples">
❌ Describing format in words only
✅ Showing 2-3 concrete input/output examples
</pitfall>
<pitfall name="missing_edge_cases">
❌ "Process the file"
✅ "Process the file. If empty, return []. If malformed, return error with line number."
</pitfall>
See: references/anti-patterns.md
</anti_patterns>
<reference_guides>
Core principles:
- references/clarity-principles.md - Being clear and direct
- references/xml-structure.md - Using XML tags effectively
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 </reference_guides>
<success_criteria>
A well-crafted prompt has:
- 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 </success_criteria>
<objective>
创建采用Anthropic和OpenAI研究验证技术的高效提示词。本技能涵盖所有主要提示词方法论:清晰性、结构化、示例、推理及高级模式。
所有生成的提示词都应清晰、具体,并针对目标模型进行优化。
</objective>
<quick_start>
<workflow>
- 明确目标:提示词需要实现什么效果?
- 确定模型:Claude、GPT或其他模型(不同模型的技巧略有差异)
- 选择技巧:根据任务复杂度选择核心技巧
- 结构化内容:使用XML标签(针对Claude)或Markdown(针对GPT)进行内容组织
- 添加示例:对于对格式敏感的输出,添加少样本示例
- 定义成功标准:明确清晰的成功判定条件
- 测试与迭代:根据输出结果优化提示词 </workflow>
<core_structure>
每个高效提示词都包含以下结构:
xml
<context>
模型需要的背景信息
</context>
<task>
清晰、具体的任务指令
</task>
<requirements>
- 具体约束条件
- 输出格式
- 需要处理的边缘情况
</requirements>
<examples>
展示预期行为的输入/输出配对示例
</examples>
<success_criteria>
如何判断任务已正确完成
</success_criteria></core_structure>
</quick_start>
<core_techniques>
<technique name="be_clear_and_direct">
优先级:始终首先应用
- 明确说明你的需求
- 避免模糊表述(如“尽量”、“也许”、“通常”)
- 使用“必须...”或“禁止...”替代“应该可能...”
- 提供具体的输出格式要求
参考:references/clarity-principles.md
</technique>
<technique name="use_xml_tags">
**适用场景**:Claude提示词、需要复杂结构的场景
Claude是基于XML标签训练的,可将其用于:
- 分隔内容区块:、
<context>、<task><output> - 包裹数据:、
<document>、<schema><example> - 定义边界:明确区块的开始与结束
参考:references/xml-structure.md
</technique>
<technique name="few_shot_examples">
**适用场景**:输出格式重要、模式识别比规则定义更简单的场景
提供2-4组输入/输出配对示例:
xml
<examples>
<example number="1">
<input>用户点击了注册按钮</input>
<output>track('signup_initiated', { source: 'homepage' })</output>
</example>
</examples>参考:references/few-shot-patterns.md
</technique>
<technique name="chain_of_thought">
**适用场景**:复杂推理、数学计算、多步骤分析
添加明确的推理指令:
- “在回答前逐步思考”
- “先分析X,再考虑Y,最后得出Z结论”
- 针对Claude使用标签实现扩展推理
<thinking>
参考:references/reasoning-techniques.md
</technique>
<technique name="system_prompts">
**适用场景**:设置持续行为、角色、约束条件
系统提示词是基础:
- 定义Claude的角色与专业能力
- 设置约束与边界
- 明确输出格式预期
参考:references/system-prompt-patterns.md
</technique>
<technique name="prefilling">
**适用场景**:强制特定输出格式(Claude专属)
通过引导Claude的响应开头来指定格式:
Assistant: {"result":无需前缀即可强制输出JSON格式。
</technique>
<technique name="context_management">
**适用场景**:长期任务、多会话工作、大上下文使用
针对具备上下文感知能力的Claude 4.5:
- 告知自动上下文压缩机制
- 添加状态跟踪(JSON、progress.txt、git)
- 针对复杂实现采用测试优先模式
- 支持跨上下文窗口的自主任务完成
参考:references/context-management.md
</technique>
</core_techniques>
<prompt_creation_workflow>
<step_0>
使用AskUserQuestion收集需求:
-
提示词的目标是什么?
- 生成内容
- 分析/提取信息
- 转换数据
- 决策制定
- 其他
-
哪个模型会使用该提示词?
- Claude(使用XML标签)
- GPT(使用Markdown结构)
- 其他/多个模型
-
任务复杂度如何?
- 简单(单一任务、输出清晰)
- 中等(多步骤、存在细微差别)
- 复杂(需要推理、边缘情况、验证)
-
输出格式要求?
- 自由文本
- JSON/结构化数据
- 代码
- 特定模板 </step_0>
<step_1>
使用以下模板起草提示词:
xml
<context>
[模型理解任务所需的背景信息]
</context>
<objective>
[明确的任务完成目标]
</objective>
<instructions>
[分步流程,若为顺序执行则编号]
</instructions>
<constraints>
[规则、限制、需要避免的内容]
</constraints>
<output_format>
[预期输出的精确结构]
</output_format>
<examples>
[若格式重要,提供2-4组输入/输出配对示例]
</examples>
<success_criteria>
[如何验证任务已正确完成]
</success_criteria></step_1>
<step_2>
根据复杂度应用相关技巧:
- 简单任务:清晰指令 + 输出格式
- 中等任务:添加示例 + 约束条件
- 复杂任务:添加推理步骤 + 边缘情况 + 验证机制 </step_2>
<step_3>
检查清单:
- 任务是否明确说明?
- 是否移除了模糊表述?
- 是否指定了输出格式?
- 是否处理了边缘情况?
- 无上下文的人是否能理解该提示词? </step_3> </prompt_creation_workflow>
<anti_patterns>
<pitfall name="vague_instructions">
❌ "帮我处理数据"
✅ "从CSV文件中提取电子邮件地址,去除重复项,以JSON数组格式输出"
</pitfall>
<pitfall name="negative_prompting">
❌ "不要使用技术术语"
✅ "使用适合非技术受众的通俗语言撰写"
</pitfall>
<pitfall name="no_examples">
❌ 仅用文字描述格式
✅ 展示2-3组具体的输入/输出示例
</pitfall>
<pitfall name="missing_edge_cases">
❌ "处理该文件"
✅ "处理该文件。若文件为空,返回[];若格式错误,返回包含行号的错误信息。"
</pitfall>
参考:references/anti-patterns.md
</anti_patterns>
<reference_guides>
核心原则:
- references/clarity-principles.md - 清晰直接原则
- references/xml-structure.md - 有效使用XML标签
技巧:
- references/few-shot-patterns.md - 基于示例的提示词
- references/reasoning-techniques.md - 思维链、分步推理
- references/system-prompt-patterns.md - 系统提示词模板
- references/context-management.md - 上下文窗口、长期推理、状态跟踪
厂商最佳实践:
- references/anthropic-best-practices.md - Claude专属技巧
- references/openai-best-practices.md - GPT专属技巧
质量保障:
- references/anti-patterns.md - 需要避免的常见错误
- references/prompt-templates.md - 即用型模板 </reference_guides>
<success_criteria>
优质提示词具备以下特征:
- 清晰、无歧义的目标
- 带示例的具体输出格式
- 提供相关上下文
- 处理边缘情况
- 无模糊表述(如try、maybe、generally)
- 根据任务复杂度选择合适的技巧
- 定义成功标准 </success_criteria>