prompt-writing
它能做什么
这项技能指导编写和完善存储在 YAML 中的提示词,例如系统提示词和智能体提示词。适合构建 AI 助手、并希望提示词清晰且结构良好的人。
适用场景
- ✓当你为 AI 助手编写系统提示词时。
- ✓当你想改进一个效果不佳的 YAML 提示词模板时。
- ✓当你需要为提示词添加变量和清晰的分段时。
技能链接
https://github.com/ModelEngine-Group/nexent/blob/develop/.claude/skills/prompts-writing/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请为我们的客服智能体重写 YAML 系统提示词,让它有清晰的分段、客户姓名的占位符和一份检查清单。”
每周 5 个新技能,1 分钟读完。
工作原理
这项技能为智能体提供标准的 YAML 结构、标题、列表和占位符的规则,以及一份质量检查清单。智能体用这些内容创建或完善提示词,并在交回之前进行检查。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Prompt Writing
Create and optimize YAML-based prompts for AI assistants following industry best practices.
Quick Start
Standard YAML Prompt Structure
system_prompt: |-
# Section with ### header
## Subsection with ## header
Content with clear structure.
**Bold key concepts**
- Bullet points for requirements
- Consistent indentation (2 spaces)
1. Numbered lists for sequences
2. Use when order matters
user_prompt: |
Direct instructions with {{ variable placeholders }}
Key Principles
- Structure: Use
|-for multi-line system prompts,|for user prompts - Templating: Use
{{ variable }}for dynamic content - Separators: Use
---sparingly, only between major sections - Language: Keep prompts in consistent language (English recommended for templates)
Quality Checklist
Before finalizing any prompt, verify:
- No unclosed braces
{{without}} - No excessive separators (
---,***) - Consistent heading hierarchy (
###→##) - Clear variable placeholders with descriptive names
- Proper YAML indentation preserved
- No HTML tags in Markdown content
- Lists have parallel structure
Common Patterns
System Prompt with Sections
system_prompt: |-
### Role Definition
You are a professional [role name]. Your task is to [core responsibility].
### Requirements
1. First requirement
2. Second requirement
3. Third requirement
### Guidelines
- Do this
- Don't do that
- Always do this
### Output Format
Respond in plain text without separators.
Jinja2 Template Variables
user_prompt: |
Please analyze the following {{ document_type }}:
Name: {{ filename }}
Content: {{ content }}
Summary ({{ max_words }} words):
References
- Best Practices: See best-practices.md for detailed guidelines
- Templates: See templates.md for reusable patterns
- Examples: See examples.md for real-world samples
Related Tools
When working with prompts, also consider:
- YAML validation tools
- Jinja2 syntax checkers
- Markdown linters
常见问题
它使用什么格式?
它使用 YAML,包含系统提示词块和用户提示词块。
变量如何书写?
动态内容使用双花括号,例如用双花括号包裹变量名。
它会检查结果吗?
会。技能包含一份检查清单,用于在定稿前验证提示词。
详情
作者的原始描述
Create, refine, and optimize high-quality YAML prompts for AI assistants. Use when working with prompt templates, system prompts, agent prompts, or any prompt engineering tasks. Provides structure guidelines, template patterns, and quality standards for YAML-based prompts.
repo: ModelEngine-Group/nexent
热度
- GitHub 星标
- 6.1k
- 排名
- #14426
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …