prompt-design
Skill0 starsChanged 5 months agoMITView on GitHub
Design and improve prompts for LLM workflows, system prompts, few-shot examples, evaluation criteria, prompt safety, and injection resistance. Use when asked to write, review, or optimize prompts or agent instructions.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- fmind/dottheir own version, first seen Oct 5, 2026
- bogheorghiu/prompt-designtheir own version, first seen Oct 1, 2026
- 0xKalel/llm-prompt-designtheir own version, first seen Sep 26, 2026
- Victoriakaey/build-reliable-agentstheir own version, first seen Apr 3, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- fmind/dot★ 10same name
- 0xKalel/llm-prompt-design★ 0same name
- bogheorghiu/prompt-design★ 0same name
- Victoriakaey/build-reliable-agents★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository33 other files it gives its agents.
- AGENTS.mdAGENTS.md
- api-designSkill
- architecture-consultantSkill
- backend-patternsSkill
- ci-cdSkill
- code-reviewSkill
- containersSkill
- database-migrationsSkill
- doc-generatorSkill
- git-workflowSkill
- go-reviewSkill
- luaSkill
- markdownSkill
- nginxSkill
- nodejsSkill
- observabilitySkill
- product-managerSkill
- project-standards-initSkill
- python-reviewSkill
- reactSkill
- redisSkill
- relay-imagegenSkill
- releaseSkill
- security-baselineSkill
- semi-mcp-setupSkill
- tailwindcssSkill
- test-engineeringSkill
- tibishu-note-searchSkill
- tibishu-notesSkill
- typescript-reviewSkill
- unity-csharpSkill
- validation-lintSkill
- vueSkill
The file
Files
Skill: Prompt Design
帮助设计和优化 LLM Prompts,使模型产出更准确、一致且符合预期的结果。
🎯 Purpose
将用户意图转化为 LLM 能准确执行的指令。Prompt 设计需要如同代码一样严谨——小改动可能带来大影响,直觉判断往往不可靠,需要系统化评估。
🎯 触发条件
当用户说:
- "帮我设计一个 prompt"
- "优化这个 prompt"
- "写一个 system prompt"
- "这个 prompt 怎么改进"
/optimize-prompt(workflow 触发)
👉 自动启用本 Skill
🧩 Capabilities
- Prompt 结构设计:构建清晰的 Role/Context/Instructions/Constraints/Output 架构
- Few-Shot Learning:通过示例教会模型预期行为
- Chain-of-Thought:引导模型进行逐步推理
- Template Systems:构建可复用的 Prompt 模板
- System Prompt 架构:设计持久化的全局行为约束
- Progressive Disclosure:渐进式增加 Prompt 复杂度
🧠 Usage
- 在模型输出不稳定、格式跑偏或理解不准时使用。
- 在设计 system prompt、任务模板或 few-shot 示例时使用。
- 在需要把 prompt 变成可评估、可迭代资产时使用。
📥 Input
- 当前 prompt、任务目标和失败样例。
- 期望输出格式、限制条件和评测方法。
- 所用模型能力、安全要求和上下文限制。
📤 Output
- 优化后的 prompt 结构与示例。
- 风险点、评测方案和迭代建议。
- 是否需要拆成多层提示的判断。
🔄 Core Patterns
1. Structured System Prompt
结构化的系统提示词设计:
[Role] 谁 - 模型扮演的角色
[Context] 什么 - 相关背景信息
[Instructions] 怎么做 - 具体任务指令
[Constraints] 不做什么 - 明确限制
[Output] 输出格式 - 期望的结构
[Examples] 示例 - 正确行为的演示2. Few-Shot Learning
通过示例教会模型:
提取支持工单中的关键信息:
Input: "登录失败,一直报 403 错误"
Output: {"issue": "authentication", "error_code": "403", "priority": "high"}
Input: "希望能在设置中添加深色模式"
Output: {"issue": "feature_request", "error_code": null, "priority": "low"}
现在处理: "上传超过 10MB 的文件时超时"[!TIP] 包含 2-5 个多样化示例,涵盖边缘情况,保持格式一致
3. Chain-of-Thought
请求逐步推理:
分析这个 Bug 报告并确定根本原因。
请逐步思考:
1. 预期行为是什么?
2. 实际行为是什么?
3. 最近有什么变更可能导致此问题?
4. 涉及哪些组件?
5. 最可能的根本原因是什么?
Bug: "昨天部署缓存更新后,用户无法保存草稿"4. Progressive Disclosure
从简单开始,按需增加复杂度:
| 级别 | 策略 | 示例 |
| L1 | 直接指令 | "总结这篇文章" |
| L2 | 添加约束 | "用 3 个要点总结这篇文章,聚焦核心发现" |
| L3 | 添加推理 | "阅读文章,识别主要发现,然后用 3 个要点总结" |
| L4 | 添加示例 | 包含 2-3 个输入输出示例 |
5. Instruction Hierarchy
标准指令层次结构:
[System Context] → [Task Instruction] → [Examples] → [Input Data] → [Output Format]✅ Best Practices
- 具体明确:模糊的 Prompt 产生不一致的结果
- 示例优于描述:Show, Don't Tell
- 充分测试:在多样化、有代表性的输入上评估
- 快速迭代:小改动可能有大影响
- 监控性能:在生产环境中跟踪指标
- 版本控制:像代码一样管理 Prompt 版本
- 记录意图:解释为什么这样设计 Prompt
❌ Anti-Patterns
| 问题 | 严重性 | 解决方案 |
| 使用不精确的语言 | 🔴 高 | 明确具体:"列出 3 个要点" vs "列出一些要点" |
| 期望特定格式但未指定 | 🔴 高 | 明确指定输出格式 |
| 只说做什么,不说不做什么 | 🟡 中 | 包含明确的限制条件 |
| 修改 Prompt 但不测量影响 | 🟡 中 | 系统化评估对比 |
| "以防万一"包含无关上下文 | 🟡 中 | 精心筛选上下文内容 |
| 示例有偏差或不具代表性 | 🟡 中 | 使用多样化示例 |
| 所有任务使用默认 temperature | 🟡 中 | 根据任务调整 temperature |
| 未考虑用户输入的 Prompt 注入 | 🔴 高 | 防御注入攻击 |
⚠️ Common Pitfalls
- 过度工程化:在尝试简单方案前就使用复杂 Prompt
- 示例污染:使用与目标任务不匹配的示例
- 上下文溢出:过多示例超出 Token 限制
- 指令歧义:留有多种解释的空间
- 忽视边缘情况:未在异常或边界输入上测试
⚠️ Constraints
- 不把未评估的提示词直接当成生产方案。
- 不忽视 prompt 注入、格式逃逸和示例偏置风险。
- 不为了“看起来聪明”而增加无证据的复杂度。
🔍 能力溯源 (Source Mapping)
| 能力 | 来源 | 说明 |
| Prompt 结构设计 | prompt-engineer (外部) | ✅ 整合 Role/Context/Instructions 架构 |
| Few-Shot Learning | prompt-engineering (外部) | ✅ 整合核心技术与示例 |
| Chain-of-Thought | prompt-engineering (外部) | ✅ 整合推理引导技术 |
| Template Systems | prompt-engineering (外部) | ✅ 整合模板系统设计 |
| Progressive Disclosure | prompt-engineering (外部) | ✅ 整合渐进式复杂度模式 |
| Best Practices | Prompt Engineering Guide | ✅ 参考行业最佳实践 |
📚 参考资料 (References)
- Prompt Engineering Guide - 全面的 Prompt 工程指南
- antigravity-awesome-skills/prompt-engineer - 外部 Prompt 工程师 Skill
- antigravity-awesome-skills/prompt-engineering - 外部 Prompt 工程模式 Skill
- OpenAI Prompt Engineering Guide - OpenAI 官方指南
- Anthropic Prompt Design Guide - Anthropic 官方指南
🔗 Related Skills
- code-review: 可用 Prompt 设计优化审查反馈格式
- product-manager: 可配合澄清任务目标、受众和验收标准
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

