Sync Xcode skills
Source of truth is the plugin Xcode exports for the Claude agent, not other copies. Script checks, first found wins:
# 27B52+: dir Xcode passes to its agent as --plugin-dir; no .mcp.json (MCP via --mcp-config) $(getconf DARWIN_USER_TEMP_DIR)com.apple.dt.IDEIntelligenceAgents/plugins/<build>/xcode-integration/ # older builds ~/Library/Developer/Xcode/CodingAssistant/ExportedPlugins/<build>/claude/ # + .mcp.json .claude-plugin/plugin.json # name: xcode-integration skills/<skill>/...
Tmp dirs of older builds get emptied by Xcode — only the current build is reliable there. If unsure where the plugin lives: pgrep -lf "XcodeVersions/.*/claude" and read its --plugin-dir.
Ignore ~/Library/Developer/Xcode/CodingAssistant/codex/skills/__xcode (stale, e.g. still has uikit-app-modernization) and the flattened *.packaged / *.idechatprompttemplate files inside Xcode.app.
Steps
- Check (build defaults to
xcodebuild -versionof the selected Xcode; pass--buildfor another):bashpython3 .claude/skills/sync-xcode-skills/scripts/check.py [--build 27B52]- Exit 2 = no export for that build. Xcode writes it only when a Claude Agent chat starts (a message sent) in that Xcode. Ask user to open one, then rerun. Don't reconstruct from Xcode.app.
- Output: new/removed skills, added/removed/changed files, export
.mcp.json+plugin.json.
- Nothing changed → report "repo matches " and stop.
- Review:
--diffprints unified diffs. Summarize per skill what changed (new sections, removed guidance, new references) — this goes into the commit message/README. - Sync only when user asks:
--sync. Copies added/changed, deletes removed, keeps repo's frontmatter key order. - After sync, update by hand:
README.mdskills table: add/remove rows for new/removed skills (one-line summary from SKILL.md description, same style as existing rows). Check plugin-dependent list in Install section (device-interaction,translation, ...) if a new skill uses Xcode MCP tools..mcp.json: match export if script reportsNOTE: .mcp.json differs..claude-plugin/marketplace.json: bumpmetadata.versionminor; update plugindescriptionif skills added/removed.
- Commit only when asked. Style:
Update skills for Xcode 27.2 (27B52), bump to 0.7.0; mention added/removed skills.
Gotchas
- Xcode emits SKILL.md frontmatter keys in random order per export. Script compares parsed frontmatter, so order-only differences are not changes. Never
cp -Rthe export over the repo — it creates noisy diffs. - Exported files are read-only (
r--r--r--); script rewrites them as 644. .DS_Storeignored.- Skill text references
xcode-integration:<skill>(plugin name in Xcode). Keep verbatim — content is Apple's, unedited. - Compare against older exports to see history between builds:
--build 27B48.


