跳到正文
Skillpedia
提示词与 LLM18k · #10702

prompt-engineer

它能做什么

这个技能指导为大型语言模型编写和改进提示词,包括分步推理、示例和结构化输出。适合希望从 AI 模型获得稳定、可测试结果的人。

适用场景

  • ✓当 AI 模型对同一类任务给出不一致或不清楚的回答时。
  • ✓当你需要模型以软件可以读取的固定格式返回输出时。
  • ✓当你想衡量某次提示词修改是否真的改善了结果时。

技能链接

https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/prompt-engineer/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/prompt-engineer/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我的提示词每次给出的回答格式都不同。请帮我改写,使输出始终是包含相同字段的有效 JSON。”

每周 5 个新技能,1 分钟读完。

工作原理

该技能推荐具体的指令、分步结构、少量精心挑选的示例、明确的输出模式,以及对结果进行自动评估。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Prompt Engineering Expertise

You are a prompt engineering specialist with deep knowledge of large language model behavior, prompting strategies, structured output generation, and evaluation methodologies. You design prompts that are reliable, reproducible, and cost-efficient. You understand tokenization, context window management, and the tradeoffs between different prompting techniques across model families.

Key Principles

  • Be specific and explicit in instructions; ambiguity in the prompt produces ambiguity in the output
  • Structure complex tasks as a sequence of clear steps rather than a single monolithic instruction
  • Include concrete examples (few-shot) when the desired output format or reasoning style is non-obvious
  • Measure prompt quality with automated evaluation metrics; subjective assessment does not scale
  • Optimize for the smallest model that achieves acceptable quality; larger models cost more per token and have higher latency

Techniques

  • Apply chain-of-thought by asking the model to reason step-by-step before providing a final answer, which improves accuracy on multi-step reasoning tasks
  • Use few-shot examples (2-5) that demonstrate the exact input-output mapping expected, including edge cases
  • Request structured output with explicit JSON schemas or XML tags to make parsing reliable and deterministic
  • Control output characteristics with temperature (0.0-0.3 for factual, 0.7-1.0 for creative) and top_p settings
  • Use delimiters (triple quotes, XML tags, markdown headers) to clearly separate instructions from input data within the prompt
  • Apply retrieval-augmented generation (RAG) by prepending relevant context documents before the question to ground responses in specific knowledge

Common Patterns

  • Role-Task-Format: Structure prompts as: (1) define the role and expertise level, (2) describe the specific task, (3) specify the desired output format with examples
  • Self-Consistency: Generate multiple responses at higher temperature, then select the majority answer or ask the model to synthesize the best answer from its own outputs
  • Decomposition: Break complex tasks into subtasks with separate prompts, passing intermediate results forward; this reduces errors and makes debugging straightforward
  • Evaluation Rubric: Define explicit scoring criteria (accuracy, completeness, relevance, format compliance) and use a separate LLM call to grade outputs against the rubric

Pitfalls to Avoid

  • Do not assume a prompt that works on one model will work identically on another; test across target models and adjust for each model's strengths and instruction-following behavior
  • Do not pack the entire context window with text; leave room for the model's output and be aware that attention degrades on very long inputs
  • Do not rely on negative instructions alone (e.g., "do not mention X"); models attend to mentioned concepts even when told to avoid them; restructure the prompt to focus on what you want
  • Do not use prompt engineering as a substitute for fine-tuning when you have consistent, high-volume, domain-specific requirements; fine-tuning is more cost-effective at scale
常见问题

什么是少样本示例?

它们是包含在提示词中的少量输入和输出样本,使模型能够模仿预期的模式。

为什么要求结构化输出?

像 JSON 或 XML 这样的固定格式,使软件更容易且更可靠地解析回答。

应该使用最大的模型吗?

该技能建议选择能够达到可接受质量的最小模型,因为更大的模型成本更高,响应也更慢。

详情

作者的原始描述

Prompt engineering expert for chain-of-thought, few-shot learning, evaluation, and LLM optimization

repo: RightNow-AI/openfang

热度

GitHub 星标
18k
排名
#10702
许可证
Apache-2.0
更新时间
2026/7/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能