MiguelMachado-dev/miguel-mods/tree/main/prompt-enhancer
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」之類的指代轉成具體名稱。
關於這個 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-undoputs 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.
