ClaudeMods
☰
ZH-CN
● 0 人在线 · 浏览 0 次
赞助提交作品
GitHub 仓库 · 发布者 MiguelMachado-dev

prompt-enhancer

一个 Claude Code 外挂,使用高 effort 的 Sonnet 5.5 重写提示,并将结果放回提示框供你审核后再发送。重写遵循 [Opus 5.5 prompting guide](https://claude.dev/blog/getting-the-most-out-of-opus-5-5/):整项任务放在一条消息中、为改动说明“完成意味着什么”、说明何时停止并询问,以及不使用“think step by step”或强调语气。它保留提示的语言,只读取工作目录和最近几条消息,将“那个 bug”之类的指代变成具体名称。

MiguelMachado-dev@MiguelMachado-dev

MiguelMachado-dev/miguel-mods/tree/main/prompt-enhancer

已翻译

关于这个 mod

需要 Claude Code 2.1.287 或更高版本。

隐私:外挂发送什么、发送到哪里。

用法

  • 在提示末尾加上 ++ 并按 Enter:提示不会发送,重写结果会回到输入框。不会有内容进入对话。
  • /enhance <prompt> 的作用相同,但命令及其输出会留在对话中。
  • /enhance-undo 会放回原始提示。

如果调用失败,你写下的提示会原样回到输入框。

为了捕获 ++,外挂会钩住 prompt.submit。它只处理在提示框中输入且以 ++ 结尾的提示,并将其拦住而不发送。其他所有提示(包括由另一个外挂提交的提示)都会原样通过。

它发送什么、发送到哪里

每次增强都是一次通过 Claude Code 发出的 claude-sonnet-5-5 模型调用,使用你自己的方案或 API 密钥,因此会计入用量。调用会携带:

  • 你要求增强的提示
  • 本次会话的工作目录路径
  • 对话中最近 6 条含有文本的消息,每条截断为 1,200 个字符,总计截断为 6,000 个字符

不会发送到其他地方。外挂会在自己的状态中保存上一次的原始提示及其重写结果,以便 /enhance-undo 恢复,而且不会读取文件。

安装

在 Claude Code 中:

/plugin marketplace add MiguelMachado-dev/miguel-mods
/plugin install prompt-enhancer@miguel-mods
/reload-plugins

如果 /enhance 没有出现,请重启 Claude Code。

外挂在你的机器上运行于 Claude Code 内部,拥有 Claude Code 相同的访问权限。安装前请阅读 hooks 中的源代码。

许可证

MIT。请参阅 LICENSE。

安装

请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。

claude plugin marketplace add MiguelMachado-dev/miguel-mods
claude plugin install prompt-enhancer
原文 / README

prompt-enhancer

A Claude Code mod that rewrites a prompt with Sonnet 5.5 at high effort and puts the result back in the prompt box, so you review it before sending. The rewrite follows the Opus 5.5 prompting guide: the whole task in one message, a "done means" line for changes, when to stop and ask, and no "think step by step" or emphasis. It keeps the language of your prompt, and reads the working directory and the last few messages only to turn references like "that bug" into concrete names.

Needs Claude Code 2.1.287 or later.

Privacy: what the mod sends and where.

Usage

  • End a prompt with ++ and press Enter: the prompt is not sent, and the rewrite comes back to the box. Nothing enters the conversation.
  • /enhance <prompt> does the same, but the command and its output stay in the conversation.
  • /enhance-undo puts the original back.

If the call fails, your prompt comes back to the box as you wrote it.

To catch ++, the mod hooks prompt.submit. It acts only on a prompt typed in the prompt box that ends with ++, which it holds back instead of sending. Every other prompt, including one that another mod submits, passes through unchanged.

What it sends and where

Each enhancement is one model call to claude-sonnet-5-5 made through Claude Code, on your own plan or API key, so it counts toward your usage. The call carries:

  • the prompt you asked to enhance
  • the path of the session's working directory
  • up to the last 6 messages of the conversation that have text, each cut at 1,200 characters and 6,000 in total

Nothing is sent anywhere else. The mod keeps the last original prompt and its rewrite in its own state so /enhance-undo can restore it, and it reads no files.

Install

In Claude Code:

/plugin marketplace add MiguelMachado-dev/miguel-mods
/plugin install prompt-enhancer@miguel-mods
/reload-plugins

If /enhance doesn't show up, restart Claude Code.

A mod runs inside Claude Code on your machine with the same access Claude Code has. Read the source in hooks before installing.

License

MIT. See LICENSE.

更多类似作品