基于需求分级,自动重构提示词,从角色、背景、任务、约束、示例五维度优化并智能路由执行,支持多 Agent 并行。
让 AI 自动完成专业级 Prompt 重构,用户说人话即可
版本:V3.0
作者:向前
参考体系:PromptPilot 工程化 Prompt 优化体系
适用平台:OpenClaw + 飞书多 Agent 环境
bash
openskills install prompt-optimizer-100
注意:clawhub.ai 上的 slug 为
prompt-optimizer-100,安装时请使用完整名称。
bash
# 1. 下载 Skill 文件
git clone https://github.com/your-repo/prompt-optimizer.git
# 2. 复制规则文件
cp prompt-optimizer/rules/prompt-optimization.md ~/.openclaw/workspace/memory/agent-notes.md
# 3. 重启 Gateway
openclaw gateway --force
bash
# 安装时选择 merge 模式
openskills install prompt-optimizer --merge
# 或手动合并
# 1. 备份原有规则
cp ~/.openclaw/workspace/memory/agent-notes.md ~/.openclaw/workspace/memory/agent-notes.md.bak
# 2. 追加新规则
cat prompt-optimizer/rules/prompt-optimization.md >> ~/.openclaw/workspace/memory/agent-notes.md
# 3. 重启 Gateway
openclaw gateway --force
功能说明需求分级自动判断 L1-L4 任务等级Prompt 优化5 维度重构(角色/背景/任务/约束/示例)Agent 路由单 Agent / 多 Agent 并行执行保障自检清单 + Badcase 闭环Merge 模式保留用户原有规则,增量更新
等级关键词处理方式示例L1 简单默认直接执行"写一篇 300 字文章"L2 中等调研/分析/设计/规划展示优化思路 → 执行"调研一下竞品"L3 复杂对比/选型/评审/架构多 Agent 并行 → 对比"技术选型方案"L4 关键客户/发布/对外/重要显式确认 → 执行"生成客户方案 PPT"
场景是否加角色示例角色L1 简单❌ 不加-L2 调研/分析✅ 加产品经理/分析师L3 方案/选型✅ 加架构师/顾问L4 交付✅ 加资深顾问
text
【交付内容】
{content}
text
📋 原始需求:{user_input}
🎯 优化思路:{optimization_summary}
🤖 执行 Agent:{agent_name}
⏱️ 耗时:{duration}秒
【交付内容】
{content}
text
📋 原始需求:{user_input}
🎯 优化后的执行方案:
【任务】{task_description}
【维度】{dimensions}
【Agent】{agents}
【预计耗时】{duration}
请确认或修改:
- 回复"确认"立即执行
- 回复"补充 XXX"添加要求
- 回复"只要 XXX"简化范围
⏳ 等待确认...
bash
./scripts/verify.sh
测试用例输入预期输出L1 测试"写一篇 300 字文章"直接执行,无优化思路L2 测试"调研一下竞品"展示🎯优化思路 + 执行L3 测试"技术选型方案"展示🎯优化思路 + 多 Agent 对比L4 测试"生成客户方案 PPT"显式确认方案
配置项要求验证命令OpenClaw≥ 2026.3.8openclaw --version飞书插件≥ 1.2.0openclaw plugins list记忆系统已启用ls memory/流式输出已开启openclaw config get channels.feishu.streaming
bash
openskills uninstall prompt-optimizer
版本时间核心修改V02026-03-16 初版初始方案(需求分级 + Agent 路由)V12026-03-16 优化增加 L2-L3 展示优化思路V22026-03-16 修正承认错误 + 增加自检机制V32026-03-16 完善基于 PromptPilot 完善 + OpenClaw 融合
MIT License