Prompt Optimizer by dxx

v3.1.0

自动将模糊需求优化为AI可精准执行的指令,支持13种任务类型并提供缓存和配置功能。

0· 96·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 ntaffffff/prompt-optimizer-dxx.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Prompt Optimizer by dxx" (ntaffffff/prompt-optimizer-dxx) from ClawHub.
Skill page: https://clawhub.ai/ntaffffff/prompt-optimizer-dxx
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-dxx

ClawHub CLI

Package manager switcher

npx clawhub@latest install prompt-optimizer-dxx
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (Prompt Optimizer) match the provided Python code and tests: pattern detection, enhancements, LRU cache, and CLI. Required env vars, binaries, and credentials are empty — appropriate for a local prompt-transformer tool.
Instruction Scope
SKILL.md instructs copying the skill into ~/.openclaw/workspace/skills/ and running the Python CLI/module. The runtime instructions and code operate on prompts, optional config files, and in-memory cache. The README mentions a config.yaml.example and a config file path, but that example file is not present in the manifest — this is a minor documentation/packaging inconsistency to be aware of. There are no instructions to read unrelated system files or to send data to external endpoints.
Install Mechanism
No install spec is provided (instruction-only install via copying). That is the lowest risk class; code will run locally when the user executes the Python scripts. The code only optionally imports PyYAML if a user-supplied config file exists; it does not download or execute code from remote URLs.
Credentials
The skill requests no environment variables or credentials. Optional dependency on PyYAML is only for loading user config files. There are no hidden env accesses in the visible code and SKILL.md does not request secrets.
Persistence & Privilege
always is false; the skill is user-invocable and not forced into every agent run. It does not ask to modify other skills or system-wide config. The recommended install copies files into the user's OpenClaw workspace (normal for skills).
Assessment
This skill appears to be a local prompt-optimizer implemented in Python and is internally consistent with its description. Before installing: (1) review the included Python files locally (prompt_optimizer.py and config_data.py) since running unknown Python code has typical risks; (2) note the SKILL.md suggests copying the folder into ~/.openclaw/workspace/skills/ — that will add files to your OpenClaw workspace, so keep a backup if you care about that directory; (3) the skill can optionally load a YAML config (PyYAML required) — only enable/use a config file you trust; (4) the README mentions config.yaml.example which isn't bundled — if you rely on an example config, create/inspect it yourself; (5) run the bundled tests (python test_prompt_optimizer.py) in an isolated environment (virtualenv) before using, and inspect behavior on sample prompts to confirm it meets your expectations.

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

aivk97frkj2rqf5hvjsa8dmy65a0x84fmphlatestvk97frkj2rqf5hvjsa8dmy65a0x84fmphoptimizervk97frkj2rqf5hvjsa8dmy65a0x84fmphpromptvk97frkj2rqf5hvjsa8dmy65a0x84fmphtoolsvk97frkj2rqf5hvjsa8dmy65a0x84fmph
96downloads
0stars
1versions
Updated 2w ago
v3.1.0
MIT-0

🚀 Prompt Optimizer

<p align="center"> <img src="https://img.shields.io/badge/OpenClaw-技能包-blue?style=for-the-badge&logo=rocket" alt="OpenClaw"> <img src="https://img.shields.io/badge/版本-3.1-green?style=for-the-badge" alt="Version"> <img src="https://img.shields.io/badge/Python-3.12+-yellow?style=for-the-badge" alt="Python"> <img src="https://img.shields.io/badge/测试-31个通过-green?style=for-the-badge" alt="Tests"> </p>

[!TIP] AI 任务处理器 - 先优化 Prompt,再精准执行


✨ 一句话介绍

一个能把您的模糊需求自动翻译成 AI 能精准执行的指令的工具!


🎯 能做什么?

原始需求 → 精准指令

您说优化后
"帮我写个排序""你是一个专业工程师。帮我写个排序。请用 Markdown 格式输出..."
"查下天气""请提供准确、全面的信息,标注信息来源。查下天气。用 Markdown..."
"写个API""你是一个专业工程师。写个API。请用 Markdown 格式输出..."

🚀 快速开始

安装

cp -r prompt-optimizer/ ~/.openclaw/workspace/skills/

使用

# 基本用法
python prompt_optimizer.py "帮我写个排序"

# JSON 输出
python prompt_optimizer.py "帮我写个排序" --json

# 从文件批量处理
python prompt_optimizer.py --file input.txt

# 查看版本
python prompt_optimizer.py --version

# 模块方式运行
python -m prompt_optimizer "帮我写个排序"

📖 CLI 用法

用法: python prompt_optimizer.py [options] [prompt]

选项:
  -f, --file FILE        从文件读取 prompt(每行一个)
  -o, --output FILE      输出文件路径
  -j, --json             输出 JSON 格式
  -v, --verbose          显示详细信息
  -q, --quiet            静默模式
  --stats                显示统计信息
  -t, --types            显示支持的任务类型
  --cache / --no-cache   启用/禁用缓存
  --clear-cache          清空缓存
  -c, --config FILE      配置文件路径
  --version              显示版本号
  -h, --help             显示帮助信息

📋 支持的任务类型 (13种)

类型示例
写代码"帮我写个排序"
代码审查"审查这段代码"
改写代码"重构这段代码"
写文档"帮我写个文档"
写文案"写一段推广文案"
总结摘要"帮我总结一下"
翻译"翻译成英文"
查资料"查一下深圳天气"
数据分析"分析一下这份数据"
头脑风暴"给我几个创业想法"
生成内容"生成一张图片"
数学计算"计算 123+456"
对话聊天"聊聊AI的发展"

⭐ 新功能 (v3.1)

🔧 重构优化

  • 配置分离 - config_data.py 独立配置,便于维护
  • 版本常量 - __version__ = "3.1.0",统一管理
  • 模块化 CLI - 拆分 handle_stats, handle_types 等函数

🚀 性能与功能

  • LRU 缓存 - 相同 prompt 直接返回
  • 配置文件 - 支持 config.yaml 自定义
  • 日志系统 - 实时显示优化过程

📦 项目结构

prompt-optimizer/
├── prompt_optimizer.py    # 主程序 (v3.1)
├── config_data.py         # 配置数据 (独立)
├── test_prompt_optimizer.py # 测试用例
├── config.yaml.example    # 配置示例
└── SKILL.md              # 文档

🧪 测试

python test_prompt_optimizer.py

# 结果
📊 测试结果: 31 通过, 0 失败

📝 更新日志

v3.1 (2026-04-07)

  • 配置分离 - 独立 config_data.py
  • 版本常量 - __version__ = "3.1.0"
  • 重构 main - 拆分成独立函数
  • main 入口 - 支持 python -m
  • 31 个测试 - 全部通过

v3.0 (2026-04-07)

  • ✅ LRU 缓存
  • ✅ 配置文件支持
  • ✅ 日志系统

v2.1 (2026-04-07)

  • ✅ CLI 入口
  • ✅ 错误处理

<p align="center"> <sub>Made with ❤️ by dxx</sub> </p>

Comments

Loading comments...