npx claudepluginhub psychquant/psychquant-claude-plugins --plugin mcp-toolsThis skill is limited to using the following tools:
確保 MCP 專案的三個 binary 副本保持一致。
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
確保 MCP 專案的三個 binary 副本保持一致。
只適用 Swift 專案(Python/TS 使用 wrapper script,不需要 binary 同步)
.build/arm64 + .build/x86_64
│ (lipo -create + codesign)
▼
mcpb/server/{Binary} [universal, signed]
│ (cp + codesign)
▼
~/bin/{Binary} [universal, signed]
$1 = --check-only(可選)— 只檢查不同步pwd
ls -la Package.swift mcpb/manifest.json 2>/dev/null
必須存在:
Package.swift(Swift 專案)mcpb/manifest.json如果不是 Swift 專案(沒有 Package.swift),輸出:
⏭️ 非 Swift 專案,不需要 binary 同步。Python/TS 使用 wrapper script。
並結束。
BINARY_NAME=$(grep -A5 'executableTarget' Package.swift | grep 'name:' | head -1 | sed 's/.*"\([^"]*\)".*/\1/')
echo "Binary: $BINARY_NAME"
# 位置 1: .build/release (可能有多個架構)
ls -la .build/arm64-apple-macosx/release/$BINARY_NAME 2>/dev/null
ls -la .build/x86_64-apple-macosx/release/$BINARY_NAME 2>/dev/null
ls -la .build/release/$BINARY_NAME 2>/dev/null
# 位置 2: mcpb/server
ls -la mcpb/server/$BINARY_NAME 2>/dev/null
# 位置 3: ~/bin
ls -la ~/bin/$BINARY_NAME 2>/dev/null
記錄哪些位置存在 binary。
對每個存在的 binary 執行:
# mcpb/server
shasum -a 256 mcpb/server/$BINARY_NAME 2>/dev/null
file mcpb/server/$BINARY_NAME 2>/dev/null
lipo -info mcpb/server/$BINARY_NAME 2>/dev/null
# ~/bin
shasum -a 256 ~/bin/$BINARY_NAME 2>/dev/null
file ~/bin/$BINARY_NAME 2>/dev/null
lipo -info ~/bin/$BINARY_NAME 2>/dev/null
情況 A — mcpb/server 和 ~/bin 都是 universal:
情況 B — mcpb/server 是 universal,~/bin 是 single-arch (arm64):
TMPFILE="/tmp/_mcpb_sync_arm64_$$"
lipo -thin arm64 mcpb/server/$BINARY_NAME -output "$TMPFILE"
shasum -a 256 "$TMPFILE" ~/bin/$BINARY_NAME
rm -f "$TMPFILE"
情況 C — 其中一個不存在:
如果 .build/arm64 和 .build/x86_64 都存在:
# 合併後與 mcpb/server 比對
TMPFILE="/tmp/_mcpb_sync_universal_$$"
lipo -create \
.build/arm64-apple-macosx/release/$BINARY_NAME \
.build/x86_64-apple-macosx/release/$BINARY_NAME \
-output "$TMPFILE"
shasum -a 256 "$TMPFILE" mcpb/server/$BINARY_NAME
rm -f "$TMPFILE"
如果只有一個架構(如只有 arm64):
## Binary 一致性檢查
Binary: {BINARY_NAME}
專案: {project-name}
| 位置 | 存在 | 架構 | Hash (SHA-256 前 12 碼) | 狀態 |
|------|------|------|------------------------|------|
| .build/arm64 | ✅/❌ | arm64 | abc123... | - |
| .build/x86_64 | ✅/❌ | x86_64 | def456... | - |
| mcpb/server | ✅/❌ | universal/arm64 | ghi789... | ✅/⚠️ |
| ~/bin | ✅/❌ | universal/arm64 | ghi789.../xxx... | ✅/❌ |
### 比對結果
- .build → mcpb/server: ✅ 一致 / ❌ 不一致 / ⚠️ .build 較新
- mcpb/server → ~/bin: ✅ 一致 / ❌ 不一致
如果 $1 是 --check-only,到此結束。
如果有任何不一致,使用 AskUserQuestion 詢問同步方式:
選項:
從 .build 重建(推薦,如果 .build 存在)
只複製 mcpb/server → ~/bin
完整重編譯
swift build -c release --arch arm64swift build -c release --arch x86_64取消
# 合併 universal binary
lipo -create \
.build/arm64-apple-macosx/release/$BINARY_NAME \
.build/x86_64-apple-macosx/release/$BINARY_NAME \
-output mcpb/server/$BINARY_NAME
# 重新簽名(lipo 會破壞原始 code signature)
codesign --force --sign - mcpb/server/$BINARY_NAME
# 複製到 ~/bin
cp mcpb/server/$BINARY_NAME ~/bin/$BINARY_NAME
chmod +x ~/bin/$BINARY_NAME
codesign --force --sign - ~/bin/$BINARY_NAME
cp mcpb/server/$BINARY_NAME ~/bin/$BINARY_NAME
chmod +x ~/bin/$BINARY_NAME
codesign --force --sign - ~/bin/$BINARY_NAME
# 清理
rm -rf .build 2>/dev/null || true
# 編譯兩個架構
swift build -c release --arch arm64
swift build -c release --arch x86_64
# 合併
lipo -create \
.build/arm64-apple-macosx/release/$BINARY_NAME \
.build/x86_64-apple-macosx/release/$BINARY_NAME \
-output mcpb/server/$BINARY_NAME
# 重新簽名(lipo 會破壞原始 code signature)
codesign --force --sign - mcpb/server/$BINARY_NAME
# 複製到 ~/bin
cp mcpb/server/$BINARY_NAME ~/bin/$BINARY_NAME
chmod +x ~/bin/$BINARY_NAME
codesign --force --sign - ~/bin/$BINARY_NAME
重要:
lipo -create和cp都會破壞 macOS code signature。 未簽名的 binary 會被 macOS runtime enforcement 以 SIGKILL (exit 137) 終止。 每次 lipo/cp 後必須執行codesign --force --sign -重新 ad-hoc 簽名。
mcpb/server 的 binary 已更新,必須重新打包 .mcpb 以保持一致。
rm -f mcpb/*.mcpb 2>/dev/null || true
PROJECT_NAME=$(cat mcpb/manifest.json | grep '"name"' | head -1 | sed 's/.*"\([^"]*\)".*/\1/' | tr -d ' ')
cd mcpb && zip -r ${PROJECT_NAME}.mcpb . -x ".*" -x "*.mcpb" && cd ..
ls -lh mcpb/*.mcpb
unzip -l mcpb/*.mcpb | head -10
echo "=== Post-sync Verification ==="
shasum -a 256 mcpb/server/$BINARY_NAME ~/bin/$BINARY_NAME
兩者 hash 必須完全一致。
echo "=== mcpb/server ==="
file mcpb/server/$BINARY_NAME
lipo -info mcpb/server/$BINARY_NAME
echo "=== ~/bin ==="
file ~/bin/$BINARY_NAME
lipo -info ~/bin/$BINARY_NAME
rm -f /tmp/_mcpb_sync_* 2>/dev/null
# MCPB Sync 完成
## 專案資訊
- 專案: {project-name}
- Binary: {BINARY_NAME}
## 同步結果
| 位置 | 架構 | Hash (前 12 碼) | 狀態 |
|------|------|-----------------|------|
| mcpb/server/{Binary} | universal (arm64 + x86_64) | abc123... | ✅ |
| ~/bin/{Binary} | universal (arm64 + x86_64) | abc123... | ✅ |
## MCPB 套件
- 已重新打包: mcpb/{project-name}.mcpb
## Binary Consistency: ✅ 全部一致
| 情況 | 建議操作 |
|---|---|
剛 swift build 但沒 deploy | 選項 1(從 .build 重建) |
| deploy 後 ~/bin 不一致 | 選項 2(mcpb → ~/bin) |
| 不確定 .build 是否最新 | 選項 3(完整重編譯) |
| 只想確認狀態 | --check-only |
| MCP Server | Binary 名稱 |
|---|---|
| che-things-mcp | CheThingsMCP |
| che-ical-mcp | CheICalMCP |
| che-apple-mail-mcp | CheAppleMailMCP |
| che-word-mcp | CheWordMCP |
| che-duckdb-mcp | CheDuckDBMCP |
| che-blender-mcp | CheBlenderMCP |
| che-logic-pro-mcp | CheLogicProMCP |
| che-claude-desktop-mcp | CheClaudeDesktopMCP |