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

dash-guard

一個 Claude Code mod:拒絕 Claude 寫入含有 em dash、en dash 或作為標點使用的雙連字號之 prose,並告訴 Claude 要重寫哪些行。

mutlumehmet@mutlumehmet

mutlumehmet/claude-plugins/tree/main/plugins/dash-guard

原貼文圖片1
已翻譯

關於這個 mod

dash-guard 是一個透過阻擋引入 em dash、en dash 或作為標點的雙連字號來約束 prose 風格的 Claude Code 外掛。它會檢查 Markdown 與文字檔案上的 Write、Edit 呼叫,以及你設定的 MCP 工具名稱,同時讓程式碼檔案、圍欄程式碼、行內程式碼、HTML 註解與 CLI flags 保持不變。編輯前已經存在的 dash 不會再次回報,因此舊檔案仍可編輯。它提供 /dash-guard off|on 工作階段開關,可設定禁止的 dash 類型與 MCP 工具正規表示式,不進行網路呼叫或遙測,並附有 Claude Code 2.1.287 或更新版本的安裝說明。

安裝

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

claude plugin marketplace add mutlumehmet/claude-plugins
claude plugin install dash-guard
原文 / README

dash-guard

A Claude Code mod that refuses prose Claude writes with an em dash, an en dash or a double hyphen used as punctuation, and tells Claude which lines to rewrite. Part of claude-plugins.

What it does

  • Checks Write and Edit on Markdown and text files, and any MCP tool you name (a document, an email, a message).
  • Leaves code alone: code files, fenced blocks, inline code, HTML comments, and CLI flags such as git reset --hard.
  • Lines that already had a dash before the edit are not reported, so old files can still be edited.
  • /dash-guard off|on for the session.
  • It is a style rule, not a safety check: if the mod fails, the write goes through.

Settings

| Setting | Default | What it does | |---|---|---| | banned | all three | Comma separated: em, en, double | | tools | empty | A regular expression of MCP tool names to check too, such as ^mcp__notion__.*(create\|update).*$ |

What it reads and does

  • Reads: the text Claude is about to write with Write and Edit, the current file for an Edit (to tell new dashes from ones already there), and the text of MCP tools named in the tools setting.
  • Does: refuses a write that adds an em dash, an en dash or a double hyphen in prose, and tells Claude which lines to rewrite.
  • Hooks: tool.call on Write, Edit and the matching MCP tools may refuse that one call; it never changes a call's input. command.run answers its own /dash-guard command and no other.
  • Privacy: see PRIVACY.md.
  • Never: sends anything anywhere (no network calls, no telemetry).

Install

Needs Claude Code 2.1.287 or later (mods). Tested on 2.1.289.

/plugin marketplace add mutlumehmet/claude-plugins
/plugin install dash-guard@mehmetmutlu

A mod runs inside Claude Code with your permissions. Read the code before you install any mod. Settings are asked for at install, or later with /plugin configure dash-guard@mehmetmutlu.

Known gaps

  • Chat replies are not checked, only what is written to files and tools.
  • A shell heredoc (cat > file) goes around it.

About

Mehmet Mutlu: work that's shipped, at mehmetmutlu.dev

Made by Mehmet Mutlu, part of claude-plugins. More of his work at mehmetmutlu.dev.

License

MIT

更多類似作品