prompt-optimizer-cn

v1.0.0

复杂任务专用迭代式提示词优化器。严格执行ACON论文的两阶段迭代优化+APE自动提示工程,仅在用户明确要求时触发,优化完主动收集反馈,支持多轮迭代直到满意。

0· 125·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for ucsdzehualiu/prompt-optimizer-cn.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "prompt-optimizer-cn" (ucsdzehualiu/prompt-optimizer-cn) from ClawHub.
Skill page: https://clawhub.ai/ucsdzehualiu/prompt-optimizer-cn
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install prompt-optimizer-cn

ClawHub CLI

Package manager switcher

npx clawhub@latest install prompt-optimizer-cn
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name and description (prompt optimizer for complex tasks using ACON+APE) match the SKILL.md instructions. The skill does not request unrelated credentials, binaries, or config paths — nothing requested appears extraneous to prompt optimization.
Instruction Scope
SKILL.md provides a narrow, prescriptive workflow (parse input, extract key signals, generate 5 candidates, score, compress, iterate on feedback). It only operates on the user-provided prompt and user feedback; it does not instruct reading files, environment variables, or calling external endpoints. The '100% retain key signals' and strict verification steps are procedural guarantees in the text (effectiveness claims) not additional runtime privileges.
Install Mechanism
Instruction-only skill with no install spec and no code files. No downloads or package installs are declared, so there is no installation risk.
Credentials
No environment variables, credentials, or config paths are required. The skill does not ask for unrelated secrets or broad system access.
Persistence & Privilege
The SKILL.md repeatedly states the optimizer must only trigger when the user explicitly requests it ('绝不自动触发'), but the skill metadata leaves model invocation enabled (disable-model-invocation: false). Autonomous invocation alone is not a security flaw, but there is a minor mismatch between the skill's self-imposed restriction and the platform-level invocation setting — you should confirm the platform enforces the 'user-request-only' behavior if that guarantee matters to you.
Assessment
This skill is instruction-only and appears coherent for its stated purpose. Before installing: (1) confirm your platform enforces the 'only when user asks' invocation if you require that guarantee (the SKILL.md forbids automatic triggering but model invocation is allowed by default), (2) test the skill with non-sensitive prompts to validate it truly preserves critical signals and does not leak or alter intent, and (3) avoid placing secrets or sensitive data inside prompts you feed to the optimizer (the skill processes prompt text but has no declared protections). If you need higher assurance, request the ACON/APE paper references or a transparency note from the publisher about how strict verification is implemented.

Like a lobster shell, security has layers — review code before you run it.

latestvk978r43havd6389kt2vzexbqw584yh5r
125downloads
0stars
1versions
Updated 1w ago
v1.0.0
MIT-0

阶段1:输入解析与关键信号提取(ACON论文3)

输入:用户的原始提示词 操作

  1. 意图锁定:提取核心任务目标T,确保后续所有优化都不偏离T
  2. 关键信号提取(ACON论文定义的必须保留信号):
    • ✅ 角色设定R:用户指定的专家角色
    • ✅ 任务目标T:核心要做什么
    • ✅ 约束条件C:边界规则、禁止事项
    • ✅ 输出格式F:用户要求的输出结构、格式
    • ✅ 变量占位符V:所有{{变量名}}
    • ✅ 示例E:用户提供的few-shot示例
    • ✅ 工具规则U:工具调用的时机和方式
    • ✅ 成功标准S:什么是好的输出
  3. 基线测量:记录原始提示词的token长度L₀

阶段2:APE 效用增强

目标:把模糊的提示词变成专家级指令,提升效用 操作(严格顺序)

  1. 候选生成:基于原始提示词,生成5个不同风格的候选指令
    • 候选1:结构化指令版
    • 候选2:专家角色版
    • 候选3:约束强化版
    • 候选4:格式明确版
    • 候选5:逻辑优化版
  2. 候选打分(APE论文的打分机制):
    • 清晰度:指令是否明确无歧义(0-10分)
    • 完整性:是否包含所有关键信号(0-10分)
    • 有效性:能否引导模型产生高质量输出(0-10分)
  3. 最优选择:选择总分最高的候选,作为效用增强后的版本P₁
  4. 验证:检查P₁是否100%保留了所有关键信号,没有改变原始意图

阶段3:ACON 压缩优化(ACON论文3.3节 两阶段优化)

目标:在不破坏功能的前提下,压缩token长度 操作(严格顺序,先效用后压缩)

  1. 冗余分析:分析P₁中的冗余内容
    • 重复的指令和要求
    • 废话、套话、无效表述
    • 可以精简的冗长表达
  2. 选择性压缩:
    • 只删除冗余,绝不删除关键信号
    • 合并重复的内容
    • 用更简洁的语言重写,保持语义不变
  3. 功能等价性验证:
    • 确保压缩后的P₂,功能与P₁完全一致
    • 确保所有关键信号都完整保留
    • 确保没有改变原始任务目标
  4. 长度控制:根据当前的λ参数(性能-成本权衡)调整压缩程度
    • 默认λ=0.5:平衡模式
    • 如果用户反馈"太长了",自动提高λ到0.8,进一步压缩
    • 如果用户反馈"效果不好",自动降低λ到0.2,减少压缩

阶段4:输出与反馈收集

操作

  1. 输出优化后的提示词P₂,用代码块包裹,方便用户复制
  2. 主动询问用户反馈:
    已完成优化。这个版本是否满足你的需求?
    如果有任何不满意的地方,请告诉我,比如:
    - 效果不够好?
    - 长度还是太长?
    - 某些约束/格式没保留?
    - 其他问题?
    我会根据你的反馈,继续迭代优化。
    

阶段5:迭代优化(ACON论文的R轮迭代机制)

当用户给出反馈时,执行以下操作

  1. 反馈解析:识别用户的反馈类型
    • 类型A:效果不好 → 回到阶段2,重新执行APE效用增强,补充约束
    • 类型B:长度太长 → 回到阶段3,重新执行ACON压缩,提高λ
    • 类型C:某些内容没保留 → 检查关键信号,补回缺失的部分
    • 类型D:其他需求 → 根据用户的具体要求调整
  2. 重新执行优化:根据反馈调整参数,再次运行两阶段优化
  3. 验证:确保新的版本保留了核心任务目标,并且解决了用户反馈的问题
  4. 输出新的优化版本,再次询问反馈
  5. 重复直到用户表示满意

严格规则(保证效果)

  • ✅ 每一步都有验证,确保不破坏原始功能
  • ✅ 关键信号永不删除,100%保留
  • ✅ 严格遵循"先效用后压缩"的顺序,绝不颠倒
  • ✅ 迭代优化每一轮都重新验证,确保越优化越好
  • ✅ 复杂任务优先保证功能完整性,压缩是可选的
  • ❌ 不自动触发,只在用户明确要求时工作
  • ❌ 不做任何对比分析,只输出优化结果
  • ❌ 不输出多余的解释,除非用户要求

Comments

Loading comments...