tool-sync

Auto-sync MCP tool documentation when tools are added, removed, or renamed. Triggers: TS, tool-sync, 工具同步, 同步工具, sync tools, new tool, 新增工具, 工具變更, update tools.

9 stars

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

$curl -o ~/.claude/skills/tool-sync/SKILL.md --create-dirs "https://raw.githubusercontent.com/u9401066/pubmed-search-mcp/main/.claude/skills/tool-sync/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/tool-sync/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How tool-sync Compares

Feature / Agenttool-syncStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/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

9
from u9401066/pubmed-search-mcp

Complete reference for all 46 PubMed Search MCP tools. Triggers: 工具列表, all tools, 完整功能, tool reference, 有哪些工具

academic-figure-drawing-harness

9
from u9401066/pubmed-search-mcp

Codex drawing harness integration. Triggers: 繪圖, draw, figure, chart, plot, mermaid, SVG, Gemini, graph, 生成圖表.

zotero-keeper-harness

9
from u9401066/pubmed-search-mcp

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

9
from u9401066/pubmed-search-mcp

Cline harness for PubMed Search MCP. Triggers: pubmed search, literature search, unified_search, pipeline, fulltext, release checklist, Cline.

llm-wiki-builder

9
from u9401066/pubmed-search-mcp

Build or refresh Foam-compatible LLM wikis from Zotero, PubMed, documents, and local Markdown notes using a multi-tool workflow.

asset-aware-mcp-harness

9
from u9401066/pubmed-search-mcp

Cline harness for this repo (rules + workflows + checks). Triggers: cline harness, full check, release checklist, workflow, 文檔工作流, DFM, citation-ready.

test-generator

9
from u9401066/pubmed-search-mcp

Generate comprehensive test suites including static analysis, unit tests, integration tests, E2E tests, and coverage reports. Triggers: TG, test, 測試, 寫測試, coverage, 覆蓋率, pytest, unittest, 驗證.

roadmap-updater

9
from u9401066/pubmed-search-mcp

Auto-update ROADMAP.md status based on completed features. Triggers: RM, roadmap, 路線, 規劃, 完成功能, milestone, 里程碑.

readme-updater

9
from u9401066/pubmed-search-mcp

Intelligently update README.md to sync with code changes. Triggers: readme, 說明, 更新說明, update readme, 文檔同步.

readme-i18n

9
from u9401066/pubmed-search-mcp

Maintain multilingual README versions (English primary, Chinese translation). Triggers: i18n, 翻譯, translate, 多語言, sync readme, 中英文, bilingual.

pubmed-systematic-search

9
from u9401066/pubmed-search-mcp

Comprehensive search using generate_search_queries and unified_search. Triggers: 系統性搜尋, 完整搜尋, 文獻回顧, systematic search, comprehensive, MeSH expansion, 同義詞

pubmed-quick-search

9
from u9401066/pubmed-search-mcp

Quick literature search using unified_search. Triggers: 搜尋, 找論文, search papers, find articles, PubMed, 文獻搜尋, 快速搜尋