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

dashless

一个 Claude Code 插件,在 Claude 的回复、Write/Edit 工具内容以及 git commit / gh pr 消息落地前移除 em dash 和 en dash,并显示状态行计数器。

0xGondarxyz@0xGondarxyz

0xGondarxyz/claude-code-mods/tree/main/dashless

已翻译

关于这个 mod

dashless

在 Claude 写入内容落地前移除 em dash。约 80 行 TypeScript。

| 位置 | 修正内容 | | --- | --- | | Write 工具 | 文件内容 | | Edit 工具 | 仅 new_string(old_string 必须匹配文件,因此不会被触碰) | | Bash | 仅处理 git commit 和 gh pr / gh issue 的 create、edit、comment;其他命令照常运行 | | 回复 | Claude 回复中的文本块,在存储前处理 |

改写规则:

| 输入 | 输出 | | --- | --- | | 单词之间的 em dash | 改为逗号分隔形式 | | 行首的 em dash | 移除,保留缩进 | | 行尾的 em dash | 移除 | | 带空格的 en dash | 改为逗号分隔形式 | | 数字范围中的 en dash | 保持不变 | | --force、-- file | 保持不变 |

状态行显示累计计数:dashless: 3 em dashes fixed。

在一次性 git 仓库中用同一提示运行两次进行测试(写入文件、提交、用带 em dash 的句子回复,每项都带一个 em dash)。没有插件时落地了 4 个 em dash;启用插件后是 0。

运行测试:claude plugin test dashless

安装

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

claude plugin marketplace add 0xGondarxyz/claude-code-mods
claude plugin install dashless
原文 / README

dashless

Removes em dashes from what Claude writes, before it lands. About 80 lines of TypeScript.

| Where | What gets fixed | | --- | --- | | Write tool | the file content | | Edit tool | new_string only (old_string must match the file, so it is never touched) | | Bash | only git commit and gh pr / gh issue create, edit, comment; every other command runs as is | | Replies | text blocks in Claude's responses, before they are stored |

Rewrite rules (<code>—</code> is the em dash, <code>–</code> the en dash):

<!-- Dashes in this file are HTML entities on purpose. With literal characters, dashless rewrites its own examples whenever Claude edits this file. -->

| Input | Output | | --- | --- | | <code>a — b</code>, <code>a—b</code> | a, b | | <code>— item</code> at line start | item (indentation kept) | | <code>done —</code> at line end | done | | <code>note: — x</code> | note: x | | <code>a – b</code> (spaced en dash) | a, b | | <code>1990–2000</code> (range) | unchanged | | --force, -- file | unchanged |

The status line shows a running count: dashless: 3 em dashes fixed.

Tested by running the same prompt twice in a throwaway git repo (write a file, commit it, reply with a sentence, each with an em dash). Without the mod 4 em dashes landed; with it, 0.

Run its tests: claude plugin test dashless

更多类似作品