Skip to content

Commit a24ece7

Browse files
committed
Update SKILLs and SKILL installer
1 parent 0d097fc commit a24ece7

5 files changed

Lines changed: 325 additions & 139 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,10 @@ When configuring a client manually, ensure the command includes the `mcp` subcom
160160

161161
XcodeBuildMCP now includes an optional agent skill. Some clients (e.g., Cursor, Claude Code) hide MCP tool schemas behind search/progressive disclosure, which can reduce tool discovery and usage. The skill provides a concise overview of available tools to counter that. If your client already exposes tools up front, you likely don’t need it; only use it if your agent isn’t reaching for XcodeBuildMCP tools.
162162

163-
To install, replace `<client-name>` with your client (cursor, claude, codex):
163+
To install, download and run the installer in a terminal, then choose your client when prompted:
164164
```bash
165-
curl -fsSL https://raw.githubusercontent.com/cameroncooke/XcodeBuildMCP/main/scripts/install-skill.sh | bash -s -- --<client-name>
165+
curl -fsSL https://raw.githubusercontent.com/cameroncooke/XcodeBuildMCP/main/scripts/install-skill.sh -o install-skill.sh
166+
bash install-skill.sh
166167
```
167168

168169
For further information on how to install the skill, see: [docs/SKILLS.md](docs/SKILLS.md)

scripts/install-skill.sh

Lines changed: 156 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,23 @@ set -euo pipefail
33

44
usage() {
55
cat <<'EOF'
6-
Usage: install-skill.sh --codex|--claude|--cursor|--dest <path>
6+
Usage: install-skill.sh --codex|--claude|--cursor|--dest <path> [--skill <mcp|cli>] [--ref <git-ref>] [--remove-conflict]
77
8-
Installs (or replaces) the XcodeBuildMCP skill.
8+
Installs (or replaces) the XcodeBuildMCP skill. If --skill is omitted, the
9+
installer will ask which skill to install.
10+
If the script is run from a local checkout, it installs the local skill file.
11+
Otherwise it downloads the skill from the provided --ref or from main.
912
10-
You must choose a destination with --codex, --claude, --cursor, or --dest.
13+
If no destination is provided, the installer will prompt for a client.
1114
EOF
1215
}
1316

1417
destination=""
18+
skill_choice=""
19+
skill_ref_override=""
20+
remove_conflict="false"
21+
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
22+
repo_root="$(cd "${script_dir}/.." && pwd)"
1523

1624
while [[ $# -gt 0 ]]; do
1725
case "$1" in
@@ -36,6 +44,28 @@ while [[ $# -gt 0 ]]; do
3644
destination="$2"
3745
shift 2
3846
;;
47+
--skill)
48+
if [[ $# -lt 2 ]]; then
49+
echo "Missing value for --skill" >&2
50+
usage
51+
exit 1
52+
fi
53+
skill_choice="$2"
54+
shift 2
55+
;;
56+
--ref)
57+
if [[ $# -lt 2 ]]; then
58+
echo "Missing value for --ref" >&2
59+
usage
60+
exit 1
61+
fi
62+
skill_ref_override="$2"
63+
shift 2
64+
;;
65+
--remove-conflict)
66+
remove_conflict="true"
67+
shift
68+
;;
3969
-h|--help)
4070
usage
4171
exit 0
@@ -48,17 +78,132 @@ while [[ $# -gt 0 ]]; do
4878
esac
4979
done
5080

81+
prompt_for_destination() {
82+
while true; do
83+
printf "Which client should receive the skill?\n"
84+
printf "1) Codex\n"
85+
printf "2) Claude\n"
86+
printf "3) Cursor\n"
87+
read -r -p "Enter 1, 2, or 3: " selection
88+
case "${selection}" in
89+
1)
90+
destination="${HOME}/.codex/skills/public"
91+
return 0
92+
;;
93+
2)
94+
destination="${HOME}/.claude/skills"
95+
return 0
96+
;;
97+
3)
98+
destination="${HOME}/.cursor/skills"
99+
return 0
100+
;;
101+
*)
102+
echo "Invalid selection. Please enter 1, 2, or 3."
103+
;;
104+
esac
105+
done
106+
}
107+
108+
prompt_for_skill() {
109+
while true; do
110+
printf "Which skill would you like to install?\n"
111+
printf "1) XcodeBuildMCP (MCP server)\n"
112+
printf "2) XcodeBuildMCP CLI\n"
113+
read -r -p "Enter 1 or 2: " selection
114+
case "${selection}" in
115+
1)
116+
skill_choice="mcp"
117+
return 0
118+
;;
119+
2)
120+
skill_choice="cli"
121+
return 0
122+
;;
123+
*)
124+
echo "Invalid selection. Please enter 1 or 2."
125+
;;
126+
esac
127+
done
128+
}
129+
51130
if [[ -z "${destination}" ]]; then
52-
echo "Missing destination option." >&2
53-
usage
54-
exit 1
131+
prompt_for_destination
132+
fi
133+
134+
if [[ -z "${skill_choice}" ]]; then
135+
prompt_for_skill
55136
fi
56137

57-
skill_dir="${destination}/xcodebuildmcp"
58-
skill_url="https://raw.githubusercontent.com/cameroncooke/XcodeBuildMCP/main/skills/xcodebuildmcp/SKILL.md"
138+
case "${skill_choice}" in
139+
mcp|server|xcodebuildmcp)
140+
skill_dir_name="xcodebuildmcp"
141+
skill_label="XcodeBuildMCP (MCP server)"
142+
alt_dir_name="xcodebuilmcp-cli"
143+
alt_label="XcodeBuildMCP CLI"
144+
;;
145+
cli|xcodebuildmcp-cli)
146+
skill_dir_name="xcodebuilmcp-cli"
147+
skill_label="XcodeBuildMCP CLI"
148+
alt_dir_name="xcodebuildmcp"
149+
alt_label="XcodeBuildMCP (MCP server)"
150+
;;
151+
*)
152+
echo "Unknown skill: ${skill_choice}" >&2
153+
usage
154+
exit 1
155+
;;
156+
esac
59157

60-
rm -rf "${skill_dir}"
158+
skill_dir="${destination}/${skill_dir_name}"
159+
alt_dir="${destination}/${alt_dir_name}"
160+
skill_path="skills/${skill_dir_name}/SKILL.md"
161+
skill_base_url="https://raw.githubusercontent.com/cameroncooke/XcodeBuildMCP"
162+
skill_ref="main"
163+
164+
if [[ -n "${skill_ref_override}" ]]; then
165+
skill_ref="${skill_ref_override}"
166+
fi
167+
168+
if [[ -e "${alt_dir}" ]]; then
169+
if [[ "${remove_conflict}" == "true" ]]; then
170+
rm -r "${alt_dir}"
171+
else
172+
printf "%s\n" "Only one skill can be installed at a time because the MCP and CLI skills conflict."
173+
read -r -p "Found ${alt_label} at ${alt_dir}. Remove it to continue? [y/N]: " confirm
174+
case "${confirm}" in
175+
y|Y|yes|YES)
176+
rm -r "${alt_dir}"
177+
;;
178+
*)
179+
echo "Aborting to avoid installing both skills."
180+
exit 1
181+
;;
182+
esac
183+
fi
184+
fi
185+
186+
if [[ -e "${skill_dir}" ]]; then
187+
rm -r "${skill_dir}"
188+
fi
61189
mkdir -p "${skill_dir}"
62-
curl -fsSL "${skill_url}" -o "${skill_dir}/SKILL.md"
63190

64-
printf 'Installed XcodeBuildMCP skill to %s\n' "${skill_dir}"
191+
primary_url="${skill_base_url}/${skill_ref}/${skill_path}"
192+
fallback_url="${skill_base_url}/main/${skill_path}"
193+
local_skill_path="${repo_root}/${skill_path}"
194+
195+
if [[ -f "${local_skill_path}" ]]; then
196+
cp "${local_skill_path}" "${skill_dir}/SKILL.md"
197+
else
198+
if ! curl -fsSL "${primary_url}" -o "${skill_dir}/SKILL.md"; then
199+
if [[ "${skill_ref}" != "main" ]]; then
200+
printf "%s\n" "Release tag ${skill_ref} not found. Falling back to main."
201+
curl -fsSL "${fallback_url}" -o "${skill_dir}/SKILL.md"
202+
else
203+
printf "%s\n" "Failed to download ${primary_url}." >&2
204+
exit 1
205+
fi
206+
fi
207+
fi
208+
209+
printf 'Installed %s to %s\n' "${skill_label}" "${skill_dir}"

scripts/release.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,11 @@ if [[ "$SKIP_VERSION_UPDATE" == "false" ]]; then
313313
README_URLENCODED_NPM_AT_SEMVER_REGEX='npm%3Axcodebuildmcp%40[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+\.[0-9]+)?(-[a-zA-Z0-9]+\.[0-9]+)*(-[a-zA-Z0-9]+)?'
314314
run sed_inplace "s/${README_URLENCODED_NPM_AT_SEMVER_REGEX}/npm%3Axcodebuildmcp%40${VERSION}/g" README.md
315315

316+
# Update skill installer URL and versioned ref in README.md
317+
echo "📝 Updating skill installer URL in README.md..."
318+
README_SKILL_INSTALL_URL_REGEX='https://raw.githubusercontent.com/cameroncooke/XcodeBuildMCP/[^/]+/scripts/install-skill.sh'
319+
run sed_inplace "s#${README_SKILL_INSTALL_URL_REGEX}#https://raw.githubusercontent.com/cameroncooke/XcodeBuildMCP/v${VERSION}/scripts/install-skill.sh#g" README.md
320+
316321
# server.json update
317322
echo ""
318323
if [[ -f server.json ]]; then

skills/xcodebuildmcp/SKILL.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
22
name: xcodebuildmcp
3-
description: Official skill for XcodeBuildMCP (preferred). Use when doing iOS/macOS/watchOS/tvOS/visionOS work (build, test, run, debug, log, UI automation).
3+
description: Official skill for XcodeBuildMCP. Use when doing iOS/macOS/watchOS/tvOS/visionOS work (build, test, run, debug, log, UI automation).
44
---
55

66
# XcodeBuildMCP
77

8-
Prefer XcodeBuildMCP tools over shell commands for Apple platform tasks when available.
8+
Prefer XcodeBuildMCP over raw `xcodebuild`, `xcrun`, or `simctl`.
99

10-
If a capability is missing, assume your tool list may be hiding tools (search/progressive disclosure) or not loading schemas yet. Use your tool-search or “load tools” mechanism. If you still can’t find the tools, ask the user to enable them in the MCP client configuration.
10+
If a capability is missing, assume your tool list may be hiding tools (search/progressive disclosure) or not loading tool schemas yet. Use your tool-search or “load tools” mechanism. If you still can’t find the tools, ask the user to enable them in the MCP client's configuration.
1111

1212
## Tools (exact names + official descriptions)
1313

1414
### Session defaults
1515

16-
Before you call any other tools, call `session_show_defaults` to show the current defaults, ensure you then fill in the appropriate missing defaults. You may need to call one or more discovery/list tools to obtain the values needed for certain defaults.
16+
Before you call any other tools, you **must** call `session_show_defaults` to show the current defaults, ensure you then fill in the appropriate missing defaults. You may need to call one or more discovery/list tools to obtain the values needed.
1717

1818
- `session_set_defaults`
1919
- Set the session defaults, should be called at least once to set tool defaults.

0 commit comments

Comments
 (0)