首页 全部提示词 Agent Skill

提示词工程专家

Prompt Engineering Expert

技能 @tomstools11 42,241 字符 在 prompts.chat 查看 译文有问题?

中文译文

核心专业领域

1. 提示词编写最佳实践

  • 清晰与直接:编写清晰、无歧义的提示词,不给误解留任何空间
  • 结构与格式:以恰当的层级、分区和视觉清晰度组织提示词
  • 具体性:提供精确的指令,配以具体示例和预期输出
  • 上下文管理:在提供必要上下文与避免压垮模型之间取得平衡
  • 语气与风格:使提示词语气与任务要求相匹配

2. 高级提示词工程技术

  • 思维链(CoT)提示:鼓励对复杂任务进行逐步推理
  • 少样本提示:使用示例引导模型行为(1-shot、2-shot、multi-shot)
  • XML 标签:利用结构化 XML 格式提升清晰度与可解析性
  • 角色扮演提示:为 Claude 指定特定人设或专业身份
  • 预填充:通过起始 Claude 的回复来引导输出格式
  • 提示词链:将复杂任务拆解为一系列顺序执行的提示词

3. 自定义指令与系统提示词

  • 系统提示词设计:为专业领域创建有效的系统提示词
  • 自定义指令:为 AI 智能体和技能设计指令
  • 行为准则:设定恰当的约束与准则
  • 个性与语气:定义一致的语调与沟通风格
  • 范围界定:清晰定义智能体应该做什么、不应该做什么

4. 提示词优化与改进

  • 性能分析:评估提示词效果并识别问题
  • 迭代改进:根据结果系统性地优化提示词
  • A/B 测试:比较不同的提示词变体
  • 一致性增强:提高可靠性并减少波动
  • Token 优化:在保持质量的同时减少不必要的 token

5. 反模式与常见错误

  • 模糊性:识别并修复不清晰的指令
  • 矛盾:检测相互冲突的要求
  • 过度限定:识别提示词何时过于严格
  • 幻觉风险:识别容易产生虚假信息的提示词
  • 上下文泄漏:防止意外信息暴露
  • 越狱漏洞:识别并缓解提示词注入风险

6. 评估与测试

  • 成功标准定义:为提示词成功建立清晰的衡量指标
  • 测试用例开发:创建全面的测试用例
  • 失败分析:理解提示词失败的原因
  • 回归测试:确保改进不会破坏现有功能
  • 边界情况处理:测试边界条件和异常输入

7. 多模态与高级提示

  • 视觉提示:为图像分析和理解设计提示词
  • 基于文件的提示:处理文档、PDF 和结构化数据
  • 嵌入集成:使用嵌入进行语义搜索和检索
  • 工具使用提示:设计能有效使用工具和 API 的提示词
  • 扩展思考:利用扩展思考进行复杂推理

关键能力

  • 提示词分析:审查现有提示词并识别改进机会
  • 提示词生成:为特定用例从零创建新提示词
  • 提示词改进:根据性能迭代优化提示词
  • 自定义指令设计:为智能体和技能创建专门指令
  • 最佳实践指导:提供关于提示词工程原则的专家建议
  • 反模式识别:识别并纠正常见错误
  • 测试策略:为提示词验证开发评估框架
  • 文档编写:为提示词的使用和维护创建清晰的文档

使用场景

  • 优化模糊或效果不佳的提示词
  • 为特定领域创建专门的系统提示词
  • 为 AI 智能体和技能设计自定义指令
  • 优化提示词以提升一致性和可靠性
  • 教授提示词工程最佳实践
  • 调试提示词性能问题
  • 为可复用工作流创建提示词模板
  • 提升提示词效率和 token 使用率
  • 开发用于提示词测试的评估框架

技能限制

  • 不执行代码,也不运行实际提示词(仅做分析)
  • 无法访问实时数据或外部 API
  • 基于最佳实践提供指导,不保证结果
  • 建议应结合实际用例进行测试
  • 在关键应用中不能替代人类判断

集成说明

此技能可与以下内容良好配合:

  • Claude Code,用于测试和迭代提示词
  • Agent SDK,用于实现自定义指令
  • Files API,用于分析提示词文档
  • 视觉能力,用于多模态提示词设计
  • 扩展思考,用于复杂的提示词推理 FILE:START_HERE.md

🎯 提示词工程专家技能 - 完整包

✅ 已创建的内容

一个全面的 Claude 技能,用于提供提示词工程专业知识,包含:

📦 完整包内容

  • 7 个核心文档文件
  • 3 个专门指南(最佳实践、技巧、故障排除)
  • 10 个真实世界示例,含前后对比
  • 多个导航指南,便于快速访问
  • 检查清单和模板,供实际使用

📍 位置

~/Documents/prompt-engineering-expert/

📋 文件清单

核心技能文件(4 个文件)

文件 用途 大小
SKILL.md 技能元数据与概览 ~1 KB
CLAUDE.md 主要技能说明 ~3 KB
README.md 用户指南与入门 ~4 KB
GETTING_STARTED.md 如何上传与使用 ~3 KB

文档(3 个文件)

文件 用途 覆盖内容
docs/BEST_PRACTICES.md 全面的最佳实践 核心原则、高级技巧、评估、反模式
docs/TECHNIQUES.md 高级技巧指南 8 项主要技巧及示例
docs/TROUBLESHOOTING.md 问题解决 8 个常见问题 + 调试工作流

示例与导航(3 个文件)

文件 用途 内容
examples/EXAMPLES.md 真实世界示例 10 个实用示例及模板
INDEX.md 完整导航 快速链接、学习路径、集成点
SUMMARY.md 已创建的内容 所有组件的概览

🎓 涵盖的专业知识

7 个核心专业领域

  1. ✅ 提示词撰写最佳实践 - 清晰度、结构、具体性
  2. ✅ 高级技巧 - CoT、少样本、XML、基于角色、预填充、链式调用
  3. ✅ 自定义指令 - 系统提示词、行为准则、范围
  4. ✅ 优化 - 性能分析、迭代改进、token 效率
  5. ✅ 反模式 - 模糊、矛盾、幻觉、越狱
  6. ✅ 评估 - 成功标准、测试用例、失败分析
  7. ✅ 多模态 - 视觉、文件、嵌入、扩展思考

8 项关键能力

  1. ✅ 提示词分析
  2. ✅ 提示词生成
  3. ✅ 提示词精炼
  4. ✅ 自定义指令设计
  5. ✅ 最佳实践指导
  6. ✅ 反模式识别
  7. ✅ 测试策略
  8. ✅ 文档

🚀 如何使用

第 1 步:上传技能

Go to Claude.com → Click "+" → Upload Skill → Select folder

第 2 步:询问 Claude

"Review this prompt and suggest improvements:
[YOUR PROMPT]"

第 3 步:获取专家指导

Claude 将运用该技能的专业知识进行分析并提供建议。


📚 文档细分

BEST_PRACTICES.md(约 8 KB)

  • 核心原则(清晰、简洁、自由度)
  • 高级技巧(8 种技巧及说明)
  • 自定义指令设计
  • 技能结构最佳实践
  • 评估与测试框架
  • 应避免的反模式
  • 工作流与反馈循环
  • 内容指南
  • 多模态提示
  • 开发工作流
  • 完整检查清单

TECHNIQUES.md(约 10 KB)

  • 思维链提示(附示例)
  • 少样本学习(1-shot、2-shot、multi-shot)
  • 使用 XML 标签的结构化输出
  • 基于角色的提示
  • 预填充响应
  • 提示链
  • 上下文管理
  • 多模态提示
  • 组合技巧
  • 反模式

TROUBLESHOOTING.md(约 6 KB)

  • 8 个常见问题及解决方案
  • 调试工作流
  • 快速参考表
  • 测试检查清单

EXAMPLES.md(约 8 KB)

  • 10 个真实世界示例
  • 前后对比
  • 模板与框架
  • 优化检查清单

💡 主要特性

✨ 全面

  • 涵盖提示词工程的所有主要方面
  • 从基础到高级技巧
  • 真实世界示例与模板

🎯 实用

  • 可操作的指导
  • 分步说明
  • 即用型模板

📖 组织良好

  • 结构清晰,逐步展开
  • 多种导航指南
  • 快速参考表

🔍 详尽

  • 8 个常见问题及解决方案
  • 10 个真实世界示例
  • 多个检查清单

🚀 开箱即用

  • 可立即上传
  • 无需额外设置
  • 适用于 Claude.com 和 API

📊 统计数据

指标 数值
文件总数 10
文档总量 约 40 KB
核心专业领域 7
关键能力 8
用例 9
涵盖的常见问题 8
真实世界示例 10
高级技巧 8
最佳实践 50+
反模式 10+

🎯 使用场景

1. 优化模糊的提示词

将不清晰的提示词转化为具体、可操作的提示词。

2. 创建专用提示词

为特定领域或任务设计提示词。

3. 设计智能体指令

为 AI 智能体和技能创建自定义指令。

4. 优化一致性

提高可靠性并减少变异性。

5. 教授最佳实践

学习提示词工程的原则和技术。

6. 调试提示词问题

识别并修复现有提示词中的问题。

7. 构建评估框架

开发测试用例和成功标准。

8. 多模态提示

为视觉、嵌入和文件设计提示词。

9. 创建提示词模板

为工作流构建可复用的提示词模板。


✅ 质量检查清单

  • ✅ 基于 Anthropic 官方文档
  • ✅ 全面覆盖提示词工程
  • ✅ 真实示例和模板
  • ✅ 清晰、组织良好的结构
  • ✅ 渐进式披露以促进学习
  • ✅ 多种导航指南
  • ✅ 实用、可操作的指导
  • ✅ 故障排除和调试帮助
  • ✅ 最佳实践和反模式
  • ✅ 可直接上传使用

🔗 集成点

可无缝配合:

  • Claude.com - 直接上传使用
  • Claude Code - 用于测试提示词
  • Agent SDK - 用于编程式使用
  • Files API - 用于分析文档
  • Vision - 用于多模态设计
  • Extended Thinking - 用于复杂推理

📖 学习路径

初学者(1-2 小时)

  1. 阅读:README.md
  2. 阅读:BEST_PRACTICES.md(核心原则)
  3. 查看:EXAMPLES.md(示例 1-3)
  4. 尝试:创建一个简单的提示词

中级(2-4 小时)

  1. 阅读:TECHNIQUES.md(第 1-4 节)
  2. 查看:EXAMPLES.md(示例 4-7)
  3. 阅读:TROUBLESHOOTING.md
  4. 尝试:优化一个现有的提示词

进阶(4 小时以上)

  1. 阅读:TECHNIQUES.md(所有章节)
  2. 查阅:EXAMPLES.md(所有示例)
  3. 阅读:BEST_PRACTICES.md(所有章节)
  4. 尝试:组合多种技巧

🎁 你将获得

即时收益

  • 专家级提示词工程指导
  • 真实世界的示例和模板
  • 故障排查帮助
  • 最佳实践参考
  • 反模式识别

长期收益

  • 提升提示词质量
  • 加快迭代周期
  • 更好的一致性
  • 减少 token 用量
  • 更高效的 AI 交互

🚀 后续步骤

  1. 导航到该文件夹

    ~/Documents/prompt-engineering-expert/
    
  2. 上传该技能到 Claude.com

    • 点击“+” → 上传技能 → 选择文件夹
  3. 开始使用它

    • 让 Claude 审查你的提示词
    • 请求自定义指令
    • 获取故障排除帮助
  4. 浏览文档

    • 从 README.md 开始
    • 查看示例
    • 学习高级技巧
  5. 与团队分享

    • 协作进行提示词工程
    • 共同构建更好的提示词
    • 改进 AI 交互

📞 支持资源

技能内部

  • 全面的文档
  • 真实世界示例
  • 故障排除指南
  • 最佳实践清单
  • 快速参考表

外部资源


🎉 一切就绪!

你的 提示词工程专家技能 已完成并可以使用!

快速开始

  1. 打开 ~/Documents/prompt-engineering-expert/
  2. 阅读 GETTING_STARTED.md 获取上传说明
  3. 上传到 Claude.com
  4. 开始改进你的提示词! FILE:README.md

README - 提示词工程专家技能

概述

提示词工程专家技能为 Claude 配备了提示词工程、自定义指令设计和提示词优化方面的深厚专业知识。这个全面的技能提供关于编写有效 AI 提示词、设计智能体指令以及迭代改进提示词性能的指导。

此技能提供的内容

核心专长

  • 提示词编写最佳实践:清晰、直接的提示词,并具有恰当的结构
  • 高级技巧:思维链、少样本提示、XML 标签、基于角色的提示
  • 自定义指令:系统提示词和智能体指令设计
  • 优化:分析和改进现有提示词
  • 评估:测试框架和成功标准
  • 反模式:识别并纠正常见错误
  • 多模态:视觉、嵌入和基于文件的提示

关键能力

  1. 提示词分析

    • 审查现有提示词
    • 识别改进机会
    • 发现反模式和问题
    • 提出具体改进建议
  2. 提示词生成

    • 从零创建新提示词
    • 为特定用例进行设计
    • 确保清晰和有效
    • 优化一致性
  3. 自定义指令

    • 设计系统提示词
    • 创建智能体指令
    • 定义行为准则
    • 设置适当的约束
  4. 最佳实践指导

    • 解释提示词工程原则
    • 教授高级技巧
    • 分享真实世界示例
    • 提供实施指导
  5. 测试与验证

    • 开发测试用例
    • 定义成功标准
    • 评估提示词性能
    • 识别边缘情况

如何使用此技能

用于提示词分析

"Review this prompt and suggest improvements:
[YOUR PROMPT]

Focus on: clarity, specificity, format, and consistency."

用于提示词生成

"Create a prompt that:
- [Requirement 1]
- [Requirement 2]
- [Requirement 3]

The prompt should handle [use cases]."

用于自定义指令

"Design custom instructions for an agent that:
- [Role/expertise]
- [Key responsibilities]
- [Behavioral guidelines]"

故障排查

"This prompt isn't working well:
[PROMPT]

Issues: [DESCRIBE ISSUES]

How can I fix it?"

技能结构

prompt-engineering-expert/
├── SKILL.md                 # Skill metadata
├── CLAUDE.md               # Main instructions
├── README.md               # This file
├── docs/
│   ├── BEST_PRACTICES.md   # Best practices guide
│   ├── TECHNIQUES.md       # Advanced techniques
│   └── TROUBLESHOOTING.md  # Common issues & fixes
└── examples/
    └── EXAMPLES.md         # Real-world examples

核心概念

清晰性

  • 明确的目标
  • 精确的语言
  • 具体的示例
  • 逻辑结构

简洁性

  • 聚焦的内容
  • 无冗余
  • 渐进式披露
  • Token 效率

一致性

  • 已定义的约束
  • 指定的格式
  • 清晰的准则
  • 可复现的结果

完整性

  • 充分的上下文
  • 边界情况处理
  • 成功标准
  • 错误处理

常见用例

1. 优化模糊的提示词

将不清晰的提示词转化为具体、可执行的提示词。

2. 创建专用提示词

为特定领域或任务设计提示词。

3. 设计智能体指令

为 AI 智能体和技能创建自定义指令。

4. 优化一致性

提高可靠性并减少变异性。

5. 调试提示词问题

识别并修复现有提示词中的问题。

6. 教授最佳实践

学习提示词工程的原则和技术。

7. 构建评估框架

开发测试用例和成功标准。

8. 多模态提示

为视觉、嵌入和文件设计提示词。

最佳实践总结

应该做的 ✅

  • 清晰且具体
  • 提供示例
  • 指定格式
  • 定义约束
  • 充分测试
  • 记录假设
  • 使用渐进式披露
  • 处理边界情况

不应该做的 ❌

  • 模糊或含糊不清
  • 假设对方已理解
  • 跳过格式规范
  • 忽略边界情况
  • 过度指定约束
  • 使用术语而不加解释
  • 硬编码值
  • 忽略错误处理

进阶主题

思维链提示

鼓励对复杂任务进行逐步推理。

少样本学习

使用示例来引导行为,而无需明确的指令。

结构化输出

使用 XML 标签以提高清晰度和便于解析。

基于角色的提示

赋予专业身份以引导行为。

提示词链

将复杂任务拆解为按顺序执行的提示词。

上下文管理

优化 token 用量与清晰度。

多模态集成

处理图像、文件和嵌入。

局限性

  • 仅限分析:不执行代码,也不运行实际提示词
  • 无实时数据:无法访问外部 API 或当前数据
  • 基于最佳实践:建议基于既有模式
  • 需要测试:建议应结合实际用例进行验证
  • 人类判断:在关键应用中不能替代人类专业知识

与其他技能的集成

此技能可与以下内容良好配合:

  • Claude Code:用于测试和迭代提示词
  • Agent SDK:用于实现自定义指令
  • Files API:用于分析提示词文档
  • Vision:用于多模态提示词设计
  • Extended Thinking:用于复杂的提示词推理

快速上手

快速开始

  1. 分享你的提示词或描述你的需求
  2. 获取分析与建议
  3. 实施建议的改进
  4. 测试并验证
  5. 按需迭代

面向初学者

  • 从 "BEST_PRACTICES.md" 开始
  • 查看 "EXAMPLES.md" 了解真实案例
  • 先尝试简单的提示词
  • 逐步增加复杂度

面向高级用户

  • 探索 "TECHNIQUES.md" 了解高级方法
  • 查看 "TROUBLESHOOTING.md" 了解边缘情况
  • 组合多种技术
  • 构建自定义框架

文档

主要文档

  • BEST_PRACTICES.md:全面的最佳实践指南
  • TECHNIQUES.md:高级提示词工程技巧
  • TROUBLESHOOTING.md:常见问题与解决方案
  • EXAMPLES.md:真实案例与模板

快速参考

  • 命名约定
  • 文件结构
  • YAML frontmatter
  • Token 预算
  • 检查清单

支持与资源

本技能内容

  • 详细文档
  • 真实案例
  • 故障排查指南
  • 最佳实践清单
  • 快速参考表

外部资源

版本历史

v1.0(当前)

  • 首次发布
  • 核心专业领域
  • 最佳实践文档
  • 高级技巧指南
  • 故障排查指南
  • 真实案例

贡献

本技能旨在持续演进。欢迎提供反馈和改进建议。

许可证

本技能作为 Claude 生态系统的一部分提供。


快速链接


准备好改进你的提示词了吗? 从分享你当前的提示词或描述你需要什么帮助开始吧! FILE:SUMMARY.md

提示词工程专家技能 - 摘要

创建了什么

一个全面的 Claude 技能,专注于提示词工程专业知识,深入掌握:

  • 提示词编写最佳实践
  • 自定义指令设计
  • 提示词优化与精炼
  • 高级技巧(CoT、少样本、XML 标签等)
  • 评估框架与测试
  • 反模式识别
  • 多模态提示

技能结构

~/Documents/prompt-engineering-expert/
├── SKILL.md                    # Skill metadata & overview
├── CLAUDE.md                   # Main skill instructions
├── README.md                   # User guide & getting started
├── docs/
│   ├── BEST_PRACTICES.md       # Comprehensive best practices (from official docs)
│   ├── TECHNIQUES.md           # Advanced techniques guide
│   └── TROUBLESHOOTING.md      # Common issues & solutions
└── examples/
    └── EXAMPLES.md             # 10 real-world examples & templates

关键文件

1. SKILL.md(概述)

  • 高层描述
  • 关键能力
  • 使用场景
  • 局限性

2. CLAUDE.md(主要说明)

  • 核心专业领域(7 大领域)
  • 关键能力(8 项能力)
  • 使用场景(9 个场景)
  • 技能局限性
  • 集成说明

3. README.md(用户指南)

  • 概述与所提供内容
  • 如何使用该技能
  • 技能结构
  • 关键概念
  • 常见使用场景
  • 最佳实践摘要
  • 入门指南

4. docs/BEST_PRACTICES.md(最佳实践)

  • 核心原则(清晰、简洁、自由度)
  • 高级技巧(CoT、少样本、XML、角色扮演、预填充、链式调用)
  • 自定义指令设计
  • 技能结构最佳实践
  • 评估与测试
  • 应避免的反模式
  • 工作流与反馈循环
  • 内容指南
  • 多模态提示
  • 开发工作流
  • 综合检查清单

5. docs/TECHNIQUES.md(高级技巧)

  • 思维链提示(附示例)
  • 少样本学习(1-shot、2-shot、multi-shot)
  • 使用 XML 标签的结构化输出
  • 基于角色的提示
  • 预填充响应
  • 提示词链式调用
  • 上下文管理
  • 多模态提示
  • 组合技巧
  • 反模式

6. docs/TROUBLESHOOTING.md(故障排查)

  • 8 个常见问题及解决方案:
    1. 输出不一致
    2. 幻觉
    3. 回答含糊
    4. 长度错误
    5. 格式错误
    6. 拒绝回答
    7. 提示词过长
    8. 无法泛化
  • 调试工作流
  • 快速参考表
  • 测试检查清单

7. examples/EXAMPLES.md(真实世界示例)

  • 10 个实用示例:
    1. 优化含糊的提示词
    2. 为智能体编写自定义指令
    3. 少样本分类
    4. 思维链分析
    5. XML 结构化提示词
    6. 迭代优化
    7. 反模式识别
    8. 测试框架
    9. 技能元数据模板
    10. 优化检查清单

核心专业领域

  1. 提示词编写最佳实践

    • 清晰与直接
    • 结构与格式
    • 具体性
    • 上下文管理
    • 语气与风格
  2. 高级提示词工程技巧

    • 思维链(CoT)提示
    • 少样本提示
    • XML 标签
    • 基于角色的提示
    • 预填充
    • 提示词链
  3. 自定义指令与系统提示词

    • 系统提示词设计
    • 自定义指令
    • 行为准则
    • 个性与语气
    • 范围界定
  4. 提示词优化与改进

    • 性能分析
    • 迭代改进
    • A/B 测试
    • 一致性增强
    • Token 优化
  5. 反模式与常见错误

    • 模糊不清
    • 自相矛盾
    • 过度指定
    • 幻觉风险
    • 上下文泄漏
    • 越狱漏洞
  6. 评估与测试

    • 成功标准定义
    • 测试用例开发
    • 失败分析
    • 回归测试
    • 边缘情况处理
  7. 多模态与高级提示

    • 视觉提示
    • 基于文件的提示
    • 嵌入集成
    • 工具使用提示
    • 扩展思考

关键能力

  1. 提示词分析 - 审查并改进现有提示词
  2. 提示词生成 - 从零创建新提示词
  3. 提示词改进 - 迭代优化提示词
  4. 自定义指令设计 - 创建专门指令
  5. 最佳实践指导 - 教授提示词工程原则
  6. 反模式识别 - 识别并纠正错误
  7. 测试策略 - 开发评估框架
  8. 文档 - 创建清晰的使用文档

如何使用此技能

用于提示词分析

"Review this prompt and suggest improvements:
[YOUR PROMPT]"

用于提示词生成

"Create a prompt that:
- [Requirement 1]
- [Requirement 2]
- [Requirement 3]"

用于自定义指令

"Design custom instructions for an agent that:
- [Role/expertise]
- [Key responsibilities]"

用于故障排查

"This prompt isn't working:
[PROMPT]

Issues: [DESCRIBE ISSUES]

How can I fix it?"

包含的最佳实践

应该做的 ✅

  • 清晰且具体
  • 提供示例
  • 明确格式
  • 定义约束
  • 充分测试
  • 记录假设
  • 使用渐进式披露
  • 处理边缘情况

不应该做的 ❌

  • 含糊或模棱两可
  • 假设对方已理解
  • 跳过格式说明
  • 忽略边缘情况
  • 过度指定约束
  • 使用术语却不加解释
  • 硬编码值
  • 忽略错误处理

文档质量

  • 全面:涵盖提示词工程的所有主要方面
  • 实用:包含真实世界的示例和模板
  • 组织良好:结构清晰,采用渐进式披露
  • 可操作:提供具体指导和分步说明
  • 经过测试:基于 Anthropic 官方文档
  • 可复用:为常见任务提供模板和检查清单

集成点

可与以下内容良好配合:

  • Claude Code(用于测试提示词)
  • Agent SDK(用于实现指令)
  • Files API(用于分析文档)
  • 视觉能力(用于多模态设计)
  • 扩展思考(用于复杂推理)

后续步骤

  1. 上传该技能到 Claude,使用 Skills API 或 Claude Code
  2. 用示例提示词测试以验证功能
  3. 根据反馈迭代以完善和改进
  4. 与团队分享以进行协作式提示词工程
  5. 按需扩展,加入特定领域的示例 FILE:INDEX.md

提示词工程专家技能 - 完整索引

📋 快速导航

入门

  • README.md - 从这里开始!概述、使用方法以及快速入门指南
  • SUMMARY.md - 创建了什么以及如何使用它

核心技能文件

  • SKILL.md - 技能元数据和能力概述
  • CLAUDE.md - 主要技能说明和专业领域

文档

示例与模板


📚 包含内容

专长领域(7 大领域)

  1. 提示词编写最佳实践
  2. 高级提示词工程技巧
  3. 自定义指令与系统提示词
  4. 提示词优化与精炼
  5. 反模式与常见错误
  6. 评估与测试
  7. 多模态与高级提示

核心能力(8 项能力)

  1. 提示词分析
  2. 提示词生成
  3. 提示词精炼
  4. 自定义指令设计
  5. 最佳实践指导
  6. 反模式识别
  7. 测试策略
  8. 文档编写

使用场景(9 个场景)

  1. 精炼模糊或无效的提示词
  2. 创建专用系统提示词
  3. 为智能体设计自定义指令
  4. 优化一致性与可靠性
  5. 教授提示词工程最佳实践
  6. 调试提示词性能问题
  7. 为工作流创建提示词模板
  8. 提升效率与 token 使用率
  9. 开发评估框架

🎯 如何使用本技能

用于提示词分析

"Review this prompt and suggest improvements:
[YOUR PROMPT]

Focus on: clarity, specificity, format, and consistency."

用于提示词生成

"Create a prompt that:
- [Requirement 1]
- [Requirement 2]
- [Requirement 3]

The prompt should handle [use cases]."

用于自定义指令

"Design custom instructions for an agent that:
- [Role/expertise]
- [Key responsibilities]
- [Behavioral guidelines]"

故障排查

"This prompt isn't working well:
[PROMPT]

Issues: [DESCRIBE ISSUES]

How can I fix it?"

📖 文档结构

BEST_PRACTICES.md(综合指南)

  • 核心原则(清晰、简洁、自由度)
  • 高级技巧(CoT、少样本、XML、基于角色、预填充、链式调用)
  • 自定义指令设计
  • 技能结构最佳实践
  • 评估与测试框架
  • 应避免的反模式
  • 工作流与反馈循环
  • 内容指南
  • 多模态提示
  • 开发工作流
  • 完整检查清单

TECHNIQUES.md(高级方法)

  • 带示例的思维链提示
  • 少样本学习(1-shot、2-shot、multi-shot)
  • 使用 XML 标签的结构化输出
  • 基于角色的提示
  • 预填充响应
  • 提示词链式调用
  • 上下文管理
  • 多模态提示
  • 组合技巧
  • 反模式

TROUBLESHOOTING.md(问题解决)

  • 8 个常见问题及解决方案
  • 调试工作流
  • 快速参考表
  • 测试检查清单

EXAMPLES.md(真实案例)

  • 10 个实用示例
  • 前后对比
  • 模板与框架
  • 优化检查清单

✅ 最佳实践总结

应该做的 ✅

  • 清晰且具体
  • 提供示例
  • 指定格式
  • 定义约束
  • 彻底测试
  • 记录假设
  • 使用渐进式披露
  • 处理边缘情况

不应该做的 ❌

  • 含糊或模棱两可
  • 假设对方已理解
  • 跳过格式规范
  • 忽略边缘情况
  • 过度指定约束
  • 使用术语而不加解释
  • 硬编码值
  • 忽略错误处理

🚀 快速上手

第 1 步:阅读概述

从 README.md 开始,了解本技能提供的内容。

第 2 步:学习最佳实践

查阅 docs/BEST_PRACTICES.md 获取基础知识。

第 3 步:探索示例

查看 examples/EXAMPLES.md 了解真实用例。

第 4 步:动手尝试

分享你的提示词或描述你的需求,即可开始。

第 5 步:排查问题

如果遇到问题,请使用 docs/TROUBLESHOOTING.md。


🔧 高级主题

思维链提示

鼓励对复杂任务进行逐步推理。 → 参见:TECHNIQUES.md,第 1 节

少样本学习

使用示例来引导行为,而无需明确指令。 → 参见:TECHNIQUES.md,第 2 节

结构化输出

使用 XML 标签以提高清晰度和便于解析。 → 参见:TECHNIQUES.md,第 3 节

基于角色的提示

分配专业身份以引导行为。 → 参见:TECHNIQUES.md,第 4 节

提示词链式调用

将复杂任务拆分为顺序执行的提示词。 → 参见:TECHNIQUES.md,第 6 节

上下文管理

优化 token 使用与清晰度。 → 参见:TECHNIQUES.md,第 7 节

多模态集成

处理图像、文件和嵌入。 → 参见:TECHNIQUES.md,第 8 节


📊 文件结构

prompt-engineering-expert/
├── INDEX.md                    # This file
├── SUMMARY.md                  # What was created
├── README.md                   # User guide & getting started
├── SKILL.md                    # Skill metadata
├── CLAUDE.md                   # Main instructions
├── docs/
│   ├── BEST_PRACTICES.md       # Best practices guide
│   ├── TECHNIQUES.md           # Advanced techniques
│   └── TROUBLESHOOTING.md      # Common issues & solutions
└── examples/
    └── EXAMPLES.md             # Real-world examples

🎓 学习路径

初学者

  1. 阅读:README.md
  2. 阅读:BEST_PRACTICES.md(核心原则部分)
  3. 查阅:EXAMPLES.md(示例 1-3)
  4. 尝试:创建一个简单的提示词

中级

  1. 阅读:TECHNIQUES.md(第 1-4 节)
  2. 查阅:EXAMPLES.md(示例 4-7)
  3. 阅读:TROUBLESHOOTING.md
  4. 尝试:优化一个现有的提示词

高级

  1. 阅读:TECHNIQUES.md(第 5-8 节)
  2. 查阅:EXAMPLES.md(示例 8-10)
  3. 阅读:BEST_PRACTICES.md(高级部分)
  4. 尝试:组合多种技巧

🔗 集成点

此技能可与以下内容良好配合:

  • Claude Code - 用于测试和迭代提示词
  • Agent SDK - 用于实现自定义指令
  • Files API - 用于分析提示词文档
  • Vision - 用于多模态提示词设计
  • Extended Thinking - 用于复杂的提示词推理

📝 关键概念

清晰性

  • 明确的目标
  • 精确的语言
  • 具体的示例
  • 逻辑结构

简洁性

  • 聚焦的内容
  • 无冗余
  • 渐进式披露
  • Token 效率

一致性

  • 已定义的约束
  • 指定的格式
  • 清晰的指南
  • 可重复的结果

完整性

  • 充分的上下文
  • 边界情况处理
  • 成功标准
  • 错误处理

⚠️ 局限性

  • 仅限分析:不执行代码或运行实际提示词
  • 无实时数据:无法访问外部 API 或当前数据
  • 基于最佳实践:建议基于已确立的模式
  • 需要测试:建议应通过实际用例进行验证
  • 人类判断:在关键应用中不能替代人类专业知识

🎯 常见用例

1. 优化模糊的提示词

将不清晰的提示词转化为具体、可操作的提示词。 → 参见:EXAMPLES.md,示例 1

2. 创建专用提示词

为特定领域或任务设计提示词。 → 参见:EXAMPLES.md,示例 2

3. 设计智能体指令

为 AI 智能体和技能创建自定义指令。 → 参见:EXAMPLES.md,示例 2

4. 优化一致性

提升可靠性并减少变异性。 → 参见:BEST_PRACTICES.md,技能结构章节

5. 调试提示词问题

识别并修复现有提示词中的问题。 → 参见:TROUBLESHOOTING.md

6. 教学最佳实践

学习提示词工程的原则与技术。 → 参见:BEST_PRACTICES.md、TECHNIQUES.md

7. 构建评估框架

开发测试用例与成功标准。 → 参见:BEST_PRACTICES.md,评估与测试章节

8. 多模态提示

为视觉、嵌入和文件设计提示词。 → 参见:TECHNIQUES.md,第 8 节


📞 支持与资源

本技能内

  • 详细文档
  • 真实案例
  • 故障排查指南
  • 最佳实践清单
  • 快速参考表

外部资源


🚀 后续步骤

  1. 浏览文档 - 从 README.md 开始
  2. 查看示例 - 查阅 examples/EXAMPLES.md
  3. 动手尝试 - 分享你的提示词或描述你的需求
  4. 迭代 - 利用反馈进行改进
  5. 分享 - 帮助他人改进他们的提示词 FILE:BEST_PRACTICES.md

提示词工程专家 - 最佳实践指南

本文档综合了 Anthropic 官方文档和 Claude Cookbooks 中的最佳实践,以构建一套全面的提示词工程技能。

提示词工程的核心原则

1. 清晰与直接

  • 明确表达:准确说明你希望 Claude 做什么
  • 避免歧义:使用精确的语言,不留任何误解空间
  • 使用具体示例:展示,而不只是讲述
  • 逻辑化组织:按层级组织信息

2. 简洁性

  • 尊重上下文窗口:保持提示词聚焦且相关
  • 去除冗余:消除不必要的重复
  • 渐进式披露:仅在需要时提供细节
  • Token 效率:兼顾质量与成本进行优化

3. 适当的自由度

  • 定义约束:为 Claude 应该做/不应该做的事情设定清晰边界
  • 指定格式:明确说明期望的输出格式
  • 设定范围:清晰界定哪些在范围内、哪些在范围外
  • 平衡灵活性:在保持控制的同时,为 Claude 的推理留出空间

高级提示词工程技巧

思维链(CoT)提示

鼓励对复杂任务进行逐步推理:

"Let's think through this step by step:
1. First, identify...
2. Then, analyze...
3. Finally, conclude..."

少样本提示

用示例引导行为:

  • 1-shot:单个示例,适用于简单任务
  • 2-shot:两个示例,适用于中等复杂度
  • Multi-shot:多个示例,适用于复杂模式

用 XML 标签构建结构

使用 XML 标签以提升清晰度和可解析性:

<task>
  <objective>What you want done</objective>
  <constraints>Limitations and rules</constraints>
  <format>Expected output format</format>
</task>

基于角色的提示词

为 Claude 分配专业身份:

"You are an expert prompt engineer with deep knowledge of...
Your task is to..."

预填充

开始 Claude 的回复以引导格式:

"Here's my analysis:

Key findings:"

提示词链

将复杂任务拆解为顺序执行的提示词:

  1. 提示词 1:分析输入
  2. 提示词 2:处理分析结果
  3. 提示词 3:生成输出

自定义指令与系统提示词

系统提示词设计

  • 定义角色:Claude 应具备什么专业知识?
  • 设定语气:什么样的沟通风格是合适的?
  • 建立约束:Claude 应避免什么?
  • 明确范围:专业知识的领域是什么?

行为准则

  • 应做:需要鼓励的具体行为
  • 不应做:需要避免的具体行为
  • 边缘情况:如何处理异常情况
  • 升级处理:何时请求澄清

技能结构最佳实践

命名规范

  • 使用动名词形式(动词 + -ing):"analyzing-financial-statements"
  • 使用小写加连字符:"prompt-engineering-expert"
  • 保持描述性:名称应表明能力
  • 避免通用名称:要具体说明领域

撰写有效的描述

  • 第一行:清晰、简洁的摘要(最多 1024 个字符)
  • 具体性:说明确切的能力
  • 使用场景:提及主要应用
  • 避免含糊:不要使用 "helps with" 或 "assists in"

渐进式披露模式

模式 1:带引用的高层指南

  • 从概述开始
  • 链接到详细章节
  • 按复杂度组织

模式 2:按领域组织

  • 按使用场景分组
  • 分离关注点
  • 清晰的导航

模式 3:条件性细节

  • 根据上下文展示细节
  • 为每条路径提供示例
  • 避免选项过多

文件结构

skill-name/
├── SKILL.md (required metadata)
├── CLAUDE.md (main instructions)
├── reference-guide.md (detailed info)
├── examples.md (use cases)
└── troubleshooting.md (common issues)

评估与测试

成功标准定义

  • 可衡量:定义「成功」是什么样子
  • 具体:避免模糊的指标
  • 可测试:能够被客观验证
  • 现实:用该提示词可以实现

测试用例开发

  • 正常路径:正常、预期的使用方式
  • 边界情况:临界条件
  • 错误情况:无效输入
  • 压力测试:复杂场景

失败分析

  • 为什么失败?:根本原因分析
  • 模式识别:识别系统性问题
  • 改进:相应地调整提示词

要避免的反模式

常见错误

  • 模糊:「帮我完成这个任务」(太模糊)
  • 矛盾:相互冲突的要求
  • 过度指定:约束太多
  • 幻觉风险:鼓励虚假信息的提示词
  • 上下文泄漏:意外暴露信息
  • 越狱漏洞:容易被操纵的提示词

Windows 风格路径

  • ❌ 使用:C:\Users\Documents\file.txt
  • ✅ 使用:/Users/Documents/file.txt 或 ~/Documents/file.txt

选项过多

  • 避免提供 10 个以上选项
  • 限制为 3-5 个明确的备选方案
  • 对复杂选项使用渐进式披露

工作流与反馈循环

对复杂任务使用工作流

  • 拆分为逻辑步骤
  • 为每个步骤定义输入/输出
  • 实现反馈机制
  • 允许迭代

实现反馈循环

  • 在需要时请求澄清
  • 验证中间结果
  • 根据反馈进行调整
  • 确认理解

内容指南

避免时效性信息

  • 不要硬编码日期
  • 使用相对引用(「当前年份」)
  • 提供更新机制
  • 记录信息在当时的时间

使用一致的术语

  • 一次性定义关键术语
  • 全程一致使用
  • 避免同一概念使用同义词
  • 为复杂领域创建术语表

多模态与高级提示

视觉提示

  • 描述 Claude 应分析的内容
  • 指定输出格式
  • 提供关于图像的上下文
  • 询问具体细节

基于文件的提示

  • 指定接受的文件类型
  • 描述预期结构
  • 提供解析指令
  • 优雅地处理错误

扩展思考

  • 用于复杂推理
  • 允许更多处理时间
  • 请求详细解释
  • 用于新颖问题

技能开发工作流

先构建评估

  1. 定义成功标准
  2. 创建测试用例
  3. 建立基线
  4. 衡量改进

与 Claude 迭代开发

  1. 从简单版本开始
  2. 测试并收集反馈
  3. 根据结果改进
  4. 重复直到满意

观察 Claude 如何浏览技能

  • 观察 Claude 如何发现内容
  • 记录哪些部分被使用
  • 识别令人困惑的区域
  • 根据使用模式进行优化

YAML Frontmatter 要求

---
name: skill-name
description: Clear, concise description (max 1024 chars)
---

Token 预算考量

  • 技能元数据:约 100-200 个 token
  • 主指令:约 500-1000 个 token
  • 参考文件:每个约 1000-5000 个 token
  • 示例:每个约 500-1000 个 token
  • 总预算:因用例而异

有效技能的检查清单

核心质量

  • 清晰、具体的名称(动名词形式)
  • 简洁的描述(1-2 句话)
  • 结构组织良好
  • 已实现渐进式披露
  • 术语一致
  • 无时效性信息

内容

  • 已定义清晰的用例
  • 已提供示例
  • 已记录边界情况
  • 已说明局限性
  • 已包含故障排除指南

测试

  • 已创建测试用例
  • 已定义成功标准
  • 已测试边界情况
  • 已验证错误处理
  • 已在多个模型上测试

文档

  • README 或概述
  • 使用示例
  • API/集成说明
  • 故障排除章节
  • 已记录更新机制 FILE:TECHNIQUES.md

高级提示词工程技巧

目录

  1. 思维链提示
  2. 少样本学习
  3. 使用 XML 的结构化输出
  4. 基于角色的提示
  5. 预填充响应
  6. 提示词链
  7. 上下文管理
  8. 多模态提示

1. 思维链(CoT)提示

它是什么

鼓励 Claude 在给出最终答案之前,将复杂推理分解为明确的步骤。

何时使用

  • 复杂推理任务
  • 多步骤问题
  • 需要论证依据的任务
  • 一致性很重要时

基本结构

Let's think through this step by step:

Step 1: [First logical step]
Step 2: [Second logical step]
Step 3: [Third logical step]

Therefore: [Conclusion]

示例

Problem: A store sells apples for $2 each and oranges for $3 each. 
If I buy 5 apples and 3 oranges, how much do I spend?

Let's think through this step by step:

Step 1: Calculate apple cost
- 5 apples × $2 per apple = $10

Step 2: Calculate orange cost
- 3 oranges × $3 per orange = $9

Step 3: Calculate total
- $10 + $9 = $19

Therefore: You spend $19 total.

优势

  • 更准确的推理
  • 更容易识别错误
  • 更适合复杂问题
  • 更透明的逻辑

2. 少样本学习

它是什么

提供示例来引导 Claude 的行为,而无需明确的指令。

类型

单样本(单个示例)

最适合:简单、直接的任务

Example: "Happy" → Positive
Now classify: "Terrible" →

2-Shot(两个示例)

最适合:中等复杂度

Example 1: "Great product!" → Positive
Example 2: "Doesn't work well" → Negative
Now classify: "It's okay" →

多示例(多个示例)

最适合:复杂模式、边缘情况

Example 1: "Love it!" → Positive
Example 2: "Hate it" → Negative
Example 3: "It's fine" → Neutral
Example 4: "Could be better" → Neutral
Example 5: "Amazing!" → Positive
Now classify: "Not bad" →

最佳实践

  • 使用多样化的示例
  • 包含边缘情况
  • 展示正确格式
  • 按复杂度排序
  • 使用贴近实际的示例

3. 使用 XML 标签的结构化输出

它是什么

使用 XML 标签来组织提示词结构并引导输出格式。

优势

  • 结构清晰
  • 易于解析
  • 减少歧义
  • 更好的组织性

常见模式

任务定义

<task>
  <objective>What to accomplish</objective>
  <constraints>Limitations and rules</constraints>
  <format>Expected output format</format>
</task>

分析结构

<analysis>
  <problem>Define the problem</problem>
  <context>Relevant background</context>
  <solution>Proposed solution</solution>
  <justification>Why this solution</justification>
</analysis>

条件逻辑

<instructions>
  <if condition="input_type == 'question'">
    <then>Provide detailed answer</then>
  </if>
  <if condition="input_type == 'request'">
    <then>Fulfill the request</then>
  </if>
</instructions>

4. 基于角色的提示词

它是什么

为 Claude 分配一个特定的角色或专业身份,以引导其行为。

结构

You are a [ROLE] with expertise in [DOMAIN].

Your responsibilities:
- [Responsibility 1]
- [Responsibility 2]
- [Responsibility 3]

When responding:
- [Guideline 1]
- [Guideline 2]
- [Guideline 3]

Your task: [Specific task]

示例

专家顾问

You are a senior management consultant with 20 years of experience 
in business strategy and organizational transformation.

Your task: Analyze this company's challenges and recommend solutions.

技术架构师

You are a cloud infrastructure architect specializing in scalable systems.

Your task: Design a system architecture for [requirements].

创意总监

You are a creative director with expertise in brand storytelling and 
visual communication.

Your task: Develop a brand narrative for [product/company].

5. 预填充回复

它是什么

预先开始 Claude 的回复,以引导格式和语气。

好处

  • 确保格式正确
  • 设定语气和风格
  • 引导推理
  • 提高一致性

示例

结构化分析

Prompt: Analyze this market opportunity.

Claude's response should start:
"Here's my analysis of this market opportunity:

Market Size: [Analysis]
Growth Potential: [Analysis]
Competitive Landscape: [Analysis]"

逐步推理

Prompt: Solve this problem.

Claude's response should start:
"Let me work through this systematically:

1. First, I'll identify the key variables...
2. Then, I'll analyze the relationships...
3. Finally, I'll derive the solution..."

格式化输出

Prompt: Create a project plan.

Claude's response should start:
"Here's the project plan:

Phase 1: Planning
- Task 1.1: [Description]
- Task 1.2: [Description]

Phase 2: Execution
- Task 2.1: [Description]"

6. 提示词链

它是什么

将复杂任务拆解为一系列顺序执行的提示词,把上一步的输出作为下一步的输入。

结构

Prompt 1: Analyze/Extract
↓
Output 1: Structured data
↓
Prompt 2: Process/Transform
↓
Output 2: Processed data
↓
Prompt 3: Generate/Synthesize
↓
Final Output: Result

示例:文档分析流水线

提示词 1:提取信息

Extract key information from this document:
- Main topic
- Key points (bullet list)
- Important dates
- Relevant entities

Format as JSON.

提示词 2:分析提取的数据

Analyze this extracted information:
[JSON from Prompt 1]

Identify:
- Relationships between entities
- Temporal patterns
- Significance of each point

提示词 3:生成摘要

Based on this analysis:
[Analysis from Prompt 2]

Create an executive summary that:
- Explains the main findings
- Highlights key insights
- Recommends next steps

7. 上下文管理

它是什么

策略性地管理信息,以优化 token 使用和清晰度。

技巧

渐进式披露

Start with: High-level overview
Then provide: Relevant details
Finally include: Edge cases and exceptions

层级化组织

Level 1: Core concept
├── Level 2: Key components
│   ├── Level 3: Specific details
│   └── Level 3: Implementation notes
└── Level 2: Related concepts

条件信息

If [condition], include [information]
Else, skip [information]

This reduces unnecessary context.

最佳实践

  • 只包含必要的上下文
  • 按层级组织
  • 对详细信息使用引用
  • 先总结后细节
  • 关联相关概念

8. 多模态提示

视觉提示

结构

Analyze this image:
[IMAGE]

Specifically, identify:
1. [What to look for]
2. [What to analyze]
3. [What to extract]

Format your response as:
[Desired format]

示例

Analyze this chart:
[CHART IMAGE]

Identify:
1. Main trends
2. Anomalies or outliers
3. Predictions for next period

Format as a structured report.

基于文件的提示词

结构

Analyze this document:
[FILE]

Extract:
- [Information type 1]
- [Information type 2]
- [Information type 3]

Format as:
[Desired format]

示例

Analyze this PDF financial report:
[PDF FILE]

Extract:
- Revenue by quarter
- Expense categories
- Profit margins

Format as a comparison table.

嵌入集成

结构

Using these embeddings:
[EMBEDDINGS DATA]

Find:
- Most similar items
- Clusters or groups
- Outliers

Explain the relationships.

组合技巧

示例:复杂分析提示词

<prompt>
  <role>
    You are a senior data analyst with expertise in business intelligence.
  </role>
  
  <task>
    Analyze this sales data and provide insights.
  </task>
  
  <instructions>
    Let's think through this step by step:
    
    Step 1: Data Overview
    - What does the data show?
    - What time period does it cover?
    - What are the key metrics?
    
    Step 2: Trend Analysis
    - What patterns emerge?
    - Are there seasonal trends?
    - What's the growth trajectory?
    
    Step 3: Comparative Analysis
    - How does this compare to benchmarks?
    - Which segments perform best?
    - Where are the opportunities?
    
    Step 4: Recommendations
    - What actions should we take?
    - What are the priorities?
    - What's the expected impact?
  </instructions>
  
  <format>
    <executive_summary>2-3 sentences</executive_summary>
    <key_findings>Bullet points</key_findings>
    <detailed_analysis>Structured sections</detailed_analysis>
    <recommendations>Prioritized list</recommendations>
  </format>
</prompt>

要避免的反模式

❌ 模糊链式调用

"Analyze this, then summarize it, then give me insights."

✅ 清晰链式调用

"Step 1: Extract key metrics from the data
Step 2: Compare to industry benchmarks
Step 3: Identify top 3 opportunities
Step 4: Recommend prioritized actions"

❌ 角色不清晰

"Act like an expert and help me."

✅ 明确的角色

"You are a senior product manager with 10 years of experience 
in SaaS companies. Your task is to..."

❌ 格式含糊

"Give me the results in a nice format."

✅ 清晰格式

"Format as a table with columns: Metric, Current, Target, Gap"

文件:TROUBLESHOOTING.md

故障排除指南

常见提示词问题与解决方案

问题 1:输出不一致

症状:

  • 相同的提示词产生不同的结果
  • 输出在格式或质量上存在差异
  • 行为不可预测

根本原因:

  • 指令含糊不清
  • 缺少约束条件
  • 示例不足
  • 成功标准不明确

解决方案:

1. Add specific format requirements
2. Include multiple examples
3. Define constraints explicitly
4. Specify output structure with XML tags
5. Use role-based prompting for consistency

示例修复:

❌ Before: "Summarize this article"

✅ After: "Summarize this article in exactly 3 bullet points, 
each 1-2 sentences. Focus on key findings and implications."

问题 2:幻觉或虚假信息

症状:

  • Claude 编造事实
  • 自信但错误的陈述
  • 捏造的引用或数据

根本原因:

  • 鼓励猜测的提示词
  • 缺乏事实依据
  • 上下文不足
  • 问题含糊不清

解决方案:

1. Ask Claude to cite sources
2. Request confidence levels
3. Ask for caveats and limitations
4. Provide factual context
5. Ask "What don't you know?"

示例修复:

❌ Before: "What will happen to the market next year?"

✅ After: "Based on current market data, what are 3 possible 
scenarios for next year? For each, explain your reasoning and 
note your confidence level (high/medium/low)."

问题 3:回答含糊或无用

症状:

  • 泛泛而谈的回答
  • 缺乏具体性
  • 没有回应真正的问题
  • 过于笼统

根本原因:

  • 提示词含糊
  • 缺少上下文
  • 目标不明确
  • 没有指定格式

解决方案:

1. Be more specific in the prompt
2. Provide relevant context
3. Specify desired output format
4. Give examples of good responses
5. Define success criteria

示例修复:

❌ Before: "How can I improve my business?"

✅ After: "I run a SaaS company with $2M ARR. We're losing 
customers to competitors. What are 3 specific strategies to 
improve retention? For each, explain implementation steps and 
expected impact."

问题 4:回复过长或过短

症状:

  • 回复过于冗长
  • 回复过于简短
  • 不符合预期
  • 浪费 token

根本原因:

  • 未指定长度
  • 范围不清晰
  • 缺少格式指引
  • 详细程度含糊

解决方案:

1. Specify word/sentence count
2. Define scope clearly
3. Use format templates
4. Provide examples
5. Request specific detail level

示例修复:

❌ Before: "Explain machine learning"

✅ After: "Explain machine learning in 2-3 paragraphs for 
someone with no technical background. Focus on practical 
applications, not theory."

问题 5:输出格式错误

症状:

  • 输出格式不符合需求
  • 无法解析响应
  • 与下游工具不兼容
  • 需要手动重新格式化

根本原因:

  • 没有格式规范
  • 格式要求含糊不清
  • 格式未清晰演示
  • 缺少示例

解决方案:

1. Specify exact format (JSON, CSV, table, etc.)
2. Provide format examples
3. Use XML tags for structure
4. Request specific fields
5. Show before/after examples

示例修复:

❌ Before: "List the top 5 products"

✅ After: "List the top 5 products in JSON format:
{
  \"products\": [
    {\"name\": \"...\", \"revenue\": \"...\", \"growth\": \"...\"}
  ]
}"

问题 6:Claude 拒绝回应

症状:

  • “我无法协助处理此事”
  • 拒绝回答
  • 建议替代方案
  • 显得过度谨慎

根本原因:

  • 提示词看似有害
  • 意图模糊
  • 敏感话题
  • 合法用例不明确

解决方案:

1. Clarify legitimate purpose
2. Reframe the question
3. Provide context
4. Explain why you need this
5. Ask for general guidance instead

示例修复:

❌ Before: "How do I manipulate people?"

✅ After: "I'm writing a novel with a manipulative character. 
How would a psychologist describe manipulation tactics? 
What are the psychological mechanisms involved?"

问题 7:提示词过长

症状:

  • 超出上下文窗口
  • 响应缓慢
  • token 用量高
  • 运行成本高

根本原因:

  • 不必要的上下文
  • 冗余信息
  • 示例过多
  • 指令冗长

解决方案:

1. Remove unnecessary context
2. Consolidate similar points
3. Use references instead of full text
4. Reduce number of examples
5. Use progressive disclosure

示例修复:

❌ Before: [5000 word prompt with full documentation]

✅ After: [500 word prompt with links to detailed docs]
"See REFERENCE.md for detailed specifications"

问题 8:提示词无法泛化

症状:

  • 对一个案例有效,对其他案例失败
  • 对输入变化很脆弱
  • 遇到不同数据就崩溃
  • 无法复用

根本原因:

  • 对单个示例过于具体
  • 硬编码的值
  • 假设了特定格式
  • 缺乏灵活性

解决方案:

1. Use variables instead of hardcoded values
2. Handle multiple input formats
3. Add error handling
4. Test with diverse inputs
5. Build in flexibility

示例修复:

❌ Before: "Analyze this Q3 sales data..."

✅ After: "Analyze this [PERIOD] [METRIC] data. 
Handle various formats: CSV, JSON, or table.
If format is unclear, ask for clarification."

调试工作流

第 1 步:识别问题

  • 什么没有正常工作?
  • 它是如何失败的?
  • 影响是什么?

第 2 步:分析提示词

  • 目标是否清晰?
  • 指令是否具体?
  • 上下文是否充分?
  • 格式是否已指定?

第 3 步:测试假设

  • 尝试添加更多上下文
  • 尝试更具体
  • 尝试提供示例
  • 尝试更改格式

第 4 步:实施修复

  • 更新提示词
  • 用多个输入进行测试
  • 验证一致性
  • 记录变更

第 5 步:验证

  • 现在能正常工作吗?
  • 它能泛化吗?
  • 它高效吗?
  • 它可维护吗?

快速参考:常见修复

问题 快速修复
不一致 添加格式规范 + 示例
幻觉 要求提供来源 + 置信度
模糊 添加具体细节 + 示例
太长 指定字数 + 格式
格式错误 展示确切的格式示例
拒绝回答 阐明正当用途
提示词太长 移除不必要的上下文
无法泛化 使用变量 + 处理变体

测试清单

在部署提示词之前,请验证:

  • 目标非常清晰
  • 指令具体明确
  • 格式已指定
  • 已提供示例
  • 边界情况已处理
  • 能处理多个输入
  • 输出一致
  • token 已优化
  • 错误处理清晰
  • 文档完整 FILE:EXAMPLES.md

提示词工程专家 - 示例

示例 1:优化模糊的提示词

之前(无效)

Help me write a better prompt for analyzing customer feedback.

改进后(有效)

You are an expert prompt engineer. I need to create a prompt that:
- Analyzes customer feedback for sentiment (positive/negative/neutral)
- Extracts key themes and pain points
- Identifies actionable recommendations
- Outputs structured JSON with: sentiment, themes (array), pain_points (array), recommendations (array)

The prompt should handle feedback of 50-500 words and be consistent across different customer segments.

Please review this prompt and suggest improvements:
[ORIGINAL PROMPT HERE]

示例 2:数据分析智能体的自定义指令

---
name: data-analysis-agent
description: Specialized agent for financial data analysis and reporting
---

# Data Analysis Agent Instructions

## Role
You are an expert financial data analyst with deep knowledge of:
- Financial statement analysis
- Trend identification and forecasting
- Risk assessment
- Comparative analysis

## Core Behaviors

### Do's
- Always verify data sources before analysis
- Provide confidence levels for predictions
- Highlight assumptions and limitations
- Use clear visualizations and tables
- Explain methodology before results

### Don'ts
- Don't make predictions beyond 12 months without caveats
- Don't ignore outliers without investigation
- Don't present correlation as causation
- Don't use jargon without explanation
- Don't skip uncertainty quantification

## Output Format
Always structure analysis as:
1. Executive Summary (2-3 sentences)
2. Key Findings (bullet points)
3. Detailed Analysis (with supporting data)
4. Limitations and Caveats
5. Recommendations (if applicable)

## Scope
- Financial data analysis only
- Historical and current data (not speculation)
- Quantitative analysis preferred
- Escalate to human analyst for strategic decisions

示例 3:用于分类的少样本提示词

You are a customer support ticket classifier. Classify each ticket into one of these categories:
- billing: Payment, invoice, or subscription issues
- technical: Software bugs, crashes, or technical problems
- feature_request: Requests for new functionality
- general: General inquiries or feedback

Examples:

Ticket: "I was charged twice for my subscription this month"
Category: billing

Ticket: "The app crashes when I try to upload files larger than 100MB"
Category: technical

Ticket: "Would love to see dark mode in the mobile app"
Category: feature_request

Now classify this ticket:
Ticket: "How do I reset my password?"
Category:

示例 4:用于复杂分析的思维链提示词

Analyze this business scenario step by step:

Step 1: Identify the core problem
- What is the main issue?
- What are the symptoms?
- What's the root cause?

Step 2: Analyze contributing factors
- What external factors are involved?
- What internal factors are involved?
- How do they interact?

Step 3: Evaluate potential solutions
- What are 3-5 viable solutions?
- What are the pros and cons of each?
- What are the implementation challenges?

Step 4: Recommend and justify
- Which solution is best?
- Why is it superior to alternatives?
- What are the risks and mitigation strategies?

Scenario: [YOUR SCENARIO HERE]

示例 5:用于一致性的 XML 结构化提示词

<prompt>
  <metadata>
    <version>1.0</version>
    <purpose>Generate marketing copy for SaaS products</purpose>
    <target_audience>B2B decision makers</target_audience>
  </metadata>
  
  <instructions>
    <objective>
      Create compelling marketing copy that emphasizes ROI and efficiency gains
    </objective>
    
    <constraints>
      <max_length>150 words</max_length>
      <tone>Professional but approachable</tone>
      <avoid>Jargon, hyperbole, false claims</avoid>
    </constraints>
    
    <format>
      <headline>Compelling, benefit-focused (max 10 words)</headline>
      <body>2-3 paragraphs highlighting key benefits</body>
      <cta>Clear call-to-action</cta>
    </format>
    
    <examples>
      <example>
        <product>Project management tool</product>
        <copy>
          Headline: "Cut Project Delays by 40%"
          Body: "Teams waste 8 hours weekly on status updates. Our tool automates coordination..."
        </example>
      </example>
    </examples>
  </instructions>
</prompt>

示例 6:用于迭代优化的提示词

I'm working on a prompt for [TASK]. Here's my current version:

[CURRENT PROMPT]

I've noticed these issues:
- [ISSUE 1]
- [ISSUE 2]
- [ISSUE 3]

As a prompt engineering expert, please:
1. Identify any additional issues I missed
2. Suggest specific improvements with reasoning
3. Provide a refined version of the prompt
4. Explain what changed and why
5. Suggest test cases to validate the improvements

示例 7:反模式识别

❌ 无效提示词

"Analyze this data and tell me what you think about it. Make it good."

问题:

  • 目标模糊(“分析”和“你认为”)
  • 没有格式规范
  • 没有成功标准
  • 质量标准含糊(“把它做好”)

✅ 改进后的提示词

"Analyze this sales data to identify:
1. Top 3 performing products (by revenue)
2. Seasonal trends (month-over-month changes)
3. Customer segments with highest lifetime value

Format as a structured report with:
- Executive summary (2-3 sentences)
- Key metrics table
- Trend analysis with supporting data
- Actionable recommendations

Focus on insights that could improve Q4 revenue."

示例 8:提示词测试框架

# Prompt Evaluation Framework

## Test Case 1: Happy Path
Input: [Standard, well-formed input]
Expected Output: [Specific, detailed output]
Success Criteria: [Measurable criteria]

## Test Case 2: Edge Case - Ambiguous Input
Input: [Ambiguous or unclear input]
Expected Output: [Request for clarification]
Success Criteria: [Asks clarifying questions]

## Test Case 3: Edge Case - Complex Scenario
Input: [Complex, multi-faceted input]
Expected Output: [Structured, comprehensive analysis]
Success Criteria: [Addresses all aspects]

## Test Case 4: Error Handling
Input: [Invalid or malformed input]
Expected Output: [Clear error message with guidance]
Success Criteria: [Helpful, actionable error message]

## Regression Test
Input: [Previous failing case]
Expected Output: [Now handles correctly]
Success Criteria: [Issue is resolved]

示例 9:技能元数据模板

---
name: analyzing-financial-statements
description: Expert guidance on analyzing financial statements, identifying trends, and extracting actionable insights for business decision-making
---

# Financial Statement Analysis Skill

## Overview
This skill provides expert guidance on analyzing financial statements...

## Key Capabilities
- Balance sheet analysis
- Income statement interpretation
- Cash flow analysis
- Ratio analysis and benchmarking
- Trend identification
- Risk assessment

## Use Cases
- Evaluating company financial health
- Comparing competitors
- Identifying investment opportunities
- Assessing business performance
- Forecasting financial trends

## Limitations
- Historical data only (not predictive)
- Requires accurate financial data
- Industry context important
- Professional judgment recommended

示例 10:提示词优化检查清单

# Prompt Optimization Checklist

## Clarity
- [ ] Objective is crystal clear
- [ ] No ambiguous terms
- [ ] Examples provided
- [ ] Format specified

## Conciseness
- [ ] No unnecessary words
- [ ] Focused on essentials
- [ ] Efficient structure
- [ ] Respects context window

## Completeness
- [ ] All necessary context provided
- [ ] Edge cases addressed
- [ ] Success criteria defined
- [ ] Constraints specified

## Testability
- [ ] Can measure success
- [ ] Has clear pass/fail criteria
- [ ] Repeatable results
- [ ] Handles edge cases

## Robustness
- [ ] Handles variations in input
- [ ] Graceful error handling
- [ ] Consistent output format
- [ ] Resistant to jailbreaks

English original

Core Expertise Areas

1. Prompt Writing Best Practices

  • Clarity and Directness: Writing clear, unambiguous prompts that leave no room for misinterpretation
  • Structure and Formatting: Organizing prompts with proper hierarchy, sections, and visual clarity
  • Specificity: Providing precise instructions with concrete examples and expected outputs
  • Context Management: Balancing necessary context without overwhelming the model
  • Tone and Style: Matching prompt tone to the task requirements

2. Advanced Prompt Engineering Techniques

  • Chain-of-Thought (CoT) Prompting: Encouraging step-by-step reasoning for complex tasks
  • Few-Shot Prompting: Using examples to guide model behavior (1-shot, 2-shot, multi-shot)
  • XML Tags: Leveraging structured XML formatting for clarity and parsing
  • Role-Based Prompting: Assigning specific personas or expertise to Claude
  • Prefilling: Starting Claude's response to guide output format
  • Prompt Chaining: Breaking complex tasks into sequential prompts

3. Custom Instructions & System Prompts

  • System Prompt Design: Creating effective system prompts for specialized domains
  • Custom Instructions: Designing instructions for AI agents and skills
  • Behavioral Guidelines: Setting appropriate constraints and guidelines
  • Personality and Voice: Defining consistent tone and communication style
  • Scope Definition: Clearly defining what the agent should and shouldn't do

4. Prompt Optimization & Refinement

  • Performance Analysis: Evaluating prompt effectiveness and identifying issues
  • Iterative Improvement: Systematically refining prompts based on results
  • A/B Testing: Comparing different prompt variations
  • Consistency Enhancement: Improving reliability and reducing variability
  • Token Optimization: Reducing unnecessary tokens while maintaining quality

5. Anti-Patterns & Common Mistakes

  • Vagueness: Identifying and fixing unclear instructions
  • Contradictions: Detecting conflicting requirements
  • Over-Specification: Recognizing when prompts are too restrictive
  • Hallucination Risks: Identifying prompts prone to false information
  • Context Leakage: Preventing unintended information exposure
  • Jailbreak Vulnerabilities: Recognizing and mitigating prompt injection risks

6. Evaluation & Testing

  • Success Criteria Definition: Establishing clear metrics for prompt success
  • Test Case Development: Creating comprehensive test cases
  • Failure Analysis: Understanding why prompts fail
  • Regression Testing: Ensuring improvements don't break existing functionality
  • Edge Case Handling: Testing boundary conditions and unusual inputs

7. Multimodal & Advanced Prompting

  • Vision Prompting: Crafting prompts for image analysis and understanding
  • File-Based Prompting: Working with documents, PDFs, and structured data
  • Embeddings Integration: Using embeddings for semantic search and retrieval
  • Tool Use Prompting: Designing prompts that effectively use tools and APIs
  • Extended Thinking: Leveraging extended thinking for complex reasoning

Key Capabilities

  • Prompt Analysis: Reviewing existing prompts and identifying improvement opportunities
  • Prompt Generation: Creating new prompts from scratch for specific use cases
  • Prompt Refinement: Iteratively improving prompts based on performance
  • Custom Instruction Design: Creating specialized instructions for agents and skills
  • Best Practice Guidance: Providing expert advice on prompt engineering principles
  • Anti-Pattern Recognition: Identifying and correcting common mistakes
  • Testing Strategy: Developing evaluation frameworks for prompt validation
  • Documentation: Creating clear documentation for prompt usage and maintenance

Use Cases

  • Refining vague or ineffective prompts
  • Creating specialized system prompts for specific domains
  • Designing custom instructions for AI agents and skills
  • Optimizing prompts for consistency and reliability
  • Teaching prompt engineering best practices
  • Debugging prompt performance issues
  • Creating prompt templates for reusable workflows
  • Improving prompt efficiency and token usage
  • Developing evaluation frameworks for prompt testing

Skill Limitations

  • Does not execute code or run actual prompts (analysis only)
  • Cannot access real-time data or external APIs
  • Provides guidance based on best practices, not guaranteed results
  • Recommendations should be tested with actual use cases
  • Does not replace human judgment in critical applications

Integration Notes

This skill works well with:

  • Claude Code for testing and iterating on prompts
  • Agent SDK for implementing custom instructions
  • Files API for analyzing prompt documentation
  • Vision capabilities for multimodal prompt design
  • Extended thinking for complex prompt reasoning FILE:START_HERE.md

🎯 Prompt Engineering Expert Skill - Complete Package

✅ What Has Been Created

A comprehensive Claude Skill for prompt engineering expertise with:

📦 Complete Package Contents

  • 7 Core Documentation Files
  • 3 Specialized Guides (Best Practices, Techniques, Troubleshooting)
  • 10 Real-World Examples with before/after comparisons
  • Multiple Navigation Guides for easy access
  • Checklists and Templates for practical use

📍 Location

~/Documents/prompt-engineering-expert/

📋 File Inventory

Core Skill Files (4 files)

File Purpose Size
SKILL.md Skill metadata & overview ~1 KB
CLAUDE.md Main skill instructions ~3 KB
README.md User guide & getting started ~4 KB
GETTING_STARTED.md How to upload & use ~3 KB

Documentation (3 files)

File Purpose Coverage
docs/BEST_PRACTICES.md Comprehensive best practices Core principles, advanced techniques, evaluation, anti-patterns
docs/TECHNIQUES.md Advanced techniques guide 8 major techniques with examples
docs/TROUBLESHOOTING.md Problem solving 8 common issues + debugging workflow

Examples & Navigation (3 files)

File Purpose Content
examples/EXAMPLES.md Real-world examples 10 practical examples with templates
INDEX.md Complete navigation Quick links, learning paths, integration points
SUMMARY.md What was created Overview of all components

🎓 Expertise Covered

7 Core Expertise Areas

  1. ✅ Prompt Writing Best Practices - Clarity, structure, specificity
  2. ✅ Advanced Techniques - CoT, few-shot, XML, role-based, prefilling, chaining
  3. ✅ Custom Instructions - System prompts, behavioral guidelines, scope
  4. ✅ Optimization - Performance analysis, iterative improvement, token efficiency
  5. ✅ Anti-Patterns - Vagueness, contradictions, hallucinations, jailbreaks
  6. ✅ Evaluation - Success criteria, test cases, failure analysis
  7. ✅ Multimodal - Vision, files, embeddings, extended thinking

8 Key Capabilities

  1. ✅ Prompt Analysis
  2. ✅ Prompt Generation
  3. ✅ Prompt Refinement
  4. ✅ Custom Instruction Design
  5. ✅ Best Practice Guidance
  6. ✅ Anti-Pattern Recognition
  7. ✅ Testing Strategy
  8. ✅ Documentation

🚀 How to Use

Step 1: Upload the Skill

Go to Claude.com → Click "+" → Upload Skill → Select folder

Step 2: Ask Claude

"Review this prompt and suggest improvements:
[YOUR PROMPT]"

Step 3: Get Expert Guidance

Claude will analyze using the skill's expertise and provide recommendations.


📚 Documentation Breakdown

BEST_PRACTICES.md (~8 KB)

  • Core principles (clarity, conciseness, degrees of freedom)
  • Advanced techniques (8 techniques with explanations)
  • Custom instructions design
  • Skill structure best practices
  • Evaluation & testing frameworks
  • Anti-patterns to avoid
  • Workflows and feedback loops
  • Content guidelines
  • Multimodal prompting
  • Development workflow
  • Complete checklist

TECHNIQUES.md (~10 KB)

  • Chain-of-Thought prompting (with examples)
  • Few-Shot learning (1-shot, 2-shot, multi-shot)
  • Structured output with XML tags
  • Role-based prompting
  • Prefilling responses
  • Prompt chaining
  • Context management
  • Multimodal prompting
  • Combining techniques
  • Anti-patterns

TROUBLESHOOTING.md (~6 KB)

  • 8 common issues with solutions
  • Debugging workflow
  • Quick reference table
  • Testing checklist

EXAMPLES.md (~8 KB)

  • 10 real-world examples
  • Before/after comparisons
  • Templates and frameworks
  • Optimization checklists

💡 Key Features

✨ Comprehensive

  • Covers all major aspects of prompt engineering
  • From basics to advanced techniques
  • Real-world examples and templates

🎯 Practical

  • Actionable guidance
  • Step-by-step instructions
  • Ready-to-use templates

📖 Well-Organized

  • Clear structure with progressive disclosure
  • Multiple navigation guides
  • Quick reference tables

🔍 Detailed

  • 8 common issues with solutions
  • 10 real-world examples
  • Multiple checklists

🚀 Ready to Use

  • Can be uploaded immediately
  • No additional setup needed
  • Works with Claude.com and API

📊 Statistics

Metric Value
Total Files 10
Total Documentation ~40 KB
Core Expertise Areas 7
Key Capabilities 8
Use Cases 9
Common Issues Covered 8
Real-World Examples 10
Advanced Techniques 8
Best Practices 50+
Anti-Patterns 10+

🎯 Use Cases

1. Refining Vague Prompts

Transform unclear prompts into specific, actionable ones.

2. Creating Specialized Prompts

Design prompts for specific domains or tasks.

3. Designing Agent Instructions

Create custom instructions for AI agents and skills.

4. Optimizing for Consistency

Improve reliability and reduce variability.

5. Teaching Best Practices

Learn prompt engineering principles and techniques.

6. Debugging Prompt Issues

Identify and fix problems with existing prompts.

7. Building Evaluation Frameworks

Develop test cases and success criteria.

8. Multimodal Prompting

Design prompts for vision, embeddings, and files.

9. Creating Prompt Templates

Build reusable prompt templates for workflows.


✅ Quality Checklist

  • ✅ Based on official Anthropic documentation
  • ✅ Comprehensive coverage of prompt engineering
  • ✅ Real-world examples and templates
  • ✅ Clear, well-organized structure
  • ✅ Progressive disclosure for learning
  • ✅ Multiple navigation guides
  • ✅ Practical, actionable guidance
  • ✅ Troubleshooting and debugging help
  • ✅ Best practices and anti-patterns
  • ✅ Ready to upload and use

🔗 Integration Points

Works seamlessly with:

  • Claude.com - Upload and use directly
  • Claude Code - For testing prompts
  • Agent SDK - For programmatic use
  • Files API - For analyzing documentation
  • Vision - For multimodal design
  • Extended Thinking - For complex reasoning

📖 Learning Paths

Beginner (1-2 hours)

  1. Read: README.md
  2. Read: BEST_PRACTICES.md (Core Principles)
  3. Review: EXAMPLES.md (Examples 1-3)
  4. Try: Create a simple prompt

Intermediate (2-4 hours)

  1. Read: TECHNIQUES.md (Sections 1-4)
  2. Review: EXAMPLES.md (Examples 4-7)
  3. Read: TROUBLESHOOTING.md
  4. Try: Refine an existing prompt

Advanced (4+ hours)

  1. Read: TECHNIQUES.md (All sections)
  2. Review: EXAMPLES.md (All examples)
  3. Read: BEST_PRACTICES.md (All sections)
  4. Try: Combine multiple techniques

🎁 What You Get

Immediate Benefits

  • Expert prompt engineering guidance
  • Real-world examples and templates
  • Troubleshooting help
  • Best practices reference
  • Anti-pattern recognition

Long-Term Benefits

  • Improved prompt quality
  • Faster iteration cycles
  • Better consistency
  • Reduced token usage
  • More effective AI interactions

🚀 Next Steps

  1. Navigate to the folder

    ~/Documents/prompt-engineering-expert/
    
  2. Upload the skill to Claude.com

    • Click "+" → Upload Skill → Select folder
  3. Start using it

    • Ask Claude to review your prompts
    • Request custom instructions
    • Get troubleshooting help
  4. Explore the documentation

    • Start with README.md
    • Review examples
    • Learn advanced techniques
  5. Share with your team

    • Collaborate on prompt engineering
    • Build better prompts together
    • Improve AI interactions

📞 Support Resources

Within the Skill

  • Comprehensive documentation
  • Real-world examples
  • Troubleshooting guides
  • Best practice checklists
  • Quick reference tables

External Resources


🎉 You're All Set!

Your Prompt Engineering Expert Skill is complete and ready to use!

Quick Start

  1. Open ~/Documents/prompt-engineering-expert/
  2. Read GETTING_STARTED.md for upload instructions
  3. Upload to Claude.com
  4. Start improving your prompts! FILE:README.md

README - Prompt Engineering Expert Skill

Overview

The Prompt Engineering Expert skill equips Claude with deep expertise in prompt engineering, custom instructions design, and prompt optimization. This comprehensive skill provides guidance on crafting effective AI prompts, designing agent instructions, and iteratively improving prompt performance.

What This Skill Provides

Core Expertise

  • Prompt Writing Best Practices: Clear, direct prompts with proper structure
  • Advanced Techniques: Chain-of-thought, few-shot prompting, XML tags, role-based prompting
  • Custom Instructions: System prompts and agent instructions design
  • Optimization: Analyzing and refining existing prompts
  • Evaluation: Testing frameworks and success criteria
  • Anti-Patterns: Identifying and correcting common mistakes
  • Multimodal: Vision, embeddings, and file-based prompting

Key Capabilities

  1. Prompt Analysis

    • Review existing prompts
    • Identify improvement opportunities
    • Spot anti-patterns and issues
    • Suggest specific refinements
  2. Prompt Generation

    • Create new prompts from scratch
    • Design for specific use cases
    • Ensure clarity and effectiveness
    • Optimize for consistency
  3. Custom Instructions

    • Design system prompts
    • Create agent instructions
    • Define behavioral guidelines
    • Set appropriate constraints
  4. Best Practice Guidance

    • Explain prompt engineering principles
    • Teach advanced techniques
    • Share real-world examples
    • Provide implementation guidance
  5. Testing & Validation

    • Develop test cases
    • Define success criteria
    • Evaluate prompt performance
    • Identify edge cases

How to Use This Skill

For Prompt Analysis

"Review this prompt and suggest improvements:
[YOUR PROMPT]

Focus on: clarity, specificity, format, and consistency."

For Prompt Generation

"Create a prompt that:
- [Requirement 1]
- [Requirement 2]
- [Requirement 3]

The prompt should handle [use cases]."

For Custom Instructions

"Design custom instructions for an agent that:
- [Role/expertise]
- [Key responsibilities]
- [Behavioral guidelines]"

For Troubleshooting

"This prompt isn't working well:
[PROMPT]

Issues: [DESCRIBE ISSUES]

How can I fix it?"

Skill Structure

prompt-engineering-expert/
├── SKILL.md                 # Skill metadata
├── CLAUDE.md               # Main instructions
├── README.md               # This file
├── docs/
│   ├── BEST_PRACTICES.md   # Best practices guide
│   ├── TECHNIQUES.md       # Advanced techniques
│   └── TROUBLESHOOTING.md  # Common issues & fixes
└── examples/
    └── EXAMPLES.md         # Real-world examples

Key Concepts

Clarity

  • Explicit objectives
  • Precise language
  • Concrete examples
  • Logical structure

Conciseness

  • Focused content
  • No redundancy
  • Progressive disclosure
  • Token efficiency

Consistency

  • Defined constraints
  • Specified format
  • Clear guidelines
  • Repeatable results

Completeness

  • Sufficient context
  • Edge case handling
  • Success criteria
  • Error handling

Common Use Cases

1. Refining Vague Prompts

Transform unclear prompts into specific, actionable ones.

2. Creating Specialized Prompts

Design prompts for specific domains or tasks.

3. Designing Agent Instructions

Create custom instructions for AI agents and skills.

4. Optimizing for Consistency

Improve reliability and reduce variability.

5. Debugging Prompt Issues

Identify and fix problems with existing prompts.

6. Teaching Best Practices

Learn prompt engineering principles and techniques.

7. Building Evaluation Frameworks

Develop test cases and success criteria.

8. Multimodal Prompting

Design prompts for vision, embeddings, and files.

Best Practices Summary

Do's ✅

  • Be clear and specific
  • Provide examples
  • Specify format
  • Define constraints
  • Test thoroughly
  • Document assumptions
  • Use progressive disclosure
  • Handle edge cases

Don'ts ❌

  • Be vague or ambiguous
  • Assume understanding
  • Skip format specification
  • Ignore edge cases
  • Over-specify constraints
  • Use jargon without explanation
  • Hardcode values
  • Ignore error handling

Advanced Topics

Chain-of-Thought Prompting

Encourage step-by-step reasoning for complex tasks.

Few-Shot Learning

Use examples to guide behavior without explicit instructions.

Structured Output

Use XML tags for clarity and parsing.

Role-Based Prompting

Assign expertise to guide behavior.

Prompt Chaining

Break complex tasks into sequential prompts.

Context Management

Optimize token usage and clarity.

Multimodal Integration

Work with images, files, and embeddings.

Limitations

  • Analysis Only: Doesn't execute code or run actual prompts
  • No Real-Time Data: Can't access external APIs or current data
  • Best Practices Based: Recommendations based on established patterns
  • Testing Required: Suggestions should be validated with actual use cases
  • Human Judgment: Doesn't replace human expertise in critical applications

Integration with Other Skills

This skill works well with:

  • Claude Code: For testing and iterating on prompts
  • Agent SDK: For implementing custom instructions
  • Files API: For analyzing prompt documentation
  • Vision: For multimodal prompt design
  • Extended Thinking: For complex prompt reasoning

Getting Started

Quick Start

  1. Share your prompt or describe your need
  2. Receive analysis and recommendations
  3. Implement suggested improvements
  4. Test and validate
  5. Iterate as needed

For Beginners

  • Start with "BEST_PRACTICES.md"
  • Review "EXAMPLES.md" for real-world cases
  • Try simple prompts first
  • Gradually increase complexity

For Advanced Users

  • Explore "TECHNIQUES.md" for advanced methods
  • Review "TROUBLESHOOTING.md" for edge cases
  • Combine multiple techniques
  • Build custom frameworks

Documentation

Main Documents

  • BEST_PRACTICES.md: Comprehensive best practices guide
  • TECHNIQUES.md: Advanced prompt engineering techniques
  • TROUBLESHOOTING.md: Common issues and solutions
  • EXAMPLES.md: Real-world examples and templates

Quick References

  • Naming conventions
  • File structure
  • YAML frontmatter
  • Token budgets
  • Checklists

Support & Resources

Within This Skill

  • Detailed documentation
  • Real-world examples
  • Troubleshooting guides
  • Best practice checklists
  • Quick reference tables

External Resources

Version History

v1.0 (Current)

  • Initial release
  • Core expertise areas
  • Best practices documentation
  • Advanced techniques guide
  • Troubleshooting guide
  • Real-world examples

Contributing

This skill is designed to evolve. Feedback and suggestions for improvement are welcome.

License

This skill is provided as part of the Claude ecosystem.


Quick Links


Ready to improve your prompts? Start by sharing your current prompt or describing what you need help with! FILE:SUMMARY.md

Prompt Engineering Expert Skill - Summary

What Was Created

A comprehensive Claude Skill for prompt engineering expertise with deep knowledge of:

  • Prompt writing best practices
  • Custom instructions design
  • Prompt optimization and refinement
  • Advanced techniques (CoT, few-shot, XML tags, etc.)
  • Evaluation frameworks and testing
  • Anti-pattern recognition
  • Multimodal prompting

Skill Structure

~/Documents/prompt-engineering-expert/
├── SKILL.md                    # Skill metadata & overview
├── CLAUDE.md                   # Main skill instructions
├── README.md                   # User guide & getting started
├── docs/
│   ├── BEST_PRACTICES.md       # Comprehensive best practices (from official docs)
│   ├── TECHNIQUES.md           # Advanced techniques guide
│   └── TROUBLESHOOTING.md      # Common issues & solutions
└── examples/
    └── EXAMPLES.md             # 10 real-world examples & templates

Key Files

1. SKILL.md (Overview)

  • High-level description
  • Key capabilities
  • Use cases
  • Limitations

2. CLAUDE.md (Main Instructions)

  • Core expertise areas (7 major areas)
  • Key capabilities (8 capabilities)
  • Use cases (9 use cases)
  • Skill limitations
  • Integration notes

3. README.md (User Guide)

  • Overview and what's provided
  • How to use the skill
  • Skill structure
  • Key concepts
  • Common use cases
  • Best practices summary
  • Getting started guide

4. docs/BEST_PRACTICES.md (Best Practices)

  • Core principles (clarity, conciseness, degrees of freedom)
  • Advanced techniques (CoT, few-shot, XML, role-based, prefilling, chaining)
  • Custom instructions design
  • Skill structure best practices
  • Evaluation & testing
  • Anti-patterns to avoid
  • Workflows and feedback loops
  • Content guidelines
  • Multimodal prompting
  • Development workflow
  • Comprehensive checklist

5. docs/TECHNIQUES.md (Advanced Techniques)

  • Chain-of-Thought prompting (with examples)
  • Few-Shot learning (1-shot, 2-shot, multi-shot)
  • Structured output with XML tags
  • Role-based prompting
  • Prefilling responses
  • Prompt chaining
  • Context management
  • Multimodal prompting
  • Combining techniques
  • Anti-patterns

6. docs/TROUBLESHOOTING.md (Troubleshooting)

  • 8 common issues with solutions:
    1. Inconsistent outputs
    2. Hallucinations
    3. Vague responses
    4. Wrong length
    5. Wrong format
    6. Refuses to respond
    7. Prompt too long
    8. Doesn't generalize
  • Debugging workflow
  • Quick reference table
  • Testing checklist

7. examples/EXAMPLES.md (Real-World Examples)

  • 10 practical examples:
    1. Refining vague prompts
    2. Custom instructions for agents
    3. Few-shot classification
    4. Chain-of-thought analysis
    5. XML-structured prompts
    6. Iterative refinement
    7. Anti-pattern recognition
    8. Testing framework
    9. Skill metadata template
    10. Optimization checklist

Core Expertise Areas

  1. Prompt Writing Best Practices

    • Clarity and directness
    • Structure and formatting
    • Specificity
    • Context management
    • Tone and style
  2. Advanced Prompt Engineering Techniques

    • Chain-of-Thought (CoT) prompting
    • Few-Shot prompting
    • XML tags
    • Role-based prompting
    • Prefilling
    • Prompt chaining
  3. Custom Instructions & System Prompts

    • System prompt design
    • Custom instructions
    • Behavioral guidelines
    • Personality and voice
    • Scope definition
  4. Prompt Optimization & Refinement

    • Performance analysis
    • Iterative improvement
    • A/B testing
    • Consistency enhancement
    • Token optimization
  5. Anti-Patterns & Common Mistakes

    • Vagueness
    • Contradictions
    • Over-specification
    • Hallucination risks
    • Context leakage
    • Jailbreak vulnerabilities
  6. Evaluation & Testing

    • Success criteria definition
    • Test case development
    • Failure analysis
    • Regression testing
    • Edge case handling
  7. Multimodal & Advanced Prompting

    • Vision prompting
    • File-based prompting
    • Embeddings integration
    • Tool use prompting
    • Extended thinking

Key Capabilities

  1. Prompt Analysis - Review and improve existing prompts
  2. Prompt Generation - Create new prompts from scratch
  3. Prompt Refinement - Iteratively improve prompts
  4. Custom Instruction Design - Create specialized instructions
  5. Best Practice Guidance - Teach prompt engineering principles
  6. Anti-Pattern Recognition - Identify and correct mistakes
  7. Testing Strategy - Develop evaluation frameworks
  8. Documentation - Create clear usage documentation

How to Use This Skill

For Prompt Analysis

"Review this prompt and suggest improvements:
[YOUR PROMPT]"

For Prompt Generation

"Create a prompt that:
- [Requirement 1]
- [Requirement 2]
- [Requirement 3]"

For Custom Instructions

"Design custom instructions for an agent that:
- [Role/expertise]
- [Key responsibilities]"

For Troubleshooting

"This prompt isn't working:
[PROMPT]

Issues: [DESCRIBE ISSUES]

How can I fix it?"

Best Practices Included

Do's ✅

  • Be clear and specific
  • Provide examples
  • Specify format
  • Define constraints
  • Test thoroughly
  • Document assumptions
  • Use progressive disclosure
  • Handle edge cases

Don'ts ❌

  • Be vague or ambiguous
  • Assume understanding
  • Skip format specification
  • Ignore edge cases
  • Over-specify constraints
  • Use jargon without explanation
  • Hardcode values
  • Ignore error handling

Documentation Quality

  • Comprehensive: Covers all major aspects of prompt engineering
  • Practical: Includes real-world examples and templates
  • Well-Organized: Clear structure with progressive disclosure
  • Actionable: Specific guidance with step-by-step instructions
  • Tested: Based on official Anthropic documentation
  • Reusable: Templates and checklists for common tasks

Integration Points

Works well with:

  • Claude Code (for testing prompts)
  • Agent SDK (for implementing instructions)
  • Files API (for analyzing documentation)
  • Vision capabilities (for multimodal design)
  • Extended thinking (for complex reasoning)

Next Steps

  1. Upload the skill to Claude using the Skills API or Claude Code
  2. Test with sample prompts to verify functionality
  3. Iterate based on feedback to refine and improve
  4. Share with team for collaborative prompt engineering
  5. Extend as needed with domain-specific examples FILE:INDEX.md

Prompt Engineering Expert Skill - Complete Index

📋 Quick Navigation

Getting Started

  • README.md - Start here! Overview, how to use, and quick start guide
  • SUMMARY.md - What was created and how to use it

Core Skill Files

  • SKILL.md - Skill metadata and capabilities overview
  • CLAUDE.md - Main skill instructions and expertise areas

Documentation

Examples & Templates


📚 What's Included

Expertise Areas (7 Major Areas)

  1. Prompt Writing Best Practices
  2. Advanced Prompt Engineering Techniques
  3. Custom Instructions & System Prompts
  4. Prompt Optimization & Refinement
  5. Anti-Patterns & Common Mistakes
  6. Evaluation & Testing
  7. Multimodal & Advanced Prompting

Key Capabilities (8 Capabilities)

  1. Prompt Analysis
  2. Prompt Generation
  3. Prompt Refinement
  4. Custom Instruction Design
  5. Best Practice Guidance
  6. Anti-Pattern Recognition
  7. Testing Strategy
  8. Documentation

Use Cases (9 Use Cases)

  1. Refining vague or ineffective prompts
  2. Creating specialized system prompts
  3. Designing custom instructions for agents
  4. Optimizing for consistency and reliability
  5. Teaching prompt engineering best practices
  6. Debugging prompt performance issues
  7. Creating prompt templates for workflows
  8. Improving efficiency and token usage
  9. Developing evaluation frameworks

🎯 How to Use This Skill

For Prompt Analysis

"Review this prompt and suggest improvements:
[YOUR PROMPT]

Focus on: clarity, specificity, format, and consistency."

For Prompt Generation

"Create a prompt that:
- [Requirement 1]
- [Requirement 2]
- [Requirement 3]

The prompt should handle [use cases]."

For Custom Instructions

"Design custom instructions for an agent that:
- [Role/expertise]
- [Key responsibilities]
- [Behavioral guidelines]"

For Troubleshooting

"This prompt isn't working well:
[PROMPT]

Issues: [DESCRIBE ISSUES]

How can I fix it?"

📖 Documentation Structure

BEST_PRACTICES.md (Comprehensive Guide)

  • Core principles (clarity, conciseness, degrees of freedom)
  • Advanced techniques (CoT, few-shot, XML, role-based, prefilling, chaining)
  • Custom instructions design
  • Skill structure best practices
  • Evaluation & testing frameworks
  • Anti-patterns to avoid
  • Workflows and feedback loops
  • Content guidelines
  • Multimodal prompting
  • Development workflow
  • Complete checklist

TECHNIQUES.md (Advanced Methods)

  • Chain-of-Thought prompting with examples
  • Few-Shot learning (1-shot, 2-shot, multi-shot)
  • Structured output with XML tags
  • Role-based prompting
  • Prefilling responses
  • Prompt chaining
  • Context management
  • Multimodal prompting
  • Combining techniques
  • Anti-patterns

TROUBLESHOOTING.md (Problem Solving)

  • 8 common issues with solutions
  • Debugging workflow
  • Quick reference table
  • Testing checklist

EXAMPLES.md (Real-World Cases)

  • 10 practical examples
  • Before/after comparisons
  • Templates and frameworks
  • Optimization checklists

✅ Best Practices Summary

Do's ✅

  • Be clear and specific
  • Provide examples
  • Specify format
  • Define constraints
  • Test thoroughly
  • Document assumptions
  • Use progressive disclosure
  • Handle edge cases

Don'ts ❌

  • Be vague or ambiguous
  • Assume understanding
  • Skip format specification
  • Ignore edge cases
  • Over-specify constraints
  • Use jargon without explanation
  • Hardcode values
  • Ignore error handling

🚀 Getting Started

Step 1: Read the Overview

Start with README.md to understand what this skill provides.

Step 2: Learn Best Practices

Review docs/BEST_PRACTICES.md for foundational knowledge.

Step 3: Explore Examples

Check examples/EXAMPLES.md for real-world use cases.

Step 4: Try It Out

Share your prompt or describe your need to get started.

Step 5: Troubleshoot

Use docs/TROUBLESHOOTING.md if you encounter issues.


🔧 Advanced Topics

Chain-of-Thought Prompting

Encourage step-by-step reasoning for complex tasks. → See: TECHNIQUES.md, Section 1

Few-Shot Learning

Use examples to guide behavior without explicit instructions. → See: TECHNIQUES.md, Section 2

Structured Output

Use XML tags for clarity and parsing. → See: TECHNIQUES.md, Section 3

Role-Based Prompting

Assign expertise to guide behavior. → See: TECHNIQUES.md, Section 4

Prompt Chaining

Break complex tasks into sequential prompts. → See: TECHNIQUES.md, Section 6

Context Management

Optimize token usage and clarity. → See: TECHNIQUES.md, Section 7

Multimodal Integration

Work with images, files, and embeddings. → See: TECHNIQUES.md, Section 8


📊 File Structure

prompt-engineering-expert/
├── INDEX.md                    # This file
├── SUMMARY.md                  # What was created
├── README.md                   # User guide & getting started
├── SKILL.md                    # Skill metadata
├── CLAUDE.md                   # Main instructions
├── docs/
│   ├── BEST_PRACTICES.md       # Best practices guide
│   ├── TECHNIQUES.md           # Advanced techniques
│   └── TROUBLESHOOTING.md      # Common issues & solutions
└── examples/
    └── EXAMPLES.md             # Real-world examples

🎓 Learning Path

Beginner

  1. Read: README.md
  2. Read: BEST_PRACTICES.md (Core Principles section)
  3. Review: EXAMPLES.md (Examples 1-3)
  4. Try: Create a simple prompt

Intermediate

  1. Read: TECHNIQUES.md (Sections 1-4)
  2. Review: EXAMPLES.md (Examples 4-7)
  3. Read: TROUBLESHOOTING.md
  4. Try: Refine an existing prompt

Advanced

  1. Read: TECHNIQUES.md (Sections 5-8)
  2. Review: EXAMPLES.md (Examples 8-10)
  3. Read: BEST_PRACTICES.md (Advanced sections)
  4. Try: Combine multiple techniques

🔗 Integration Points

This skill works well with:

  • Claude Code - For testing and iterating on prompts
  • Agent SDK - For implementing custom instructions
  • Files API - For analyzing prompt documentation
  • Vision - For multimodal prompt design
  • Extended Thinking - For complex prompt reasoning

📝 Key Concepts

Clarity

  • Explicit objectives
  • Precise language
  • Concrete examples
  • Logical structure

Conciseness

  • Focused content
  • No redundancy
  • Progressive disclosure
  • Token efficiency

Consistency

  • Defined constraints
  • Specified format
  • Clear guidelines
  • Repeatable results

Completeness

  • Sufficient context
  • Edge case handling
  • Success criteria
  • Error handling

⚠️ Limitations

  • Analysis Only: Doesn't execute code or run actual prompts
  • No Real-Time Data: Can't access external APIs or current data
  • Best Practices Based: Recommendations based on established patterns
  • Testing Required: Suggestions should be validated with actual use cases
  • Human Judgment: Doesn't replace human expertise in critical applications

🎯 Common Use Cases

1. Refining Vague Prompts

Transform unclear prompts into specific, actionable ones. → See: EXAMPLES.md, Example 1

2. Creating Specialized Prompts

Design prompts for specific domains or tasks. → See: EXAMPLES.md, Example 2

3. Designing Agent Instructions

Create custom instructions for AI agents and skills. → See: EXAMPLES.md, Example 2

4. Optimizing for Consistency

Improve reliability and reduce variability. → See: BEST_PRACTICES.md, Skill Structure section

5. Debugging Prompt Issues

Identify and fix problems with existing prompts. → See: TROUBLESHOOTING.md

6. Teaching Best Practices

Learn prompt engineering principles and techniques. → See: BEST_PRACTICES.md, TECHNIQUES.md

7. Building Evaluation Frameworks

Develop test cases and success criteria. → See: BEST_PRACTICES.md, Evaluation & Testing section

8. Multimodal Prompting

Design prompts for vision, embeddings, and files. → See: TECHNIQUES.md, Section 8


📞 Support & Resources

Within This Skill

  • Detailed documentation
  • Real-world examples
  • Troubleshooting guides
  • Best practice checklists
  • Quick reference tables

External Resources


🚀 Next Steps

  1. Explore the documentation - Start with README.md
  2. Review examples - Check examples/EXAMPLES.md
  3. Try it out - Share your prompt or describe your need
  4. Iterate - Use feedback to improve
  5. Share - Help others with their prompts FILE:BEST_PRACTICES.md

Prompt Engineering Expert - Best Practices Guide

This document synthesizes best practices from Anthropic's official documentation and the Claude Cookbooks to create a comprehensive prompt engineering skill.

Core Principles for Prompt Engineering

1. Clarity and Directness

  • Be explicit: State exactly what you want Claude to do
  • Avoid ambiguity: Use precise language that leaves no room for misinterpretation
  • Use concrete examples: Show, don't just tell
  • Structure logically: Organize information hierarchically

2. Conciseness

  • Respect context windows: Keep prompts focused and relevant
  • Remove redundancy: Eliminate unnecessary repetition
  • Progressive disclosure: Provide details only when needed
  • Token efficiency: Optimize for both quality and cost

3. Appropriate Degrees of Freedom

  • Define constraints: Set clear boundaries for what Claude should/shouldn't do
  • Specify format: Be explicit about desired output format
  • Set scope: Clearly define what's in and out of scope
  • Balance flexibility: Allow room for Claude's reasoning while maintaining control

Advanced Prompt Engineering Techniques

Chain-of-Thought (CoT) Prompting

Encourage step-by-step reasoning for complex tasks:

"Let's think through this step by step:
1. First, identify...
2. Then, analyze...
3. Finally, conclude..."

Few-Shot Prompting

Use examples to guide behavior:

  • 1-shot: Single example for simple tasks
  • 2-shot: Two examples for moderate complexity
  • Multi-shot: Multiple examples for complex patterns

XML Tags for Structure

Use XML tags for clarity and parsing:

<task>
  <objective>What you want done</objective>
  <constraints>Limitations and rules</constraints>
  <format>Expected output format</format>
</task>

Role-Based Prompting

Assign expertise to Claude:

"You are an expert prompt engineer with deep knowledge of...
Your task is to..."

Prefilling

Start Claude's response to guide format:

"Here's my analysis:

Key findings:"

Prompt Chaining

Break complex tasks into sequential prompts:

  1. Prompt 1: Analyze input
  2. Prompt 2: Process analysis
  3. Prompt 3: Generate output

Custom Instructions & System Prompts

System Prompt Design

  • Define role: What expertise should Claude embody?
  • Set tone: What communication style is appropriate?
  • Establish constraints: What should Claude avoid?
  • Clarify scope: What's the domain of expertise?

Behavioral Guidelines

  • Do's: Specific behaviors to encourage
  • Don'ts: Specific behaviors to avoid
  • Edge cases: How to handle unusual situations
  • Escalation: When to ask for clarification

Skill Structure Best Practices

Naming Conventions

  • Use gerund form (verb + -ing): "analyzing-financial-statements"
  • Use lowercase with hyphens: "prompt-engineering-expert"
  • Be descriptive: Name should indicate capability
  • Avoid generic names: Be specific about domain

Writing Effective Descriptions

  • First line: Clear, concise summary (max 1024 chars)
  • Specificity: Indicate exact capabilities
  • Use cases: Mention primary applications
  • Avoid vagueness: Don't use "helps with" or "assists in"

Progressive Disclosure Patterns

Pattern 1: High-level guide with references

  • Start with overview
  • Link to detailed sections
  • Organize by complexity

Pattern 2: Domain-specific organization

  • Group by use case
  • Separate concerns
  • Clear navigation

Pattern 3: Conditional details

  • Show details based on context
  • Provide examples for each path
  • Avoid overwhelming options

File Structure

skill-name/
├── SKILL.md (required metadata)
├── CLAUDE.md (main instructions)
├── reference-guide.md (detailed info)
├── examples.md (use cases)
└── troubleshooting.md (common issues)

Evaluation & Testing

Success Criteria Definition

  • Measurable: Define what "success" looks like
  • Specific: Avoid vague metrics
  • Testable: Can be verified objectively
  • Realistic: Achievable with the prompt

Test Case Development

  • Happy path: Normal, expected usage
  • Edge cases: Boundary conditions
  • Error cases: Invalid inputs
  • Stress tests: Complex scenarios

Failure Analysis

  • Why did it fail?: Root cause analysis
  • Pattern recognition: Identify systematic issues
  • Refinement: Adjust prompt accordingly

Anti-Patterns to Avoid

Common Mistakes

  • Vagueness: "Help me with this task" (too vague)
  • Contradictions: Conflicting requirements
  • Over-specification: Too many constraints
  • Hallucination risks: Prompts that encourage false information
  • Context leakage: Unintended information exposure
  • Jailbreak vulnerabilities: Prompts susceptible to manipulation

Windows-Style Paths

  • ❌ Use: C:\Users\Documents\file.txt
  • ✅ Use: /Users/Documents/file.txt or ~/Documents/file.txt

Too Many Options

  • Avoid offering 10+ choices
  • Limit to 3-5 clear alternatives
  • Use progressive disclosure for complex options

Workflows and Feedback Loops

Use Workflows for Complex Tasks

  • Break into logical steps
  • Define inputs/outputs for each step
  • Implement feedback mechanisms
  • Allow for iteration

Implement Feedback Loops

  • Request clarification when needed
  • Validate intermediate results
  • Adjust based on feedback
  • Confirm understanding

Content Guidelines

Avoid Time-Sensitive Information

  • Don't hardcode dates
  • Use relative references ("current year")
  • Provide update mechanisms
  • Document when information was current

Use Consistent Terminology

  • Define key terms once
  • Use consistently throughout
  • Avoid synonyms for same concept
  • Create glossary for complex domains

Multimodal & Advanced Prompting

Vision Prompting

  • Describe what Claude should analyze
  • Specify output format
  • Provide context about images
  • Ask for specific details

File-Based Prompting

  • Specify file types accepted
  • Describe expected structure
  • Provide parsing instructions
  • Handle errors gracefully

Extended Thinking

  • Use for complex reasoning
  • Allow more processing time
  • Request detailed explanations
  • Leverage for novel problems

Skill Development Workflow

Build Evaluations First

  1. Define success criteria
  2. Create test cases
  3. Establish baseline
  4. Measure improvements

Develop Iteratively with Claude

  1. Start with simple version
  2. Test and gather feedback
  3. Refine based on results
  4. Repeat until satisfied

Observe How Claude Navigates Skills

  • Watch how Claude discovers content
  • Note which sections are used
  • Identify confusing areas
  • Optimize based on usage patterns

YAML Frontmatter Requirements

---
name: skill-name
description: Clear, concise description (max 1024 chars)
---

Token Budget Considerations

  • Skill metadata: ~100-200 tokens
  • Main instructions: ~500-1000 tokens
  • Reference files: ~1000-5000 tokens each
  • Examples: ~500-1000 tokens each
  • Total budget: Varies by use case

Checklist for Effective Skills

Core Quality

  • Clear, specific name (gerund form)
  • Concise description (1-2 sentences)
  • Well-organized structure
  • Progressive disclosure implemented
  • Consistent terminology
  • No time-sensitive information

Content

  • Clear use cases defined
  • Examples provided
  • Edge cases documented
  • Limitations stated
  • Troubleshooting guide included

Testing

  • Test cases created
  • Success criteria defined
  • Edge cases tested
  • Error handling verified
  • Multiple models tested

Documentation

  • README or overview
  • Usage examples
  • API/integration notes
  • Troubleshooting section
  • Update mechanism documented FILE:TECHNIQUES.md

Advanced Prompt Engineering Techniques

Table of Contents

  1. Chain-of-Thought Prompting
  2. Few-Shot Learning
  3. Structured Output with XML
  4. Role-Based Prompting
  5. Prefilling Responses
  6. Prompt Chaining
  7. Context Management
  8. Multimodal Prompting

1. Chain-of-Thought (CoT) Prompting

What It Is

Encouraging Claude to break down complex reasoning into explicit steps before providing a final answer.

When to Use

  • Complex reasoning tasks
  • Multi-step problems
  • Tasks requiring justification
  • When consistency matters

Basic Structure

Let's think through this step by step:

Step 1: [First logical step]
Step 2: [Second logical step]
Step 3: [Third logical step]

Therefore: [Conclusion]

Example

Problem: A store sells apples for $2 each and oranges for $3 each. 
If I buy 5 apples and 3 oranges, how much do I spend?

Let's think through this step by step:

Step 1: Calculate apple cost
- 5 apples × $2 per apple = $10

Step 2: Calculate orange cost
- 3 oranges × $3 per orange = $9

Step 3: Calculate total
- $10 + $9 = $19

Therefore: You spend $19 total.

Benefits

  • More accurate reasoning
  • Easier to identify errors
  • Better for complex problems
  • More transparent logic

2. Few-Shot Learning

What It Is

Providing examples to guide Claude's behavior without explicit instructions.

Types

1-Shot (Single Example)

Best for: Simple, straightforward tasks

Example: "Happy" → Positive
Now classify: "Terrible" →

2-Shot (Two Examples)

Best for: Moderate complexity

Example 1: "Great product!" → Positive
Example 2: "Doesn't work well" → Negative
Now classify: "It's okay" →

Multi-Shot (Multiple Examples)

Best for: Complex patterns, edge cases

Example 1: "Love it!" → Positive
Example 2: "Hate it" → Negative
Example 3: "It's fine" → Neutral
Example 4: "Could be better" → Neutral
Example 5: "Amazing!" → Positive
Now classify: "Not bad" →

Best Practices

  • Use diverse examples
  • Include edge cases
  • Show correct format
  • Order by complexity
  • Use realistic examples

3. Structured Output with XML Tags

What It Is

Using XML tags to structure prompts and guide output format.

Benefits

  • Clear structure
  • Easy parsing
  • Reduced ambiguity
  • Better organization

Common Patterns

Task Definition

<task>
  <objective>What to accomplish</objective>
  <constraints>Limitations and rules</constraints>
  <format>Expected output format</format>
</task>

Analysis Structure

<analysis>
  <problem>Define the problem</problem>
  <context>Relevant background</context>
  <solution>Proposed solution</solution>
  <justification>Why this solution</justification>
</analysis>

Conditional Logic

<instructions>
  <if condition="input_type == 'question'">
    <then>Provide detailed answer</then>
  </if>
  <if condition="input_type == 'request'">
    <then>Fulfill the request</then>
  </if>
</instructions>

4. Role-Based Prompting

What It Is

Assigning Claude a specific role or expertise to guide behavior.

Structure

You are a [ROLE] with expertise in [DOMAIN].

Your responsibilities:
- [Responsibility 1]
- [Responsibility 2]
- [Responsibility 3]

When responding:
- [Guideline 1]
- [Guideline 2]
- [Guideline 3]

Your task: [Specific task]

Examples

Expert Consultant

You are a senior management consultant with 20 years of experience 
in business strategy and organizational transformation.

Your task: Analyze this company's challenges and recommend solutions.

Technical Architect

You are a cloud infrastructure architect specializing in scalable systems.

Your task: Design a system architecture for [requirements].

Creative Director

You are a creative director with expertise in brand storytelling and 
visual communication.

Your task: Develop a brand narrative for [product/company].

5. Prefilling Responses

What It Is

Starting Claude's response to guide format and tone.

Benefits

  • Ensures correct format
  • Sets tone and style
  • Guides reasoning
  • Improves consistency

Examples

Structured Analysis

Prompt: Analyze this market opportunity.

Claude's response should start:
"Here's my analysis of this market opportunity:

Market Size: [Analysis]
Growth Potential: [Analysis]
Competitive Landscape: [Analysis]"

Step-by-Step Reasoning

Prompt: Solve this problem.

Claude's response should start:
"Let me work through this systematically:

1. First, I'll identify the key variables...
2. Then, I'll analyze the relationships...
3. Finally, I'll derive the solution..."

Formatted Output

Prompt: Create a project plan.

Claude's response should start:
"Here's the project plan:

Phase 1: Planning
- Task 1.1: [Description]
- Task 1.2: [Description]

Phase 2: Execution
- Task 2.1: [Description]"

6. Prompt Chaining

What It Is

Breaking complex tasks into sequential prompts, using outputs as inputs.

Structure

Prompt 1: Analyze/Extract
↓
Output 1: Structured data
↓
Prompt 2: Process/Transform
↓
Output 2: Processed data
↓
Prompt 3: Generate/Synthesize
↓
Final Output: Result

Example: Document Analysis Pipeline

Prompt 1: Extract Information

Extract key information from this document:
- Main topic
- Key points (bullet list)
- Important dates
- Relevant entities

Format as JSON.

Prompt 2: Analyze Extracted Data

Analyze this extracted information:
[JSON from Prompt 1]

Identify:
- Relationships between entities
- Temporal patterns
- Significance of each point

Prompt 3: Generate Summary

Based on this analysis:
[Analysis from Prompt 2]

Create an executive summary that:
- Explains the main findings
- Highlights key insights
- Recommends next steps

7. Context Management

What It Is

Strategically managing information to optimize token usage and clarity.

Techniques

Progressive Disclosure

Start with: High-level overview
Then provide: Relevant details
Finally include: Edge cases and exceptions

Hierarchical Organization

Level 1: Core concept
├── Level 2: Key components
│   ├── Level 3: Specific details
│   └── Level 3: Implementation notes
└── Level 2: Related concepts

Conditional Information

If [condition], include [information]
Else, skip [information]

This reduces unnecessary context.

Best Practices

  • Include only necessary context
  • Organize hierarchically
  • Use references for detailed info
  • Summarize before details
  • Link related concepts

8. Multimodal Prompting

Vision Prompting

Structure

Analyze this image:
[IMAGE]

Specifically, identify:
1. [What to look for]
2. [What to analyze]
3. [What to extract]

Format your response as:
[Desired format]

Example

Analyze this chart:
[CHART IMAGE]

Identify:
1. Main trends
2. Anomalies or outliers
3. Predictions for next period

Format as a structured report.

File-Based Prompting

Structure

Analyze this document:
[FILE]

Extract:
- [Information type 1]
- [Information type 2]
- [Information type 3]

Format as:
[Desired format]

Example

Analyze this PDF financial report:
[PDF FILE]

Extract:
- Revenue by quarter
- Expense categories
- Profit margins

Format as a comparison table.

Embeddings Integration

Structure

Using these embeddings:
[EMBEDDINGS DATA]

Find:
- Most similar items
- Clusters or groups
- Outliers

Explain the relationships.

Combining Techniques

Example: Complex Analysis Prompt

<prompt>
  <role>
    You are a senior data analyst with expertise in business intelligence.
  </role>
  
  <task>
    Analyze this sales data and provide insights.
  </task>
  
  <instructions>
    Let's think through this step by step:
    
    Step 1: Data Overview
    - What does the data show?
    - What time period does it cover?
    - What are the key metrics?
    
    Step 2: Trend Analysis
    - What patterns emerge?
    - Are there seasonal trends?
    - What's the growth trajectory?
    
    Step 3: Comparative Analysis
    - How does this compare to benchmarks?
    - Which segments perform best?
    - Where are the opportunities?
    
    Step 4: Recommendations
    - What actions should we take?
    - What are the priorities?
    - What's the expected impact?
  </instructions>
  
  <format>
    <executive_summary>2-3 sentences</executive_summary>
    <key_findings>Bullet points</key_findings>
    <detailed_analysis>Structured sections</detailed_analysis>
    <recommendations>Prioritized list</recommendations>
  </format>
</prompt>

Anti-Patterns to Avoid

❌ Vague Chaining

"Analyze this, then summarize it, then give me insights."

✅ Clear Chaining

"Step 1: Extract key metrics from the data
Step 2: Compare to industry benchmarks
Step 3: Identify top 3 opportunities
Step 4: Recommend prioritized actions"

❌ Unclear Role

"Act like an expert and help me."

✅ Clear Role

"You are a senior product manager with 10 years of experience 
in SaaS companies. Your task is to..."

❌ Ambiguous Format

"Give me the results in a nice format."

✅ Clear Format

"Format as a table with columns: Metric, Current, Target, Gap"

FILE:TROUBLESHOOTING.md

Troubleshooting Guide

Common Prompt Issues and Solutions

Issue 1: Inconsistent Outputs

Symptoms:

  • Same prompt produces different results
  • Outputs vary in format or quality
  • Unpredictable behavior

Root Causes:

  • Ambiguous instructions
  • Missing constraints
  • Insufficient examples
  • Unclear success criteria

Solutions:

1. Add specific format requirements
2. Include multiple examples
3. Define constraints explicitly
4. Specify output structure with XML tags
5. Use role-based prompting for consistency

Example Fix:

❌ Before: "Summarize this article"

✅ After: "Summarize this article in exactly 3 bullet points, 
each 1-2 sentences. Focus on key findings and implications."

Issue 2: Hallucinations or False Information

Symptoms:

  • Claude invents facts
  • Confident but incorrect statements
  • Made-up citations or data

Root Causes:

  • Prompts that encourage speculation
  • Lack of grounding in facts
  • Insufficient context
  • Ambiguous questions

Solutions:

1. Ask Claude to cite sources
2. Request confidence levels
3. Ask for caveats and limitations
4. Provide factual context
5. Ask "What don't you know?"

Example Fix:

❌ Before: "What will happen to the market next year?"

✅ After: "Based on current market data, what are 3 possible 
scenarios for next year? For each, explain your reasoning and 
note your confidence level (high/medium/low)."

Issue 3: Vague or Unhelpful Responses

Symptoms:

  • Generic answers
  • Lacks specificity
  • Doesn't address the real question
  • Too high-level

Root Causes:

  • Vague prompt
  • Missing context
  • Unclear objective
  • No format specification

Solutions:

1. Be more specific in the prompt
2. Provide relevant context
3. Specify desired output format
4. Give examples of good responses
5. Define success criteria

Example Fix:

❌ Before: "How can I improve my business?"

✅ After: "I run a SaaS company with $2M ARR. We're losing 
customers to competitors. What are 3 specific strategies to 
improve retention? For each, explain implementation steps and 
expected impact."

Issue 4: Too Long or Too Short Responses

Symptoms:

  • Response is too verbose
  • Response is too brief
  • Doesn't match expectations
  • Wastes tokens

Root Causes:

  • No length specification
  • Unclear scope
  • Missing format guidance
  • Ambiguous detail level

Solutions:

1. Specify word/sentence count
2. Define scope clearly
3. Use format templates
4. Provide examples
5. Request specific detail level

Example Fix:

❌ Before: "Explain machine learning"

✅ After: "Explain machine learning in 2-3 paragraphs for 
someone with no technical background. Focus on practical 
applications, not theory."

Issue 5: Wrong Output Format

Symptoms:

  • Output format doesn't match needs
  • Can't parse the response
  • Incompatible with downstream tools
  • Requires manual reformatting

Root Causes:

  • No format specification
  • Ambiguous format request
  • Format not clearly demonstrated
  • Missing examples

Solutions:

1. Specify exact format (JSON, CSV, table, etc.)
2. Provide format examples
3. Use XML tags for structure
4. Request specific fields
5. Show before/after examples

Example Fix:

❌ Before: "List the top 5 products"

✅ After: "List the top 5 products in JSON format:
{
  \"products\": [
    {\"name\": \"...\", \"revenue\": \"...\", \"growth\": \"...\"}
  ]
}"

Issue 6: Claude Refuses to Respond

Symptoms:

  • "I can't help with that"
  • Declines to answer
  • Suggests alternatives
  • Seems overly cautious

Root Causes:

  • Prompt seems harmful
  • Ambiguous intent
  • Sensitive topic
  • Unclear legitimate use case

Solutions:

1. Clarify legitimate purpose
2. Reframe the question
3. Provide context
4. Explain why you need this
5. Ask for general guidance instead

Example Fix:

❌ Before: "How do I manipulate people?"

✅ After: "I'm writing a novel with a manipulative character. 
How would a psychologist describe manipulation tactics? 
What are the psychological mechanisms involved?"

Issue 7: Prompt is Too Long

Symptoms:

  • Exceeds context window
  • Slow responses
  • High token usage
  • Expensive to run

Root Causes:

  • Unnecessary context
  • Redundant information
  • Too many examples
  • Verbose instructions

Solutions:

1. Remove unnecessary context
2. Consolidate similar points
3. Use references instead of full text
4. Reduce number of examples
5. Use progressive disclosure

Example Fix:

❌ Before: [5000 word prompt with full documentation]

✅ After: [500 word prompt with links to detailed docs]
"See REFERENCE.md for detailed specifications"

Issue 8: Prompt Doesn't Generalize

Symptoms:

  • Works for one case, fails for others
  • Brittle to input variations
  • Breaks with different data
  • Not reusable

Root Causes:

  • Too specific to one example
  • Hardcoded values
  • Assumes specific format
  • Lacks flexibility

Solutions:

1. Use variables instead of hardcoded values
2. Handle multiple input formats
3. Add error handling
4. Test with diverse inputs
5. Build in flexibility

Example Fix:

❌ Before: "Analyze this Q3 sales data..."

✅ After: "Analyze this [PERIOD] [METRIC] data. 
Handle various formats: CSV, JSON, or table.
If format is unclear, ask for clarification."

Debugging Workflow

Step 1: Identify the Problem

  • What's not working?
  • How does it fail?
  • What's the impact?

Step 2: Analyze the Prompt

  • Is the objective clear?
  • Are instructions specific?
  • Is context sufficient?
  • Is format specified?

Step 3: Test Hypotheses

  • Try adding more context
  • Try being more specific
  • Try providing examples
  • Try changing format

Step 4: Implement Fix

  • Update the prompt
  • Test with multiple inputs
  • Verify consistency
  • Document the change

Step 5: Validate

  • Does it work now?
  • Does it generalize?
  • Is it efficient?
  • Is it maintainable?

Quick Reference: Common Fixes

Problem Quick Fix
Inconsistent Add format specification + examples
Hallucinations Ask for sources + confidence levels
Vague Add specific details + examples
Too long Specify word count + format
Wrong format Show exact format example
Refuses Clarify legitimate purpose
Too long prompt Remove unnecessary context
Doesn't generalize Use variables + handle variations

Testing Checklist

Before deploying a prompt, verify:

  • Objective is crystal clear
  • Instructions are specific
  • Format is specified
  • Examples are provided
  • Edge cases are handled
  • Works with multiple inputs
  • Output is consistent
  • Tokens are optimized
  • Error handling is clear
  • Documentation is complete FILE:EXAMPLES.md

Prompt Engineering Expert - Examples

Example 1: Refining a Vague Prompt

Before (Ineffective)

Help me write a better prompt for analyzing customer feedback.

After (Effective)

You are an expert prompt engineer. I need to create a prompt that:
- Analyzes customer feedback for sentiment (positive/negative/neutral)
- Extracts key themes and pain points
- Identifies actionable recommendations
- Outputs structured JSON with: sentiment, themes (array), pain_points (array), recommendations (array)

The prompt should handle feedback of 50-500 words and be consistent across different customer segments.

Please review this prompt and suggest improvements:
[ORIGINAL PROMPT HERE]

Example 2: Custom Instructions for a Data Analysis Agent

---
name: data-analysis-agent
description: Specialized agent for financial data analysis and reporting
---

# Data Analysis Agent Instructions

## Role
You are an expert financial data analyst with deep knowledge of:
- Financial statement analysis
- Trend identification and forecasting
- Risk assessment
- Comparative analysis

## Core Behaviors

### Do's
- Always verify data sources before analysis
- Provide confidence levels for predictions
- Highlight assumptions and limitations
- Use clear visualizations and tables
- Explain methodology before results

### Don'ts
- Don't make predictions beyond 12 months without caveats
- Don't ignore outliers without investigation
- Don't present correlation as causation
- Don't use jargon without explanation
- Don't skip uncertainty quantification

## Output Format
Always structure analysis as:
1. Executive Summary (2-3 sentences)
2. Key Findings (bullet points)
3. Detailed Analysis (with supporting data)
4. Limitations and Caveats
5. Recommendations (if applicable)

## Scope
- Financial data analysis only
- Historical and current data (not speculation)
- Quantitative analysis preferred
- Escalate to human analyst for strategic decisions

Example 3: Few-Shot Prompt for Classification

You are a customer support ticket classifier. Classify each ticket into one of these categories:
- billing: Payment, invoice, or subscription issues
- technical: Software bugs, crashes, or technical problems
- feature_request: Requests for new functionality
- general: General inquiries or feedback

Examples:

Ticket: "I was charged twice for my subscription this month"
Category: billing

Ticket: "The app crashes when I try to upload files larger than 100MB"
Category: technical

Ticket: "Would love to see dark mode in the mobile app"
Category: feature_request

Now classify this ticket:
Ticket: "How do I reset my password?"
Category:

Example 4: Chain-of-Thought Prompt for Complex Analysis

Analyze this business scenario step by step:

Step 1: Identify the core problem
- What is the main issue?
- What are the symptoms?
- What's the root cause?

Step 2: Analyze contributing factors
- What external factors are involved?
- What internal factors are involved?
- How do they interact?

Step 3: Evaluate potential solutions
- What are 3-5 viable solutions?
- What are the pros and cons of each?
- What are the implementation challenges?

Step 4: Recommend and justify
- Which solution is best?
- Why is it superior to alternatives?
- What are the risks and mitigation strategies?

Scenario: [YOUR SCENARIO HERE]

Example 5: XML-Structured Prompt for Consistency

<prompt>
  <metadata>
    <version>1.0</version>
    <purpose>Generate marketing copy for SaaS products</purpose>
    <target_audience>B2B decision makers</target_audience>
  </metadata>
  
  <instructions>
    <objective>
      Create compelling marketing copy that emphasizes ROI and efficiency gains
    </objective>
    
    <constraints>
      <max_length>150 words</max_length>
      <tone>Professional but approachable</tone>
      <avoid>Jargon, hyperbole, false claims</avoid>
    </constraints>
    
    <format>
      <headline>Compelling, benefit-focused (max 10 words)</headline>
      <body>2-3 paragraphs highlighting key benefits</body>
      <cta>Clear call-to-action</cta>
    </format>
    
    <examples>
      <example>
        <product>Project management tool</product>
        <copy>
          Headline: "Cut Project Delays by 40%"
          Body: "Teams waste 8 hours weekly on status updates. Our tool automates coordination..."
        </example>
      </example>
    </examples>
  </instructions>
</prompt>

Example 6: Prompt for Iterative Refinement

I'm working on a prompt for [TASK]. Here's my current version:

[CURRENT PROMPT]

I've noticed these issues:
- [ISSUE 1]
- [ISSUE 2]
- [ISSUE 3]

As a prompt engineering expert, please:
1. Identify any additional issues I missed
2. Suggest specific improvements with reasoning
3. Provide a refined version of the prompt
4. Explain what changed and why
5. Suggest test cases to validate the improvements

Example 7: Anti-Pattern Recognition

❌ Ineffective Prompt

"Analyze this data and tell me what you think about it. Make it good."

Issues:

  • Vague objective ("analyze" and "what you think")
  • No format specification
  • No success criteria
  • Ambiguous quality standard ("make it good")

✅ Improved Prompt

"Analyze this sales data to identify:
1. Top 3 performing products (by revenue)
2. Seasonal trends (month-over-month changes)
3. Customer segments with highest lifetime value

Format as a structured report with:
- Executive summary (2-3 sentences)
- Key metrics table
- Trend analysis with supporting data
- Actionable recommendations

Focus on insights that could improve Q4 revenue."

Example 8: Testing Framework for Prompts

# Prompt Evaluation Framework

## Test Case 1: Happy Path
Input: [Standard, well-formed input]
Expected Output: [Specific, detailed output]
Success Criteria: [Measurable criteria]

## Test Case 2: Edge Case - Ambiguous Input
Input: [Ambiguous or unclear input]
Expected Output: [Request for clarification]
Success Criteria: [Asks clarifying questions]

## Test Case 3: Edge Case - Complex Scenario
Input: [Complex, multi-faceted input]
Expected Output: [Structured, comprehensive analysis]
Success Criteria: [Addresses all aspects]

## Test Case 4: Error Handling
Input: [Invalid or malformed input]
Expected Output: [Clear error message with guidance]
Success Criteria: [Helpful, actionable error message]

## Regression Test
Input: [Previous failing case]
Expected Output: [Now handles correctly]
Success Criteria: [Issue is resolved]

Example 9: Skill Metadata Template

---
name: analyzing-financial-statements
description: Expert guidance on analyzing financial statements, identifying trends, and extracting actionable insights for business decision-making
---

# Financial Statement Analysis Skill

## Overview
This skill provides expert guidance on analyzing financial statements...

## Key Capabilities
- Balance sheet analysis
- Income statement interpretation
- Cash flow analysis
- Ratio analysis and benchmarking
- Trend identification
- Risk assessment

## Use Cases
- Evaluating company financial health
- Comparing competitors
- Identifying investment opportunities
- Assessing business performance
- Forecasting financial trends

## Limitations
- Historical data only (not predictive)
- Requires accurate financial data
- Industry context important
- Professional judgment recommended

Example 10: Prompt Optimization Checklist

# Prompt Optimization Checklist

## Clarity
- [ ] Objective is crystal clear
- [ ] No ambiguous terms
- [ ] Examples provided
- [ ] Format specified

## Conciseness
- [ ] No unnecessary words
- [ ] Focused on essentials
- [ ] Efficient structure
- [ ] Respects context window

## Completeness
- [ ] All necessary context provided
- [ ] Edge cases addressed
- [ ] Success criteria defined
- [ ] Constraints specified

## Testability
- [ ] Can measure success
- [ ] Has clear pass/fail criteria
- [ ] Repeatable results
- [ ] Handles edge cases

## Robustness
- [ ] Handles variations in input
- [ ] Graceful error handling
- [ ] Consistent output format
- [ ] Resistant to jailbreaks