ClaudeMods
☰
ZH-TW
● 0 人在線上 · 瀏覽 0 次
贊助提交作品
GitHub 儲存庫 · 發布者 Vatroslav

cc-mod-suggestion-sentence-case

一個 Claude Code 外掛,它的 prompt.suggest hook 會重寫由 Tab 接受的灰色提示詞建議,讓建議以大寫字母開頭、句號結尾,同時保持斜線指令不變。

Vatroslav@Vatroslav

Vatroslav/cc-mod-suggestion-sentence-case/tree/main/plugin

已翻譯

關於這個 mod

一個 Claude Code 外掛。每輪結束後,Claude Code 會在空白提示列中用灰色文字提出下一個提示詞,按 Tab 即可接受。建議通常以小寫開頭且沒有句號;如果你把提示詞寫成句子,每次接受後都要在送出前修正。這個外掛會在建議顯示前重寫它:以大寫字母開頭,以句號結尾。

| Suggested | Shown | |---|---| | run the tests | Run the tests. | | why did it fail? | Why did it fail? | | čekaj da završi | Čekaj da završi. | | `npm test` again | `npm test` again. | | /commit | /commit |

規則

  • 只有第一個字元是字母時才會將它大寫。以程式碼、引號或數字開頭的建議會保留開頭。
  • 在 ., ?, !, … 或 : 後不會加入句號。
  • 斜線指令保持原樣。
  • 會去掉兩端的空格。
  • 只有建議會改變。你輸入或送出的任何內容都不會被碰觸。

運作方式

plugin/hooks/register.ts 中的一個 prompt.suggest hook 會重寫文字,並透過 next({ ...e, text }) 傳遞下去。它在 $ 上不呼叫任何東西:沒有檔案、程序、網路或模型呼叫。

它會處理所有建議,包括 Claude Code 自己的建議,以及其他外掛透過 $.prompt.suggest 提出的建議。

安裝

claude plugin marketplace add <path-to-this-repo>
claude plugin install cc-mod-suggestion-sentence-case@cc-mod-suggestion-sentence-case --scope user

在 2.1.287 之前的 Claude Code 建置中,已安裝外掛的函式 hook 可能需要在 ~/.claude/settings.json 的 env 區塊加入 "CLAUDE_CODE_ENABLE_FUNCTION_HOOKS": "1"。已在 Claude Desktop 的 Code 分頁中即時驗證。

檢查和測試:claude plugin validate ./plugin 與 claude plugin test ./plugin。

安裝

請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。

claude plugin marketplace add Vatroslav/cc-mod-suggestion-sentence-case
claude plugin install cc-mod-suggestion-sentence-case
原文 / README

cc-mod-suggestion-sentence-case

A Claude Code mod. After a turn, Claude Code proposes your next prompt as dim text in the empty prompt box, and Tab accepts it. The suggestion often comes in lowercase and without a full stop, so if you write your prompts as sentences, every accepted suggestion needs fixing before you send it. This mod rewrites the suggestion before it is shown: it starts with a capital letter and ends with a full stop.

| Suggested | Shown | |---|---| | run the tests | Run the tests. | | why did it fail? | Why did it fail? | | čekaj da završi | Čekaj da završi. | | `npm test` again | `npm test` again. | | /commit | /commit |

Rules

  • The first character is capitalized only if it is a letter. A suggestion that starts with code, a quote or a digit keeps its start.
  • No full stop is added after ., ?, !, … or :.
  • A slash command stays exactly as it is.
  • Spaces at either end are trimmed.
  • Only the suggestion changes. Nothing you type or send is touched.

How it works

One prompt.suggest hook in plugin/hooks/register.ts rewrites the text and passes it on with next({ ...e, text }). It calls nothing on $: no files, processes, network or model calls.

It handles every suggestion, both Claude Code's own and any that another plugin proposes through $.prompt.suggest.

Install

claude plugin marketplace add <path-to-this-repo>
claude plugin install cc-mod-suggestion-sentence-case@cc-mod-suggestion-sentence-case --scope user

On Claude Code builds before 2.1.287, function hooks of installed plugins may need "CLAUDE_CODE_ENABLE_FUNCTION_HOOKS": "1" in the env block of ~/.claude/settings.json. Verified live in the Code tab of Claude Desktop.

Check and test: claude plugin validate ./plugin and claude plugin test ./plugin.

更多類似作品