tool-sync
Auto-sync MCP tool documentation when tools are added, removed, or renamed. Triggers: TS, tool-sync, 工具同步, 同步工具, sync tools, new tool, 新增工具, 工具變更, update tools.
Best use case
tool-sync is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Auto-sync MCP tool documentation when tools are added, removed, or renamed. Triggers: TS, tool-sync, 工具同步, 同步工具, sync tools, new tool, 新增工具, 工具變更, update tools.
Teams using tool-sync should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/tool-sync/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How tool-sync Compares
| Feature / Agent | tool-sync | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Auto-sync MCP tool documentation when tools are added, removed, or renamed. Triggers: TS, tool-sync, 工具同步, 同步工具, sync tools, new tool, 新增工具, 工具變更, update tools.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# MCP 工具文檔自動同步
## 描述
當 MCP 工具被新增、移除、重新命名時,自動同步所有相關文檔。
確保 instructions、skills、README 中的工具數量和列表永遠與程式碼一致。
## 觸發條件
以下情境**必須**觸發此 Skill:
1. 新增了 `register_*_tools()` 函數或 `@mcp.tool()` 裝飾器
2. 修改了 `tool_registry.py` 的 `TOOL_CATEGORIES`
3. 修改了 `tools/__init__.py` 的 `register_all_tools()`
4. 刪除或重新命名任何 MCP 工具
5. 用戶明確要求 "同步工具" / "tool sync"
## 自動同步的文件(共 6 個)
| # | 文件 | 更新內容 | 更新方式 |
|---|------|----------|----------|
| 1 | `presentation/mcp_server/tool_registry.py` | `TOOL_CATEGORIES` dict | 手動 — 新增/移除工具分類 |
| 2 | `presentation/mcp_server/tools/__init__.py` | `register_all_tools()` | 手動 — import + 呼叫 register 函數 |
| 3 | `presentation/mcp_server/instructions.py` | SERVER_INSTRUCTIONS 工具列表 | 🤖 `--update-docs` 自動 |
| 4 | `.github/copilot-instructions.md` | Tool Categories 表格 | 🤖 `--update-docs` 自動 |
| 5 | `.claude/skills/pubmed-mcp-tools-reference/SKILL.md` | 完整工具參考 | 🤖 `--update-docs` 自動 |
| 6 | `README.md` + `README.zh-TW.md` | 工具數量 badge | 🤖 `--update-docs` 自動 |
## 執行流程
### Step 1: 手動修改(AI Agent 負責)
確保以下兩個「源頭」檔案正確:
```python
# 1. tool_registry.py — 新增分類
TOOL_CATEGORIES = {
...
"new_category": {
"name": "新分類名稱",
"description": "分類描述",
"tools": ["tool_name_1", "tool_name_2"],
},
}
# 2. tools/__init__.py — 註冊函數
from .new_module import register_new_tools
def register_all_tools(mcp, searcher):
...
register_new_tools(mcp) # 新增呼叫
```
### Step 2: 執行自動同步腳本
```bash
uv run python scripts/count_mcp_tools.py --update-docs
```
### Step 3: 驗證
```bash
# 檢查工具數量是否正確
uv run python scripts/count_mcp_tools.py
# 檢查驗證是否通過(TOOL_CATEGORIES 與 FastMCP runtime 同步)
uv run python scripts/count_mcp_tools.py --verbose
```
### Step 4: 回報結果
```
🔄 MCP 工具同步完成
📊 統計:
- 工具總數: XX → YY (+N)
- 分類數: XX → YY (+N)
- 更新文件: N 個
📝 已更新:
✅ tool_registry.py - 新增 "image_search" 分類
✅ tools/__init__.py - 新增 register_image_search_tools
✅ instructions.py - 工具列表已同步
✅ copilot-instructions.md - Tool Categories 已同步
✅ SKILL.md (tools-reference) - 已重新生成
✅ README.md - 工具數量已更新
✅ README.zh-TW.md - 工具數量已更新
⚠️ 驗證: PASSED ✅
```
## 重要規則
### 🔴 必須遵守
1. **任何工具變更後都要執行** `count_mcp_tools.py --update-docs`
2. **先修改源頭**(tool_registry.py + tools/__init__.py),再執行腳本
3. **驗證必須通過** — `TOOL_CATEGORIES` 與 FastMCP runtime 必須同步
### ⚠️ 注意事項
- `count_mcp_tools.py` 會自動偵測 `TOOL_CATEGORIES` 中所有類別(動態取得,不再硬編碼)
- `instructions.py` 只更新工具列表區塊,搜尋策略等手寫內容不會被覆蓋
- `pubmed-mcp-tools-reference` SKILL 會完全重新生成
- CHANGELOG 更新由 `changelog-updater` skill 另行處理
## 與其他 Skill 的關係
- **git-precommit**: commit 前會呼叫本 Skill 的同步步驟
- **git-doc-updater**: 文檔更新時也會觸發工具同步檢查
- **ddd-architect**: 新增功能模組時會提醒執行工具同步Related Skills
pubmed-mcp-tools-reference
Complete reference for all 46 PubMed Search MCP tools. Triggers: 工具列表, all tools, 完整功能, tool reference, 有哪些工具
academic-figure-drawing-harness
Codex drawing harness integration. Triggers: 繪圖, draw, figure, chart, plot, mermaid, SVG, Gemini, graph, 生成圖表.
zotero-keeper-harness
Cline harness for Zotero Keeper and the bundled VS Code extension. Triggers: zotero keeper, zotero mcp, full check, release checklist, workflow, vsix, Cline.
pubmed-search-mcp-harness
Cline harness for PubMed Search MCP. Triggers: pubmed search, literature search, unified_search, pipeline, fulltext, release checklist, Cline.
llm-wiki-builder
Build or refresh Foam-compatible LLM wikis from Zotero, PubMed, documents, and local Markdown notes using a multi-tool workflow.
asset-aware-mcp-harness
Cline harness for this repo (rules + workflows + checks). Triggers: cline harness, full check, release checklist, workflow, 文檔工作流, DFM, citation-ready.
test-generator
Generate comprehensive test suites including static analysis, unit tests, integration tests, E2E tests, and coverage reports. Triggers: TG, test, 測試, 寫測試, coverage, 覆蓋率, pytest, unittest, 驗證.
roadmap-updater
Auto-update ROADMAP.md status based on completed features. Triggers: RM, roadmap, 路線, 規劃, 完成功能, milestone, 里程碑.
readme-updater
Intelligently update README.md to sync with code changes. Triggers: readme, 說明, 更新說明, update readme, 文檔同步.
readme-i18n
Maintain multilingual README versions (English primary, Chinese translation). Triggers: i18n, 翻譯, translate, 多語言, sync readme, 中英文, bilingual.
pubmed-systematic-search
Comprehensive search using generate_search_queries and unified_search. Triggers: 系統性搜尋, 完整搜尋, 文獻回顧, systematic search, comprehensive, MeSH expansion, 同義詞
pubmed-quick-search
Quick literature search using unified_search. Triggers: 搜尋, 找論文, search papers, find articles, PubMed, 文獻搜尋, 快速搜尋