
Brand Voice
io.github.zoharbabin由 GitHub 帳號 zoharbabin 發布v0.1.8更新於 Oct 24, 2026
Enforce brand writing guidelines in Claude Code — PostToolUse hook + MCP server
概覽
本機 MCP 伺服器兼 Claude Code 掛鉤,依品牌規範檔案檢查 Markdown 文案,標出或修正違規內容。
- 可以做什麼
- 依品牌規範分析 Markdown 檔案或內嵌文字,回傳違規項目與可讀性分數
- 對禁用詞與避免用詞執行安全的詞級替換,可先用 dryRun 預覽差異
- 檢查禁用詞、避免用詞、句長、被動語態與可讀性等級,略過程式碼區塊、行內程式碼與表格列
- 搭配 PostToolUse 掛鉤在寫入不合規時阻擋並讓 Claude 修正重試,另提供 CLI 供 CI 檢查
- 適用情境
- 適合在 Claude Code 撰寫或修改 Markdown 時,自動套用品牌用詞、語氣與可讀性規則,不必每次提示都貼上規範。也適合想把相同檢查接進 CI 流程的團隊。
- 執行需求
- 以 Node.js 本機程序執行(需 Node.js 18 以上),透過 npm 或 npx 安裝。需要專案、使用者家目錄或上層目錄中存在 brand-guidelines.md。Vale 為選用,僅 vale-sync 指令需要。未宣告帳號、API 金鑰或環境變數。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Brand Voice,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
brand-voice
Brand writing enforcement for Claude Code — automatic, configurable, zero-friction.
[npm version] [npm downloads] [CI] [License: MIT] [Node.js 18+]
Every time Claude writes or edits a Markdown file, brand-voice checks it against your brand guidelines and signals Claude to fix violations before the file saves. No manual review. No rule reminders in every prompt.
Claude reads the violation list, corrects the file, and retries the write — automatically.
Why brand-voice?
Your brand guidelines live in a doc somewhere. Claude doesn't read them unless you paste them into every prompt. Even then, the rules drift over time.
brand-voice makes the rules structural:
- Works for any company — configure your own vocabulary, voice, and visual identity
- Auto-corrects, doesn't just report — the PostToolUse hook blocks bad writes and triggers a retry
- Covers the full stack — hook for Claude Code, MCP server for on-demand checks, CLI for CI pipelines
- Smart about code — ignores fenced blocks, indented code, inline code spans, and table cells
- Escape hatches —
.brand-voice-ignorefor whole files,<!-- brand-voice-disable-line -->for individual lines - Visual identity included — colors, fonts, logo URLs live in the same guidelines file
Install
Or run without installing:
Requires Node.js 18+.
Quick Start
Option A — Guided setup in Claude Code (recommended)
Run the setup skill inside any Claude Code session:
The skill does everything:
- Asks whether you have existing brand docs or want to answer four questions
- Optionally researches your brand automatically via web
- Writes
brand-guidelines.mdto your project - Injects a summary block into
CLAUDE.md - Registers the PostToolUse hook in
.claude/settings.json - Registers the MCP server in
.mcp.json
After setup, every .md and .mdx file Claude touches is checked automatically.
Option B — Manual setup
How It Works
Three components work together:
What gets checked
Code blocks, inline code, indented blocks, and table rows are never checked — only prose.
Never checked: physical line length or line breaks. The CLAUDE.md injection always includes a formatting rule telling Claude to write continuous paragraphs and let the renderer word-wrap, but the analyzer itself has no line-width rule and never will — sentence length is measured in words, not characters or lines, so hard-wrapped and unwrapped prose score identically.
PostToolUse hook exit codes
Exit 1 is never used (it aborts the session rather than triggering a retry).
brand-guidelines.md
One Markdown file holds your entire brand configuration. Keep it under 600 words so it fits cleanly in context.
See example/brand-guidelines.md for a complete working example.
Section aliases
## On-Brand Examples and ## Off-Brand Examples are accepted as aliases for ## On-Tone Examples / ## Off-Tone Examples. All other section names are case-insensitive exact matches.
Search path
The hook and CLI search for brand-guidelines.md in this order:
- Current working directory
~/.claude/brand-guidelines.md(user scope — enforces rules across all your projects)- Parent directories up to the git root
Suppressing Violations
Skip files or directories — .brand-voice-ignore
Create a .brand-voice-ignore file in your project root. Uses gitignore-style patterns:
Skip a single line — inline comment
Add this comment anywhere on a line to suppress all violations on that line. Useful for one-off exceptions where the violation is intentional.
MCP Server
analyze_readability
Check a file or inline text for violations and readability scores.
Inputs:
Returns: { filePath, passed, violations[], readabilityScores, visualIdentity }
apply_suggestions
Apply safe word-level substitutions for forbidden/avoid terms. Does not fix sentence length, passive voice, or grade — those need human judgment.
Inputs:
Returns: diff + change list (dry run) or confirmation + change list (live)
Tip: Run dryRun: true first to preview, then apply.
CI Integration
brand-voice works independently of Claude Code — add it to any pipeline.
Check all .md files:
Check only files changed in the current branch:
GitHub Actions inline annotations (PR diff comments):
Ratchet enforcement — block regressions without requiring a clean slate:
Example GitHub Actions workflow:
Exit 0 = clean or within baseline. Exit 1 = errors found or baseline exceeded.
CLI Reference
Programmatic API
See src/types.ts for full type definitions.
Distribution Patterns
Requirements
- Node.js 18+
brand-guidelines.md— created by/brand-voice-setupor written manually- Vale — optional; only required for
vale-sync
Contributing
Bug reports, feature requests, and pull requests are welcome. See CONTRIBUTING.md for setup instructions, key invariants to preserve, and code style guidance.
License
MIT — see LICENSE.
來源:README.md,提交 0aa31e3
工具
0版本歷史
1- v0.1.8最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分