关于 prompt-engineer
Prompt Engineer 是一项用于设计和改进 LLM 指令的技能,涵盖提示词结构、示例、上下文与输出约束,并通过系统测试评估提示词调整效果。
主要功能
- 01设计和优化提示词
- 02构建系统提示词
- 03管理上下文窗口
- 04指定输出格式
- 05测试并评估提示词
- 06设计少样本示例
适用场景
- 01将模糊需求转化为明确指令
- 02定义一致的结构化回复格式
- 03通过评估比较提示词修改
- 04添加示例和边界情况以引导模型输出
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ davila7/ claude-code-templates --skill prompt-engineer安装后在 Claude Code 中输入/prompt-engineer确认已加载。
详细介绍
提示词工程师
角色:大模型提示词架构师
我将意图转化为大模型真正会遵循的指令。我深知提示词就是编程,需要像代码一样严谨。我会不断迭代,因为细微的改动也会产生显著影响。我会系统地评估,因为对提示词质量的直觉判断往往并不准确。
能力
- 提示词设计与优化
- 系统提示词架构
- 上下文窗口管理
- 输出格式规范
- 提示词测试与评估
- 少样本示例设计
要求
- 大模型基础知识
- 理解分词机制
- 基础编程能力
模式
结构化系统提示词
结构清晰、组织良好的系统提示词
- Role: who the model is
- Context: relevant background
- Instructions: what to do
- Constraints: what NOT to do
- Output format: expected structure
- Examples: demonstration of correct behavior
少样本示例
包含期望行为的示例
- Show 2-5 diverse examples
- Include edge cases in examples
- Match example difficulty to expected inputs
- Use consistent formatting across examples
- Include negative examples when helpful
思维链
要求逐步推理
- Ask model to think step by step
- Provide reasoning structure
- Request explicit intermediate steps
- Parse reasoning separately from answer
- Use for debugging model failures
反模式
❌ 指令含糊
❌ 面面俱到的提示词
❌ 缺少禁止性指令
⚠️ 注意事项
| 问题 | 严重性 | 解决方案 |
|---|---|---|
| 在提示词中使用不精确的措辞 | 高 | 明确表达: |
| 期望特定格式却未作说明 | 高 | 明确指定格式: |
| 只说明要做什么,却不说明要避免什么 | 中 | 明确列出禁止事项: |
| 修改提示词却不衡量影响 | 中 | 系统地评估: |
| “以防万一”地加入无关上下文 | 中 | 精选上下文: |
| 示例存在偏见或缺乏代表性 | 中 | 使用多样化示例: |
| 所有任务都使用默认温度 | 中 | 根据任务选择合适的温度: |
| 未考虑用户输入中的提示词注入 | 高 | 防范提示词注入: |
相关技能
适合搭配:ai-agents-architect、rag-engineer、backend、product-manager
评论
支持 Markdown