你的Prompt其实不差,只是少了点”结构”——这个Claude Skill对标Anthropic官方10条准则逐条改
你有没有这种感觉——写了个 prompt,AI 回答总觉得差一口气,但又说不上来哪里不对?
不是你 prompt 写得烂,是少了点「结构」。
最近我在 GitHub 上挖到一个新 Skill,叫 Claude Prompt Improvement,作者是 @christabone。它专门干一件事:把你的烂 prompt 改成生产级别的版本。不是那种泛泛的「写好点」,而是逐条对照 Anthropic 官方文档里的 10 大最佳实践来改。
哪 10 条?
- XML Tags:给复杂提示加语义边界,Claude 读起来更清晰
- 变量模板:用
{{code}}这类占位符让 prompt 可复用 - 角色设定:给 AI 一个专家身份,比如「你是资深 Python 开发者」
- Few-Shot 示例:.input → .output 演示你想让它学什么
- Chain of Thought:让它先想再答,复杂推理必须用
- 表述清晰:把「搞一些数据」改成「提取 2024 年 Q3 的销售额」
- 输出格式:明确说要 JSON 还是 Markdown,省得 AI 自由发挥
- 约束条件:边界和例外要说清楚,否则它会默认什么都干
- 上下文:背景信息、受众是谁,决定回答的专业深度
- 任务拆解:大任务拆成链,避免一次性塞太多
实战对比,差距一眼可见
原文:
Hey Claude! So I’ve been working on this Python function and I think it needs some work but I’m not totally sure what’s wrong with it. It’s supposed to get user data from our API and do some stuff with it.
优化后:
You are a senior Python developer performing a code review.
Focus on practical, actionable feedback rather than stylistic nitpicks.
Review the following Python function that fetches and processes user data from a REST API. Provide feedback in these specific areas:
1. **Bugs**: Identify any logic errors, edge cases, or runtime errors
2. **Error Handling**: Evaluate how the function handles API failures
3. **Best Practices**: Check adherence to Python conventions
4. **Performance**: Note any inefficiencies
{{code}}
<output_format>
## Summary
## Bugs Found
## Error Handling Issues
## Best Practice Violations
## Performance Suggestions
## Recommended Priority
</output_format>
你看,触发点就两个:说「帮我改进一下这个 prompt」,或者文件路径。它会自动生成两个文件——improved_prompt.md(优化版)和 improvement_summary.md(改了什么、为什么这么改)。
安装超简单
git clone https://github.com/christabone/claude-prompt-improvement.git
cd claude-prompt-improvement
mkdir -p ~/.claude/skills
cp -r skills/improve-prompt ~/.claude/skills/
重启 Claude Code,问它「What skills are available?」,看到 improve-prompt 就说明装好了。
总结一下
这个 Skill 的价值在于有据可循——它不是凭感觉改 prompt,而是对标 Anthropic 官方文档的 10 条黄金准则,每改一处都给你理由。相当于把官方最佳实践做成了自动化流水线。
刚 1 颗星,说明还非常早期,正是提 Issue、做贡献的好时机。如果你经常和 Claude Code 打交道,这个 Skill 值得装上试试。
GitHub 链接:
https://github.com/christabone/claude-prompt-improvement
GitHub: https://github.com/christabone/claude-prompt-improvement
评论区
登录后可评论。