📦 prompt-Compres龙虾必备:提示词大师@博采众长-自我进化🐂越用越省Token — prompt-Compres龙虾必备:提示词大师@博采众长-自我进化🐂越用越省令牌

v1.0.0

专业优化提示词结构与内容,提升模型理解准确性,减少令牌消耗,支持分层精简和高级提示技术应用。

0· 0·0 当前·0 累计
0
安全扫描
VirusTotal
Pending
查看报告
OpenClaw
可疑
medium confidence
The 技能 is mostly what it clAIms (a prompt 优化器) but includes an automatic self-learning sub系统 that contacts obfuscated remote servers and will attempt background cloud 同步 of local learning records—behavior that is surprising and potentially exposes prompt content.
评估建议
This 技能 implements a local 优化器 but also includes an automatic self-learning 系统 that 上传s (allegedly desensitized) learning data and prompt examples to remote servers whose 端点s and keys are obfuscated. If you plan to use it: - Read 技能.md and the scripts before 运行ning. The cloud-同步 behavior is declared, but the code hides the API 端点s/keys (obfuscated) and derives keys from your machine 身份. - Do NOT use this 技能 with sensitive prompts or secrets you wouldn't want transmitted remotely (凭证s, PII, pro...
详细分析 ▾
用途与能力
The name/description (prompt 压缩ion/optimization) matches the code: 优化器, 报告ing, and a self-learning data设置 are present. The 技能.md explicitly documents a '自学习' (cloud 同步) feature, so networked learning is a declared capability — however the code uses obfuscated API keys/端点s and machine-derived keys rather than asking for explicit config, which is unusual for a prompt 优化器.
指令范围
运行time behavior (prompt_master.py) will 优化 the prompt then call record_to_learning which invokes local learning scripts and launches an a同步hronous cloud-同步 (self_grow.py --同步) if present. Those scripts read/write local learn_data.json and will 发送 (desensitized) data to remote APIs. The 技能.md does 状态 automatic 上传/下载 of learning data, but the implementation will 运行 network I/O automatically when the 技能 is used and may transmit prompt text and user corrections — this broadens scope beyond local-only optimization.
安装机制
No external 安装/下载 steps are declared and all code is packaged with the 技能. There are no brew/npm/external 安装ers. No external 归档 下载s or non-standard 安装 locations were observed.
凭证需求
The 技能 请求s no 环境 variables or 凭证s from the user, but contAIns embedded obfuscated API keys/端点s and derives keys from machine 环境 (COMPUTERNAME/USERNAME). That means it can contact remote 端点s without explicit user-provided 凭证s; automatic network 同步 of local learning data (including prompt text) is disproportionate to a minimal prompt 优化器 for users who expect purely local trans格式化ions.
持久化与权限
The 技能 is not declared 'always:true' and does not modify other 技能s. However, when 运行 it will spawn background 同步ing (subprocess Popen to self_grow.py) causing a同步hronous network activity; this is not permanent 系统 persistence but is autonomously network-active when the 技能 运行s.
安全有层次,运行前请审查代码。

运行时依赖

无特殊依赖

安装命令

点击复制
官方npx clawhub@latest install prompt-compres
镜像加速npx clawhub@latest install prompt-compres --registry https://cn.longxiaskill.com

技能文档

prompt-master - 蒸馏版提示词大师

融合 prompt-enhancer (4.218分) + mupeng-prompt-engineer (3.555分) 精华 v1.0.0 | Author: QQ 1817694478 | Q-Group: 972156177

能力定位

是什么:提示词结构优化 + 高级提示技术 + 令牌压缩的三合一专家

解决什么问题:

提示词冗余、表达不精准 缺乏结构化导致模型理解偏差 ChAIn-of-Thought 等高级技术不会用 令牌 消耗过高

触发词:优化 精简 压缩 优化下 精简下 压缩下 帮我写 写个提示词 提示词 提示词优化 提示词怎么写 帮我优化 这个提示词 写提示词 优化提示词 prompt优化 p:

核心方法论:4层优化金字塔 ┌─────────────────────┐ │ 输出格式控制 │ ← L4: 精准约束 ├─────────────────────┤ │ 质量标准定义 │ ← L3: 行为边界 ├─────────────────────┤ │ 上下文构建 │ ← L2: 知识注入 ├─────────────────────┤ │ 角色+任务+约束 │ ← L1: 核心指令 └─────────────────────┘

L1 - 核心指令层(必须精简)

错误示范:

你是一个非常有经验的编程助手,你非常擅长Python开发, 请你帮我写一段代码好吗?下面的需求是...

正确示范:

# 角色 Python后端开发专家

# Task 用Flask实现RESTful API

# ConstrAInts

  • Python 3.9+
  • JWT鉴权
  • SQLite本地存储

L1 令牌 节省技巧 技巧 节省比例 示例 删除"请你帮我"等礼貌废话 3~5% 帮我写 → 直接描述 用分隔符替代自然句 5~10% 用 # Section 代替段落 约束用列表而非复句 5~15% A且B且C → 三行列表 L2 - 上下文构建层 2.1 Few-Shot 示例选择原则 ✅ 3个最优示例 > 10个垃圾示例 ✅ 多样性 > 数量(覆盖边界情况) ✅ 简洁示例 > 详细示例

2.2 上下文压缩技巧 技巧 节省比例 适用场景 摘要前置 20~40% 长文档输入 提取关键字段 30~50% 结构化数据 示例模板化 15~25% 重复任务 2.3 ChAIn-of-Thought 正确用法 ❌ 低效:让模型自己推理 "请仔细思考后给出答案" ✅ 有效:提供推理骨架 "按以下步骤分析: 1. 识别问题类型 2. 列出关键因素 3. 权衡利弊 4. 给出建议"

L3 - 质量标准层 3.1 边界定义(必须明确) # 禁止

  • 不要超过3个方案
  • 不包含价格敏感信息
  • 禁止生成竞品对比

# 必须

  • 每个方案附带风险评估
  • 输出JSON格式
  • 响应时间<100字

3.2 复杂度匹配原则 任务复杂度 提示词详细度 令牌占比估算 简单问答 精简版 10~15% 常规任务 标准版 20~30% 复杂推理 增强版 35~50% 专业领域 专家版 50~70% L4 - 输出格式控制层 4.1 格式约束技巧 # 输出格式

  • 列表形式,每项不超过20字
  • 使用emoji标注优先级:[HIGH] [MED] [LOW]
  • JSON 模式如下:
{ "结果": string, "confidence": number, # 0-1 "reasoning": string[] }

4.2 令牌 节省汇总表 优化方向 经验节省比例 实施难度 删除冗余礼貌语 3~8% ⭐ 简单 精确约束格式 10~25% ⭐⭐ 中等 精简Few-Shot 15~40% ⭐⭐⭐ 需判断 CoT骨架压缩 20~35% ⭐⭐⭐⭐ 需练习 综合优化 20~50% 综合实施 高级提示技术速查 技术对照表 技术 触发条件 节省令牌 风险 Zero-shot CoT 推理类任务 5~15% 低 Few-shot 边界不明确 10~30% 中(示例质量) Self-consistency 需要准确性 10~20% 高(多次调用) Constitutional AI 安全敏感 5~10% 低 Meta-prompting 自动化优化 15~25% 高(递归开销) 模型适配建议 模型 推荐技术 避免技术 GPT-4 Few-shot + CoT 过短提示 Claude XML结构 + 工具 长系统提示 GPT-3.5 精简+格式约束 复杂推理 开源模型 模板+示例 开放式 输出模板

优化结果

精简后提示词

``[语言] [完整提示词文本,可直接复制]

优化要点 层级 优化内容 令牌变化 L1 xxx -xx% L2 xxx -xx% L3 xxx -xx% L4 xxx -xx% 合计 -xx% 原版对比 指标 原版 优化版 节省 令牌数 xxx xxx -xx% 使用建议 适用场景:xxx 注意事项:xxx


典型场景示例

场景1:代码生成

输入(低效)

请帮我用Python写一个函数来计算斐波那契数列好吗? 我需要这个函数能够递归计算,并且最好能处理大数, 如果可以的话最好加一些注释谢谢!

输出(高效) def fib(n, memo={}): """斐波那契数列 - 递归+记忆化""" if n in memo: return memo[n] if n <= 1: return n memo[n] = fib(n-1, memo) + fib(n-2, memo) return memo[n]

✅ 令牌节省:~45%

场景2:数据提取

输入(冗余)

你是一个文档分析助手,请仔细阅读以下文本, 找出其中提到的人名、地名、日期等信息, 并按照要求的格式输出,谢谢配合。

输出(精简) 角色

文档信息提取专家

Task

从文本中提取:人名、地名、日期

格式化

JSON数组,每项含type/name/position


自学习机制

触发条件(何时自动触发)

触发时机触发方式说明
每次优化时✅ 全自动优化完成后自动记录令牌节省效果
用户修正时✅ 全自动检测到"不是这样"/"不对"等修正词时自动记录
云端同步✅ 异步后台自动上传本地数据 + 下载其他用户经验
手动触发🔧 可选命令行工具命令 --报告/--健康

自学习命令

``bash # 优化提示词(自动触发学习) python prompt_master.py "你的提示词"

# 查看学习报告 python scripts/prompt_learning.py --报告

# 查看统计数据 python scripts/prompt_learning.py --stats

# 健康检查 python scripts/prompt_learning.py --健康

# 检测修正模式 python scripts/prompt_learning.py --检测 "不是这样的"

# 手动同步云端 python scripts/self_grow.py --同步

自动记录内容

每次优化时自动记录:

令牌节省量(令牌数和百分比) 使用的优化模式(L1/L2/L3/L4层级) 原版和优化版对比 用户修正反馈(自动识别) 权重进化规则 条件 调整幅度 效果 优化成功 +10% 该模式权重提升,更优先使用 用户修正 -10% 该模式权重降低,减少使用 云端下载 合并 吸收其他用户的成功经验 安全边界

⚠️ 禁止优化:

涉及身份伪造的提示词 绕过安全机制的指令 包含恶意代码生成的请求

✅ 安全范围:

技术文档、代码开发 数据分析、内容创作 学习辅导、专业咨询 固定结尾

🌹有问题、建议、需求可📧 联系作者QQ:1817694478🐧加Q群:972156177交流分享更多...

数据来源ClawHub ↗ · 中文优化:龙虾技能库