重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
npx skills add https://github.com/terrylica/cc-skills --skill glossary-management管理全局术语表 (~/.claude/docs/GLOSSARY.md) 及其与 Vale 的集成。该术语表是所有项目中术语的唯一可信来源。
在以下情况时使用:
# 手动同步到 Vale
bun ~/.claude/tools/bin/glossary-sync.ts
# 检查跨项目的重复/冲突(调用 terminology-sync 钩子)
bun ~/eon/cc-skills/plugins/itp-hooks/hooks/posttooluse-terminology-sync.ts <<< '{"tool_name":"Edit","tool_input":{"file_path":"/tmp/test-CLAUDE.md"}}'
┌─────────────────────────────────────────────────────────────────┐
│ GLOSSARY.md (SSoT) │
│ ~/.claude/docs/GLOSSARY.md │
└─────────────────────────┬───────────────────────────────────────┘
│
┌───────────────┼───────────────┐
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌───────────┐ ┌────────────────────┐
│ accept.txt │ │ Term.yml │ │ Project CLAUDE.md │
│ (Vale vocab) │ │ (subs) │ │ (bidirectional) │
└─────────────────┘ └───────────┘ └────────────────────┘
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
术语同步钩子使用 SCAN_PATHS 来发现项目 CLAUDE.md 文件。这通过 GLOSSARY.md 中的一个 HTML 注释进行配置:
<!-- SCAN_PATHS:
- ~/eon/*/CLAUDE.md
- ~/eon/*/*/CLAUDE.md
- ~/.claude/docs/GLOSSARY.md
-->
格式规则:
<!-- SCAN_PATHS: 开头的 HTML 注释- 为前缀*, **)~)默认路径(如果未指定):
~/eon/*/CLAUDE.md - 顶级项目 CLAUDE.md 文件~/eon/*/*/CLAUDE.md - 包级 CLAUDE.md 文件GLOSSARY.md 中的每个术语都遵循此 5 列格式:
| 列 | 必需 | 描述 | 示例 |
|---|---|---|---|
| 术语 | 是 | 粗体术语名称(**Term**) | **Time-Weighted Sharpe** |
| 缩写 | 是 | 缩写(如果没有则为 -) | TWSR |
| 定义 | 是 | 清晰、简洁的定义 | Sharpe ratio for range bars |
| 单位/范围 | 是 | 度量单位或有效范围 | ratio, [0, 1], - |
| 项目 | 是 | 逗号分隔的项目名称 | alpha-forge, trading-fitness |
示例行:
| **Time-Weighted Sharpe** | TWSR | Sharpe ratio for variable-duration bars using time weights | annualized ratio | alpha-forge |
两个 PostToolUse 钩子处理自动同步:
| 钩子 | 触发条件 | 动作 |
|---|---|---|
posttooluse-glossary-sync | 编辑 ~/.claude/docs/GLOSSARY.md | 同步到 Vale 词汇表 |
posttooluse-terminology-sync | 编辑项目 CLAUDE.md | 合并术语 → GLOSSARY.md,检测冲突 |
当自动同步失败或需要强制刷新时:
bun ~/.claude/tools/bin/glossary-sync.ts
输出:
=== Glossary Bidirectional Sync ===
Source: /Users/you/.claude/docs/GLOSSARY.md
Found 25 acronyms, 24 substitutions
Updated: .vale/styles/config/vocabularies/TradingFitness/accept.txt
Total terms: 27
Updated: .vale/styles/TradingFitness/Terminology.yml
Substitution rules: 24
Updated timestamp: 2026-01-22T00:00:00Z
=== Sync Complete ===
检查 GLOSSARY.md 是否遵循正确的表格格式:
# 检查必需的列
grep -E '^\| \*\*[^|]+\*\* \|' ~/.claude/docs/GLOSSARY.md | head -5
# 验证表格结构(应包含 | Term | Acronym | Definition | Unit/Range | Projects |)
head -25 ~/.claude/docs/GLOSSARY.md
预期格式:
| Term | Acronym | Definition | Unit/Range | Projects |
| ------------------------ | ------- | --------------------------- | ---------- | ----------- |
| **Time-Weighted Sharpe** | TWSR | Sharpe ratio for range bars | ratio | alpha-forge |
扫描所有项目 CLAUDE.md 文件以查找术语冲突:
# 完整重复项检查(扫描 ~/eon/*/CLAUDE.md)
bun ~/eon/cc-skills/plugins/itp-hooks/hooks/posttooluse-terminology-sync.ts <<< '{"tool_name":"Edit","tool_input":{"file_path":"/tmp/test-CLAUDE.md"}}'
检测到的冲突类型:
要向术语表添加新术语:
直接编辑 GLOSSARY.md:
| New Term | NT | Definition of the new term | - | project-name |
同步将通过 posttooluse-glossary-sync 钩子自动触发
验证 Vale 是否识别它:
echo "The NT is important" | vale --config=~/.claude/.vale.ini
| 文件 | 用途 |
|---|---|
~/.claude/.vale/styles/config/vocabularies/TradingFitness/accept.txt | 接受的术语(不会被标记) |
~/.claude/.vale/styles/TradingFitness/Terminology.yml | 替换规则(建议规范形式) |
# 检查单个文件(从文件所在目录运行以使通配符模式匹配)
cd ~/eon/trading-fitness && vale --config=~/.claude/.vale.ini CLAUDE.md
# 检查所有 CLAUDE.md 文件
find ~/eon -name "CLAUDE.md" -exec sh -c 'cd "$(dirname "$1")" && vale --config=~/.claude/.vale.ini "$(basename "$1")"' _ {} \;
重要:.vale.ini 中的 Vale 通配符模式(如 [CLAUDE.md])是相对于当前工作目录的。始终从文件所在目录运行 Vale,或使用匹配通配符模式的绝对路径。
检查同步时间戳:
grep "Last Sync" ~/.claude/docs/GLOSSARY.md
强制手动同步:
bun ~/.claude/tools/bin/glossary-sync.ts
验证 Vale 配置路径:
cat ~/.claude/.vale.ini | grep StylesPath
检查钩子是否已注册:
grep "glossary-sync" ~/.claude/settings.json
验证钩子文件是否存在:
ls -la ~/.claude/plugins/marketplaces/cc-skills/plugins/itp-hooks/hooks/posttooluse-glossary-sync.ts
当 Vale 的通配符模式与文件路径不匹配时会发生这种情况。posttooluse-vale-claude-md.ts 钩子通过以下方式处理此问题:
.vale.ini如果手动运行 Vale,请确保您在文件所在目录:
# 错误 - 可能显示 "0 files"
vale --config=/path/to/.vale.ini /absolute/path/to/CLAUDE.md
# 正确 - 先 cd
cd /absolute/path/to && vale --config=/path/to/.vale.ini CLAUDE.md
如果看到 Vale 不一致:
# 检查重复的词汇表目录(应仅包含 config/vocabularies/)
ls -la ~/.claude/.vale/styles/
# 删除任何过时的 Vocab/ 目录
rm -rf ~/.claude/.vale/styles/Vocab/
~/.claude/docs/GLOSSARY.md(本地文件)每周安装数
66
仓库
GitHub 星标数
26
首次出现
2026年1月24日
安全审计
安装于
opencode62
gemini-cli61
codex60
cursor59
github-copilot59
amp58
Manage the global terminology glossary (~/.claude/docs/GLOSSARY.md) and its Vale integration. The glossary is the Single Source of Truth (SSoT) for terminology across all projects.
Use when:
# Manual sync to Vale
bun ~/.claude/tools/bin/glossary-sync.ts
# Check for duplicates/conflicts across projects (invokes terminology-sync hook)
bun ~/eon/cc-skills/plugins/itp-hooks/hooks/posttooluse-terminology-sync.ts <<< '{"tool_name":"Edit","tool_input":{"file_path":"/tmp/test-CLAUDE.md"}}'
┌─────────────────────────────────────────────────────────────────┐
│ GLOSSARY.md (SSoT) │
│ ~/.claude/docs/GLOSSARY.md │
└─────────────────────────┬───────────────────────────────────────┘
│
┌───────────────┼───────────────┐
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌───────────┐ ┌────────────────────┐
│ accept.txt │ │ Term.yml │ │ Project CLAUDE.md │
│ (Vale vocab) │ │ (subs) │ │ (bidirectional) │
└─────────────────┘ └───────────┘ └────────────────────┘
The terminology sync hook uses SCAN_PATHS to discover project CLAUDE.md files. This is configured via an HTML comment in GLOSSARY.md:
<!-- SCAN_PATHS:
- ~/eon/*/CLAUDE.md
- ~/eon/*/*/CLAUDE.md
- ~/.claude/docs/GLOSSARY.md
-->
Format rules :
<!-- SCAN_PATHS:- prefix*, **)~)Default paths (if not specified):
~/eon/*/CLAUDE.md - Top-level project CLAUDE.md files~/eon/*/*/CLAUDE.md - Package-level CLAUDE.md filesEvery term in GLOSSARY.md follows this 5-column format:
| Column | Required | Description | Example |
|---|---|---|---|
| Term | Yes | Bold term name (**Term**) | **Time-Weighted Sharpe** |
| Acronym | Yes | Abbreviation (or - if none) | TWSR |
| Definition | Yes | Clear, concise definition | Sharpe ratio for range bars |
Example row :
| **Time-Weighted Sharpe** | TWSR | Sharpe ratio for variable-duration bars using time weights | annualized ratio | alpha-forge |
Two PostToolUse hooks handle automatic sync:
| Hook | Trigger | Action |
|---|---|---|
posttooluse-glossary-sync | Edit ~/.claude/docs/GLOSSARY.md | Sync to Vale vocabulary |
posttooluse-terminology-sync | Edit project CLAUDE.md | Merge terms → GLOSSARY.md, detect conflicts |
When automatic sync fails or you need to force a refresh:
bun ~/.claude/tools/bin/glossary-sync.ts
Output :
=== Glossary Bidirectional Sync ===
Source: /Users/you/.claude/docs/GLOSSARY.md
Found 25 acronyms, 24 substitutions
Updated: .vale/styles/config/vocabularies/TradingFitness/accept.txt
Total terms: 27
Updated: .vale/styles/TradingFitness/Terminology.yml
Substitution rules: 24
Updated timestamp: 2026-01-22T00:00:00Z
=== Sync Complete ===
Check that GLOSSARY.md follows the correct table format:
# Check required columns
grep -E '^\| \*\*[^|]+\*\* \|' ~/.claude/docs/GLOSSARY.md | head -5
# Verify table structure (should have | Term | Acronym | Definition | Unit/Range | Projects |)
head -25 ~/.claude/docs/GLOSSARY.md
Expected format :
| Term | Acronym | Definition | Unit/Range | Projects |
| ------------------------ | ------- | --------------------------- | ---------- | ----------- |
| **Time-Weighted Sharpe** | TWSR | Sharpe ratio for range bars | ratio | alpha-forge |
Scan all project CLAUDE.md files for terminology conflicts:
# Full duplicate check (scans ~/eon/*/CLAUDE.md)
bun ~/eon/cc-skills/plugins/itp-hooks/hooks/posttooluse-terminology-sync.ts <<< '{"tool_name":"Edit","tool_input":{"file_path":"/tmp/test-CLAUDE.md"}}'
Conflict types detected :
To add a new term to the glossary:
Edit GLOSSARY.md directly :
| New Term | NT | Definition of the new term | - | project-name |
Sync will auto-trigger via posttooluse-glossary-sync hook
Verify Vale recognizes it :
echo "The NT is important" | vale --config=~/.claude/.vale.ini
| File | Purpose |
|---|---|
~/.claude/.vale/styles/config/vocabularies/TradingFitness/accept.txt | Accepted terms (won't be flagged) |
~/.claude/.vale/styles/TradingFitness/Terminology.yml | Substitution rules (suggests canonical form) |
# Check a single file (run from file's directory for glob patterns to match)
cd ~/eon/trading-fitness && vale --config=~/.claude/.vale.ini CLAUDE.md
# Check all CLAUDE.md files
find ~/eon -name "CLAUDE.md" -exec sh -c 'cd "$(dirname "$1")" && vale --config=~/.claude/.vale.ini "$(basename "$1")"' _ {} \;
Important : Vale glob patterns in .vale.ini (like [CLAUDE.md]) are relative to cwd. Always run Vale from the file's directory or use absolute paths with matching glob patterns.
Check sync timestamp :
grep "Last Sync" ~/.claude/docs/GLOSSARY.md
Force manual sync :
bun ~/.claude/tools/bin/glossary-sync.ts
Verify Vale config path :
cat ~/.claude/.vale.ini | grep StylesPath
Check hook is registered :
grep "glossary-sync" ~/.claude/settings.json
Verify hook file exists :
ls -la ~/.claude/plugins/marketplaces/cc-skills/plugins/itp-hooks/hooks/posttooluse-glossary-sync.ts
This happens when Vale's glob patterns don't match the file path. The posttooluse-vale-claude-md.ts hook handles this by:
.vale.iniIf running Vale manually, ensure you're in the file's directory:
# Wrong - may show "0 files"
vale --config=/path/to/.vale.ini /absolute/path/to/CLAUDE.md
# Correct - cd first
cd /absolute/path/to && vale --config=/path/to/.vale.ini CLAUDE.md
If you see Vale inconsistencies:
# Check for duplicate vocab dirs (should only have config/vocabularies/)
ls -la ~/.claude/.vale/styles/
# Remove any stale Vocab/ directory
rm -rf ~/.claude/.vale/styles/Vocab/
~/.claude/docs/GLOSSARY.md (local file)Weekly Installs
66
Repository
GitHub Stars
26
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode62
gemini-cli61
codex60
cursor59
github-copilot59
amp58
GitHub Actions 官方文档查询助手 - 精准解答 CI/CD 工作流问题
47,200 周安装
| Unit/Range | Yes | Measurement unit or valid range | ratio, [0, 1], - |
| Projects | Yes | Comma-separated project names | alpha-forge, trading-fitness |