roseduan

Better Phrase — Development skill for Claude Code

Development community

Better Phrase — English phrasing polish via Claude Code hook.

How to install Better Phrase

This entry records only its repository, not the path inside it, so there is no exact command to give. Open roseduan/better-phrase and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Better Phrase does

Better Phrase — English phrasing polish via Claude Code hook.

Alternatives in Development

README

Better Phrase

Better Phrase

**润色你的英文措辞,装进 Claude Code。**

[![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

**中文** · [English](README.en.md)


演示效果

写英文时:

✦ **Better Phrase** (1ms)

✏️ **English tip:**

  • "I very like" → "I really like" — very 不能直接修饰动词。
  • "open the light" → "turn on the light" — 开灯用 turn on

✍️ Better Phrase: "I really like coding with Claude — turn on the lights, start typing, and it just works."

写中文时:

✦ **Better Phrase** (1ms)

🌐 **English:** "I'd like to schedule a meeting with the client next Tuesday to go over the contract details."

写代码、敲命令、或者不需要翻译的中文 — **完全静默**,0 token,0 干扰。

为什么不是 skill

"判断这条 prompt 是不是英文"是一道 yes/no 题。让 LLM 每次重新判断,看似等价,token 成本和触发可靠性完全不一样。

如果做成 skill(让 LLM 决定调用) Better Phrase(hook + 代码过滤)
触发判定 每条 prompt 都要 LLM 判断要不要调用 Python 正则确定性判定,0 模型成本
Token 成本 skill 描述常驻上下文,每条消息都加载 只在检测到英文时才注入指令
触发可靠性 模型可能漏调用 / 调用时机错 100% 一致,不依赖模型记性
非英文场景 就算最终不调用,描述也已经占了 token 0 token,hook 直接退出

skill 适合"AI 该不该用 X 工具"这种需要判断的场景。语言检测是一道 **yes/no 题**,写在代码里更便宜也更稳。

特性

  • ✏️ 英文润色 — 语法 / 词汇 / 表达地道度修正 + native rewrite
  • 🌐 中文 → 英文翻译 — 地道英文版(可开关)
  • 🎯 零干扰 — 代码 / 命令 / 不相关输入完全不触发
  • 🇨🇳 中文讲解 — tip 用中文解释,聚焦常见中式英语模式
  • 🚀 启动开销可忽略 — 相对 Claude 自身的响应延迟完全感知不到
  • 🔒 100% 本地 — 无 API 调用,无遥测,数据永不出本机

系统要求

  • Claude Code 已经装好并能正常使用
  • Python 3.9+(macOS / 多数 Linux 默认自带)
  • git — 安装脚本用来拉取源码
    • macOS: brew install git(通常 Xcode CLI tools 自带)
    • Linux: sudo apt install git(或对应发行版)

安装

方式 A:一行命令(推荐)

curl -fsSL https://betterphrase.roseduan.cn/install.sh | bash

自动 clone 到 `~/.claude/skills/better-phrase/`,把 `UserPromptS