How this skill is triggered — by the user, by Claude, or both
Slash command
/mcp-tools:mcp-clone-referencesThis 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 相關 MCP Server 的原始碼到 `references/` 資料夾,用於競品分析。
搜尋並 clone 相關 MCP Server 的原始碼到 references/ 資料夾,用於競品分析。
$1 = 搜尋關鍵字(可選,如 calendar、apple reminders)
--list:列出已 clone 的 references--clean:清除 references/ 資料夾pwd
ls -la
判斷依據(至少符合一項):
Package.swift 存在(Swift MCP)package.json 存在且含 mcp 相關依賴(TypeScript MCP)pyproject.toml 存在且含 mcp 相關依賴(Python MCP)mcpb/manifest.json 存在如果使用者沒指定 $1,從專案資訊推斷:
README.md 或 mcpb/manifest.json 取得專案描述calendar、reminders、apple mail)mcp {keyword} 或 mcp server {keyword}向使用者確認推斷的搜尋關鍵字後再繼續。
使用 gh search repos 搜尋相關 MCP servers:
gh search repos "{search-query} mcp" \
--sort stars \
--order desc \
--limit 20 \
--json fullName,description,stargazersCount,language,updatedAt \
--jq '.[] | "\(.stargazersCount)⭐ \(.fullName) [\(.language)] - \(.description)"'
如果結果不夠,可嘗試不同關鍵字組合:
# 更廣泛的搜尋
gh search repos "{keyword} mcp server" --sort stars --limit 10 ...
gh search repos "{keyword} model context protocol" --sort stars --limit 10 ...
將搜尋結果呈現給使用者,格式如下:
## 搜尋結果
| # | Stars | Repo | Language | Description |
|---|-------|------|----------|-------------|
| 1 | 3000 | supermemoryai/apple-mcp | TypeScript | ... |
| 2 | 1100 | mattt/iMCP | Swift | ... |
| ...
請選擇要 clone 的 repos(輸入編號,用逗號分隔,例如 `1,2,4`):
使用 AskUserQuestion 讓使用者選擇。
排除自己的 repo:如果搜尋結果包含當前專案,自動排除。
mkdir -p references
如果 references/.gitignore 不存在,建立:
# Competitor source code - local reference only
*
!.gitignore
重要:這確保競品原始碼不會被 commit 到自己的 repo。
對每個選定的 repo:
REPO_NAME=$(echo "{full_name}" | cut -d'/' -f2)
# 如果已存在,跳過或詢問是否更新
if [ -d "references/$REPO_NAME" ]; then
echo "⚠️ references/$REPO_NAME 已存在"
# 詢問使用者:跳過 / 更新 (git pull) / 重新 clone
else
git clone --depth 1 "https://github.com/{full_name}.git" "references/$REPO_NAME"
fi
使用 --depth 1 減少下載量(只需原始碼,不需完整歷史)。
ls -la references/
使用 AskUserQuestion 詢問:
已 clone {N} 個 repos。要執行自動競品分析嗎?
- 是,分析所有 repos
- 否,我自己看
對每個 clone 的 repo,啟動一個平行的 Task agent 進行分析:
分析重點:
1. Architecture: 語言、框架、核心設計模式
2. Tools: 完整工具清單、參數、功能
3. Limitations: 致命弱點、缺少的功能
4. Unique features: 值得學習的獨特設計
5. Code quality: 錯誤處理、i18n、日期處理、測試
同時啟動對自己專案的分析 agent,用於比較。
所有 agent 完成後,將結果整合為 docs/COMPETITIVE_ANALYSIS.md:
--list:列出已 clone 的 referencesecho "=== References ==="
for dir in 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
--clean:清除 references# 先確認
echo "將刪除 references/ 下所有 clone 的 repos"
# AskUserQuestion 確認
rm -rf references/*/
# 保留 .gitignore
# 競品 Clone 完成
## 已 clone 的 repos
| Repo | Stars | Language | Path |
|------|-------|----------|------|
| supermemoryai/apple-mcp | 3000 | TypeScript | references/apple-mcp/ |
| mattt/iMCP | 1100 | Swift | references/iMCP/ |
| ... | ... | ... | ... |
## 資料夾結構
references/
├── .gitignore # 防止 commit 競品程式碼
├── apple-mcp/ # --depth 1 clone
├── iMCP/
└── ...
## 下一步
- 瀏覽原始碼:`ls references/{repo}/`
- 執行分析:重新執行 `/mcp-clone-references` 選擇分析
- 撰寫比較文件:結果會寫入 `docs/COMPETITIVE_ANALYSIS.md`
# 搜尋並 clone calendar 相關 MCP servers
/mcp-clone-references calendar
# 搜尋並 clone apple reminders 相關
/mcp-clone-references apple reminders
# 自動推斷關鍵字
/mcp-clone-references
# 列出已 clone 的 repos
/mcp-clone-references --list
# 清除 references
/mcp-clone-references --clean
| 命令 | 用途 | 使用時機 |
|---|---|---|
/mcp-clone-references | Clone 競品原始碼 | 開發初期,了解市場 |
/mcp-upgrade | 分析並提議升級 | 借鏡競品後改善自己 |
/mcp-deploy | 編譯打包發布 | 改善完成後發布 |
npx claudepluginhub psychquant/psychquant-claude-plugins --plugin mcp-toolsGuides building MCP servers in TypeScript from research to evaluation. Covers design principles, SDK usage, and hosting patterns.
Builds accessible UIs with shadcn/ui components on Radix UI + Tailwind CSS, plus canvas visuals. For React apps (Next.js, Vite, Remix, Astro), design systems, responsive layouts, themes, dark mode, prototypes.