prompt-engineer
它能做什么
它指导 AI 智能体设计提示词,使语言模型给出准确、一致的回答。适用于构建 AI 功能、需要可靠输出的人。
适用场景
- ✓当你为新的 AI 应用设计提示词时。
- ✓当现有提示词给出的结果不一致或质量较低时。
- ✓当你需要结构化的 JSON 输出或提示词测试套件时。
技能链接
https://github.com/Jeffallan/claude-skills/blob/main/skills/prompt-engineer/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请为我的客服机器人编写一个系统提示词,让它始终以 JSON 格式回复,包含类别和回复内容。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会定义任务和成功标准,需要时用示例设计提示词,并在各种情况下测试它。它每次只改一处,并记录结果。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Prompt Engineer
Expert prompt engineer specializing in designing, optimizing, and evaluating prompts that maximize LLM performance across diverse use cases.
When to Use This Skill
- Designing prompts for new LLM applications
- Optimizing existing prompts for better accuracy or efficiency
- Implementing chain-of-thought or few-shot learning
- Creating system prompts with personas and guardrails
- Building structured output schemas (JSON mode, function calling)
- Developing prompt evaluation and testing frameworks
- Debugging inconsistent or poor-quality LLM outputs
- Migrating prompts between different models or providers
Core Workflow
- Understand requirements — Define task, success criteria, constraints, and edge cases
- Design initial prompt — Choose pattern (zero-shot, few-shot, CoT), write clear instructions
- Test and evaluate — Run diverse test cases, measure quality metrics
- Validation checkpoint: If accuracy < 80% on the test set, identify failure patterns before iterating (e.g., ambiguous instructions, missing examples, edge case gaps)
- Iterate and optimize — Make one change at a time; refine based on failures, reduce tokens, improve reliability
- Document and deploy — Version prompts, document behavior, monitor production
Reference Guide
Load detailed guidance based on context:
| Topic | Reference | Load When |
|---|---|---|
| Prompt Patterns | references/prompt-patterns.md |
Zero-shot, few-shot, chain-of-thought, ReAct |
| Optimization | references/prompt-optimization.md |
Iterative refinement, A/B testing, token reduction |
| Evaluation | references/evaluation-frameworks.md |
Metrics, test suites, automated evaluation |
| Structured Outputs | references/structured-outputs.md |
JSON mode, function calling, schema design |
| System Prompts | references/system-prompts.md |
Persona design, guardrails, injection defense |
| Context Management | references/context-management.md |
Attention budget, degradation patterns, context optimization |
Prompt Examples
Zero-shot vs. Few-shot
Zero-shot (baseline):
Classify the sentiment of the following review as Positive, Negative, or Neutral.
Review: {{review}}
Sentiment:
Few-shot (improved reliability):
Classify the sentiment of the following review as Positive, Negative, or Neutral.
Review: "The battery life is incredible, lasts all day."
Sentiment: Positive
Review: "Stopped working after two weeks. Very disappointed."
Sentiment: Negative
Review: "It arrived on time and matches the description."
Sentiment: Neutral
Review: {{review}}
Sentiment:
Before/After Optimization
Before (vague, inconsistent outputs):
Summarize this document.
{{document}}
After (structured, token-efficient):
Summarize the document below in exactly 3 bullet points. Each bullet must be one sentence and start with an action verb. Do not include opinions or information not present in the document.
Document:
{{document}}
Summary:
Constraints
MUST DO
- Test prompts with diverse, realistic inputs including edge cases
- Measure performance with quantitative metrics (accuracy, consistency)
- Version prompts and track changes systematically
- Document expected behavior and known limitations
- Use few-shot examples that match target distribution
- Validate structured outputs against schemas
- Consider token costs and latency in design
- Test across model versions before production deployment
MUST NOT DO
- Deploy prompts without systematic evaluation on test cases
- Use few-shot examples that contradict instructions
- Ignore model-specific capabilities and limitations
- Skip edge case testing (empty inputs, unusual formats)
- Make multiple changes simultaneously when debugging
- Hardcode sensitive data in prompts or examples
- Assume prompts transfer perfectly between models
- Neglect monitoring for prompt degradation in production
Output Templates
When delivering prompt work, provide:
- Final prompt with clear sections (role, task, constraints, format)
- Test cases and evaluation results
- Usage instructions (temperature, max tokens, model version)
- Performance metrics and comparison with baselines
- Known limitations and edge cases
Coverage Note
Reference files cover major prompting techniques (zero-shot, few-shot, CoT, ReAct, tree-of-thoughts), structured output patterns (JSON mode, function calling), context management (
常见问题
准确率低时它会怎么做?
如果测试集上的准确率低于 80%,它会先找出失败模式,再做更多修改。
它能让提示词更短吗?
能。它可以在保持准确率的同时重构提示词,减少 token 数量。
它能帮忙处理思维链提示词吗?
能。它涵盖思维链和少样本学习模式。
详情
作者的原始描述
Writes, refactors, and evaluates prompts for LLMs — generating optimized prompt templates, structured output schemas, evaluation rubrics, and test suites. Use when designing prompts for new LLM applications, refactoring existing prompts for better accuracy or token efficiency, implementing chain-of-thought or few-shot learning, creating system prompts with personas and guardrails, building JSON/function-calling schemas, or developing prompt evaluation frameworks to measure and improve model performance.
repo: Jeffallan/claude-skills
热度
- GitHub 星标
- 12k
- 排名
- #11446
- 许可证
- MIT
- 更新时间
- 2026/10/30
评论
- …
同一仓库的更多技能
angular-architect
12k帮你的智能体构建 Angular 17 及更新版本的应用,包括独立组件、懒加载路由、NgRx 状态管理、RxJS 模式和性能优化。
api-designer
12k帮你的智能体设计 REST 或 GraphQL API,并编写 OpenAPI 3.1 规范,包括资源、分页、错误格式和版本控制规则。
architecture-designer
12k帮你的智能体设计系统架构、比较模式和技术,并编写架构决策记录,解释每个选择的理由。
atlassian-mcp
12k帮你的智能体通过 MCP 搜索和更新 Jira 问题及 Confluence 页面,包括 JQL 和 CQL 查询、冲刺和文档同步。