How this skill is triggered — by the user, by Claude, or both
Slash command
/mcp-tools:mcp-cloneThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
直接 clone 指定的 GitHub repo 到當前 MCP 專案的 `references/` 資料夾,自動分析可借鏡的功能並產生升級建議。
直接 clone 指定的 GitHub repo 到當前 MCP 專案的 references/ 資料夾,自動分析可借鏡的功能並產生升級建議。
搜尋競品請用 /mcp-tools:mcp-clone-references
手動升級分析請用 /mcp-tools:mcp-upgrade
$1 = GitHub URL(必要,如 https://github.com/user/repo)$2 = 目標 MCP 專案名稱(可選,如 che-apple-mail-mcp)
--list:列出所有 MCP 專案的 references從 $1 提取:
REPO_OWNER: GitHub 使用者/組織名REPO_NAME: repo 名稱CLONE_URL: 完整 clone URL# 支援多種 URL 格式
# https://github.com/user/repo
# https://github.com/user/repo.git
# [email protected]:user/repo.git
情況 A:$2 有指定 → 直接使用
MCP_PROJECT_DIR=~/Library/CloudStorage/Dropbox/che_workspace/projects/mcp/$2
情況 B:cwd 是 MCP 專案(有 Package.swift 或 pyproject.toml 或 mcpb/)→ 使用 cwd
情況 C:都沒有 → 列出 ~/Library/CloudStorage/Dropbox/che_workspace/projects/mcp/ 下的 MCP 專案,讓使用者選
ls -d ~/Library/CloudStorage/Dropbox/che_workspace/projects/mcp/che-*/
使用 AskUserQuestion 讓使用者選擇目標專案。
ls "$MCP_PROJECT_DIR/Package.swift" "$MCP_PROJECT_DIR/pyproject.toml" "$MCP_PROJECT_DIR/package.json" 2>/dev/null
至少要有一個存在。
cd "$MCP_PROJECT_DIR"
mkdir -p references
建立 references/.gitignore:
# Reference source code - local only, do not commit
*
!.gitignore
!README.md
CLONE_DIR="references/$REPO_NAME"
if [ -d "$CLONE_DIR" ]; then
echo "references/$REPO_NAME 已存在"
# 詢問使用者:跳過 / 更新 (git pull) / 重新 clone
else
git clone --depth 1 "$CLONE_URL" "$CLONE_DIR"
fi
ls "$CLONE_DIR"
使用 WebFetch 取得 repo 的 GitHub 頁面資訊(或讀取 clone 下來的 README):
# 讀取 repo 的 README 取得描述
head -20 "$CLONE_DIR/README.md"
如果 references/README.md 不存在,建立新檔。如果已存在,附加新條目。
格式:
# References
參考用原始碼,僅供本地分析,不納入版本控制。
## 已 Clone 的參考專案
| Repo | URL | Language | Clone 日期 | 用途 |
|------|-----|----------|-----------|------|
| {REPO_NAME} | {GITHUB_URL} | {LANGUAGE} | {DATE} | 功能參考 |
啟動一個 Explore agent 分析參考 repo 的 MCP 功能:
分析重點:
1. 支援的 MCP tools 清單(名稱 + 功能描述 + 參數)
2. 核心架構和設計模式
3. 特色功能(error handling, i18n, batch ops, search 等)
4. 依賴和框架
啟動另一個 Explore agent 分析自己的專案:
分析重點:
1. 現有 MCP tools 清單
2. 已實作的功能
兩個 agent 平行執行。
等兩個 agent 都完成後,建立功能比較表:
## 功能比較
| 功能 | 自己 | {REPO_NAME} | 可借鏡? |
|------|------|-------------|---------|
| search_messages | ✅ | ✅ | - |
| move_messages | ❌ | ✅ | ✅ |
| flag_message | ❌ | ✅ | ✅ |
| batch_operations | ❌ | ✅ | ✅ |
| attachment_handling | 基本 | 完整 | ✅ |
基於 Phase 3 的比較結果,產生具體的升級建議:
# 升級建議:基於 {REPO_NAME} 參考分析
**專案**: {MCP_PROJECT_NAME}
**參考**: {REPO_NAME} ({GITHUB_URL})
**分析日期**: {DATE}
---
## 可借鏡的功能
### 高優先(核心缺失)
| 功能 | 參考實作 | 建議方式 | 複雜度 |
|------|----------|----------|--------|
| move_messages | mail_connector.py:678 | 新增 move_email tool | 中 |
### 中優先(體驗提升)
| 功能 | 參考實作 | 建議方式 | 複雜度 |
|------|----------|----------|--------|
### 低優先(進階功能)
| 功能 | 參考實作 | 建議方式 | 複雜度 |
|------|----------|----------|--------|
---
## 設計模式可借鏡
| 模式 | 參考做法 | 自己現況 | 建議 |
|------|----------|----------|------|
| Error handling | 自定義 Exception 類 | 通用 error | 引入分類 |
| Input validation | sanitize + escape | 部分 | 完善 |
---
## 下一步
- [ ] 確認要實作哪些功能
- [ ] 用 `/mcp-tools:mcp-upgrade features` 執行正式升級流程
- [ ] 完成後用 `/mcp-tools:mcp-deploy` 部署新版
報告儲存到 docs/reference-analysis-{REPO_NAME}.md。
mkdir -p "$MCP_PROJECT_DIR/docs"
使用 AskUserQuestion 詢問:
分析完成!發現 {N} 個可借鏡的功能。要怎麼處理?
選項:
/mcp-tools:mcp-upgrade features 正式升級如果選擇「執行 mcp-upgrade」:
Skill: mcp-tools:mcp-upgrade
Args: features
--list:列出所有 referencesecho "=== MCP 專案 References ==="
for project in ~/Library/CloudStorage/Dropbox/che_workspace/projects/mcp/che-*/; do
if [ -d "$project/references" ]; then
echo ""
echo "$(basename $project):"
for dir in "$project"/references/*/; do
if [ -d "$dir/.git" ]; then
REMOTE=$(git -C "$dir" remote get-url origin 2>/dev/null || echo "unknown")
echo " $(basename $dir) -> $REMOTE"
fi
done
fi
done
# Clone 指定 repo 到當前 MCP 專案
/mcp-tools:mcp-clone https://github.com/s-morgan-jeffries/apple-mail-mcp
# Clone 到指定 MCP 專案
/mcp-tools:mcp-clone https://github.com/user/repo che-apple-mail-mcp
# 列出所有 references
/mcp-tools:mcp-clone --list
/mcp-tools:mcp-clone <url> 直接 clone + 分析
│
├── 自動產生功能比較和升級建議
│
▼
/mcp-tools:mcp-upgrade features (可選)正式升級流程
│
▼
/mcp-tools:mcp-deploy 部署新版
| 命令 | 用途 | 輸入 |
|---|---|---|
/mcp-tools:mcp-clone | 給 URL,clone + 分析 | GitHub URL |
/mcp-tools:mcp-clone-references | 搜尋競品,批次 clone | 關鍵字 |
/mcp-tools:mcp-upgrade | 正式升級流程 | focus area |
npx claudepluginhub psychquant/psychquant-claude-plugins --plugin mcp-toolsScouts GitHub repos for patterns, features, and ideas to improve your project by cloning, analyzing architecture and code, comparing with your codebase, and delivering actionable recommendations.
Clones, ports, or converts features from any GitHub repo into your project with 4 modes: port (rewrite), compare (analysis), copy (transplant), improve (copy + optimize). Enforces license and fit checks before adoption.
Copies patterns, setup, or structure from another project into the current session. Also supports fix-and-PR mode to submit bug fixes to referenced projects.