Skip to content

Commit 46906c3

Browse files
committed
feat(guidance): add prescriptive agent workflow instructions
Replace generic server instructions with a structured simulator run flow protocol that prevents common waste patterns (speculative discovery, redundant boot/open calls, skipped session_show_defaults). Rewrite both skill files from exhaustive tool catalogs to concise workflow-oriented guidance that teaches decision-making over listing facts. Update tool manifest descriptions to embed workflow context at point of tool selection (boot_sim/open_sim not required before build_run_sim, session_show_defaults required before first build/run/test).
1 parent db9d7d0 commit 46906c3

12 files changed

Lines changed: 92 additions & 371 deletions

File tree

AGENTS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ When reading issues:
1717
-
1818
## Tools
1919
- GitHub CLI for issues/PRs
20+
- When working on skill sources in `skills/`, use the `skill-creator` skill workflow.
21+
- After modifying any skill source, run `npx skill-check <skill-directory>` and address all errors/warnings before handoff.
2022
-
2123
## Style
2224
- Keep answers short and concise

docs/SKILLS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ xcodebuildmcp init --remove-conflict # Auto-remove conflicting variant
2626
xcodebuildmcp init --uninstall # Remove installed skill
2727
```
2828

29+
When installing `--skill mcp` in auto-detect mode, Claude Code targets are skipped because Claude already receives MCP guidance through server instructions. If you explicitly set `--client claude`, MCP skill installation is still allowed.
30+
2931
## Unsupported Clients
3032

3133
For clients without a skills directory, print the skill content and pipe it to a file or paste it into your client's instructions area:

docs/TOOLS-CLI.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ XcodeBuildMCP provides 73 canonical tools organized into 13 workflow groups.
1818

1919
- `build` - Build for device.
2020
- `clean` - Clean build products.
21-
- `discover-projects` - Scans a directory (defaults to workspace root) to find Xcode project (.xcodeproj) and workspace (.xcworkspace) files.
21+
- `discover-projects` - Scans a directory (defaults to workspace root) to find Xcode project (.xcodeproj) and workspace (.xcworkspace) files. Use when project/workspace path is unknown.
2222
- `get-app-bundle-id` - Extract bundle id from .app.
2323
- `get-app-path` - Get device built app path.
2424
- `install` - Install app on device.
@@ -38,7 +38,7 @@ XcodeBuildMCP provides 73 canonical tools organized into 13 workflow groups.
3838

3939
- `boot` - Defined in Simulator Management workflow.
4040
- `build` - Build for iOS sim (compile-only, no launch).
41-
- `build-and-run` - Build and run iOS sim (preferred for run/launch intent).
41+
- `build-and-run` - Build, install, and launch on iOS Simulator; boots simulator and attempts to open Simulator.app as needed. Preferred single-step run tool when defaults are set.
4242
- `clean` - Defined in iOS Device Development workflow.
4343
- `discover-projects` - Defined in iOS Device Development workflow.
4444
- `get-app-bundle-id` - Defined in iOS Device Development workflow.
@@ -130,10 +130,10 @@ XcodeBuildMCP provides 73 canonical tools organized into 13 workflow groups.
130130
### Simulator Management (`simulator-management`)
131131
**Purpose**: Tools for managing simulators from booting, opening simulators, listing simulators, stopping simulators, erasing simulator content and settings, and setting simulator environment options like location, network, statusbar and appearance. (8 tools)
132132

133-
- `boot` - Boot iOS simulator.
133+
- `boot` - Boot iOS simulator for manual/non-build flows. Not required before simulator build-and-run (build_run_sim).
134134
- `erase` - Erase simulator.
135135
- `list` - List iOS simulators.
136-
- `open` - Open Simulator app.
136+
- `open` - Open Simulator.app for visibility/manual workflows. Not required before simulator build-and-run (build_run_sim).
137137
- `reset-location` - Reset sim location.
138138
- `set-appearance` - Set sim appearance.
139139
- `set-location` - Set sim location.
@@ -189,4 +189,4 @@ XcodeBuildMCP provides 73 canonical tools organized into 13 workflow groups.
189189

190190
---
191191

192-
*This documentation is automatically generated by `scripts/update-tools-docs.ts` from the tools manifest. Last updated: 2026-02-22T18:16:55.247Z UTC*
192+
*This documentation is automatically generated by `scripts/update-tools-docs.ts` from the tools manifest. Last updated: 2026-02-28T20:48:25.650Z UTC*

docs/TOOLS.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This document lists MCP tool names as exposed to MCP clients. XcodeBuildMCP prov
1616

1717
- `build_device` - Build for device.
1818
- `clean` - Clean build products.
19-
- `discover_projs` - Scans a directory (defaults to workspace root) to find Xcode project (.xcodeproj) and workspace (.xcworkspace) files.
19+
- `discover_projs` - Scans a directory (defaults to workspace root) to find Xcode project (.xcodeproj) and workspace (.xcworkspace) files. Use when project/workspace path is unknown.
2020
- `get_app_bundle_id` - Extract bundle id from .app.
2121
- `get_device_app_path` - Get device built app path.
2222
- `install_app_device` - Install app on device.
@@ -35,7 +35,7 @@ This document lists MCP tool names as exposed to MCP clients. XcodeBuildMCP prov
3535
**Purpose**: Complete iOS development workflow for both .xcodeproj and .xcworkspace files targeting simulators. (21 tools)
3636

3737
- `boot_sim` - Defined in Simulator Management workflow.
38-
- `build_run_sim` - Build and run iOS sim (preferred for run/launch intent).
38+
- `build_run_sim` - Build, install, and launch on iOS Simulator; boots simulator and attempts to open Simulator.app as needed. Preferred single-step run tool when defaults are set.
3939
- `build_sim` - Build for iOS sim (compile-only, no launch).
4040
- `clean` - Defined in iOS Device Development workflow.
4141
- `discover_projs` - Defined in iOS Device Development workflow.
@@ -130,7 +130,7 @@ This document lists MCP tool names as exposed to MCP clients. XcodeBuildMCP prov
130130

131131
- `session_clear_defaults` - Clear session defaults for the active profile or a specified profile.
132132
- `session_set_defaults` - Set session defaults for the active profile, or for a specified profile and make it active.
133-
- `session_show_defaults` - Show the current active defaults.
133+
- `session_show_defaults` - Show current active defaults. Required before your first build/run/test call in a session — do not assume defaults are configured.
134134
- `session_use_defaults_profile` - Switch the active session defaults profile.
135135
- `sync_xcode_defaults` - Sync session defaults (scheme, simulator) from Xcode's current IDE selection.
136136

@@ -139,10 +139,10 @@ This document lists MCP tool names as exposed to MCP clients. XcodeBuildMCP prov
139139
### Simulator Management (`simulator-management`)
140140
**Purpose**: Tools for managing simulators from booting, opening simulators, listing simulators, stopping simulators, erasing simulator content and settings, and setting simulator environment options like location, network, statusbar and appearance. (8 tools)
141141

142-
- `boot_sim` - Boot iOS simulator.
142+
- `boot_sim` - Boot iOS simulator for manual/non-build flows. Not required before simulator build-and-run (build_run_sim).
143143
- `erase_sims` - Erase simulator.
144144
- `list_sims` - List iOS simulators.
145-
- `open_sim` - Open Simulator app.
145+
- `open_sim` - Open Simulator.app for visibility/manual workflows. Not required before simulator build-and-run (build_run_sim).
146146
- `reset_sim_location` - Reset sim location.
147147
- `set_sim_appearance` - Set sim appearance.
148148
- `set_sim_location` - Set sim location.
@@ -205,4 +205,4 @@ This document lists MCP tool names as exposed to MCP clients. XcodeBuildMCP prov
205205

206206
---
207207

208-
*This documentation is automatically generated by `scripts/update-tools-docs.ts` from the tools manifest. Last updated: 2026-02-22T18:16:55.247Z UTC*
208+
*This documentation is automatically generated by `scripts/update-tools-docs.ts` from the tools manifest. Last updated: 2026-02-28T20:48:25.650Z UTC*

manifests/tools/boot_sim.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module: mcp/tools/simulator/boot_sim
33
names:
44
mcp: boot_sim
55
cli: boot
6-
description: Boot iOS simulator.
6+
description: Boot iOS simulator for manual/non-build flows. Not required before simulator build-and-run (build_run_sim).
77
annotations:
88
title: Boot Simulator
99
destructiveHint: true

manifests/tools/build_run_sim.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module: mcp/tools/simulator/build_run_sim
33
names:
44
mcp: build_run_sim
55
cli: build-and-run
6-
description: Build and run iOS sim (preferred for run/launch intent).
6+
description: Build, install, and launch on iOS Simulator; boots simulator and attempts to open Simulator.app as needed. Preferred single-step run tool when defaults are set.
77
predicates:
88
- hideWhenXcodeAgentMode
99
annotations:

manifests/tools/discover_projs.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@ module: mcp/tools/project-discovery/discover_projs
33
names:
44
mcp: discover_projs
55
cli: discover-projects
6-
description: Scans a directory (defaults to workspace root) to find Xcode project (.xcodeproj) and workspace (.xcworkspace) files.
6+
description: Scans a directory (defaults to workspace root) to find Xcode project (.xcodeproj) and workspace (.xcworkspace) files. Use when project/workspace path is unknown.
77
annotations:
88
title: Discover Projects
99
readOnlyHint: true
10+
nextSteps:
11+
- label: Save discovered project/workspace as session defaults
12+
toolId: session_set_defaults
13+
priority: 1
14+
- label: Build and run once defaults are set
15+
toolId: build_run_sim
16+
priority: 2

manifests/tools/open_sim.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ module: mcp/tools/simulator/open_sim
33
names:
44
mcp: open_sim
55
cli: open
6-
description: Open Simulator app.
6+
description: Open Simulator.app for visibility/manual workflows. Not required before simulator build-and-run (build_run_sim).
77
annotations:
88
title: Open Simulator
99
destructiveHint: true
1010
nextSteps:
11-
- label: Boot a simulator if needed
11+
- label: Boot a simulator for manual workflows
1212
toolId: boot_sim
1313
params:
1414
simulatorId: UUID_FROM_LIST_SIMS

manifests/tools/session_show_defaults.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module: mcp/tools/session-management/session_show_defaults
33
names:
44
mcp: session_show_defaults
55
cli: show-defaults
6-
description: Show the current active defaults.
6+
description: Show current active defaults. Required before your first build/run/test call in a session — do not assume defaults are configured.
77
annotations:
88
title: Show Session Defaults
99
readOnlyHint: true

skills/xcodebuildmcp-cli/SKILL.md

Lines changed: 32 additions & 165 deletions
Original file line numberDiff line numberDiff line change
@@ -5,193 +5,60 @@ description: Official skill for the XcodeBuildMCP CLI. Use when doing iOS/macOS/
55

66
# XcodeBuildMCP CLI
77

8-
This skill is for AI agents. It positions the XcodeBuildMCP CLI as a low‑overhead alternative to MCP tool calls: agents can already run shell commands, and the CLI exposes the same tool surface without the schema‑exchange cost. Prefer the CLI over raw `xcodebuild`, `xcrun`, or `simctl`.
8+
Use XcodeBuildMCP tools via the `xcodebuildmcp` executable instead of raw `xcodebuild`, `xcrun`, or `simctl`.
99

10-
## When To Use This CLI (Capabilities And Workflows)
11-
12-
- When you need build/test/run/debugging/logging/UI automation capabilities.
13-
- When you want simulator/device management capabilities.
14-
- When you want AI optimized tools and tool responses.
15-
- When you need project discovery capabilities (schemes, bundle IDs, app paths).
16-
17-
## Command Discovery
18-
19-
Use `--help` to discover workflows, tools, and arguments.
10+
## Step 1: Ensure the CLI Exists
2011

12+
Check availability:
2113
```bash
2214
xcodebuildmcp --help
23-
xcodebuildmcp tools --help
24-
xcodebuildmcp tools --json
25-
xcodebuildmcp <workflow> --help
26-
xcodebuildmcp <workflow> <tool> --help
27-
```
28-
29-
Notes:
30-
- Use `--json '{...}'` for complex arguments and `--output json` if you need machine-readable results (not recommended).
31-
32-
## Common Workflows
33-
34-
### Build And Run On Simulator
35-
36-
If your intent is to run the app in Simulator, use `build-and-run` directly. It already performs the build step.
37-
Do not run `build` first unless the user explicitly requests both commands.
38-
39-
1. List simulators and pick a device name or UDID.
40-
2. Build and run.
41-
42-
If app and project details are not known:
43-
```bash
44-
xcodebuildmcp simulator discover-projects --workspace-root .
45-
xcodebuildmcp simulator list-schemes --project-path ./MyApp.xcodeproj
46-
xcodebuildmcp simulator list
4715
```
4816

49-
To build, install and launch the app in one command:
17+
If missing, install with one of:
5018
```bash
51-
xcodebuildmcp simulator build-and-run --scheme MyApp --project-path ./MyApp.xcodeproj --simulator-name "iPhone 17 Pro"
19+
brew tap getsentry/xcodebuildmcp
20+
brew install xcodebuildmcp
5221
```
5322

54-
### Build only
55-
56-
Use this only when you want compile feedback and do not want to launch the app.
57-
For run/launch intent, use `build-and-run` instead of chaining `build` and `build-and-run`.
58-
5923
```bash
60-
xcodebuildmcp simulator build --scheme MyApp --project-path ./MyApp.xcodeproj --simulator-name "iPhone 17 Pro"
24+
npm install -g xcodebuildmcp@latest
6125
```
6226

63-
### Run Tests
64-
65-
When you need to run tests, you can do so with the `test` tool.
66-
27+
Re-check after install:
6728
```bash
68-
xcodebuildmcp simulator test --scheme MyAppTests --project-path ./MyApp.xcodeproj --simulator-name "iPhone 17 Pro"
69-
```
70-
71-
### Install And Launch On Physical Device
72-
73-
```bash
74-
xcodebuildmcp device list
75-
xcodebuildmcp device build --scheme MyApp --project-path ./MyApp.xcodeproj
76-
xcodebuildmcp device get-app-path --scheme MyApp --project-path ./MyApp.xcodeproj
77-
xcodebuildmcp device get-app-bundle-id --app-path /path/to/MyApp.app
78-
xcodebuildmcp device install --device-id DEVICE_UDID --app-path /path/to/MyApp.app
79-
xcodebuildmcp device launch --device-id DEVICE_UDID --bundle-id io.sentry.MyApp
80-
```
81-
82-
### Capture Logs On Simulator
83-
84-
```bash
85-
xcodebuildmcp logging start-simulator-log-capture --simulator-id SIMULATOR_UDID --bundle-id io.sentry.MyApp
86-
xcodebuildmcp logging stop-simulator-log-capture --log-session-id LOG_SESSION_ID
87-
```
88-
89-
### Debug A Running App (Simulator)
90-
91-
1. Launch the app.
92-
2. Attach the debugger after the app is fully launched.
93-
94-
Launch if not already running:
95-
```bash
96-
xcodebuildmcp simulator launch-app --bundle-id io.sentry.MyApp --simulator-id SIMULATOR_UDID
97-
```
98-
99-
Attach the debugger:
100-
101-
It's generally a good idea to wait for 1-2s for the app to fully launch before attaching the debugger.
102-
103-
```bash
104-
xcodebuildmcp debugging attach --bundle-id io.sentry.MyApp --simulator-id SIMULATOR_UDID
105-
```
106-
107-
To add/remove breakpoints, inspect stack/variables, and issue arbitrary LLDB commands, view debugging help:
108-
```bash
109-
xcodebuildmcp debugging --help
110-
```
111-
112-
113-
### Inspect UI And Automate Input
114-
115-
Snapshot UI accessibility tree, tap/swipe/type, and capture screenshots:
116-
117-
```bash
118-
xcodebuildmcp ui-automation snapshot-ui --simulator-id SIMULATOR_UDID
119-
xcodebuildmcp ui-automation tap --simulator-id SIMULATOR_UDID --label "Submit"
120-
xcodebuildmcp ui-automation tap --simulator-id SIMULATOR_UDID --id "SubmitButton"
121-
# Coordinate fallback when label/id is unavailable
122-
xcodebuildmcp ui-automation tap --simulator-id SIMULATOR_UDID --x 200 --y 400
123-
xcodebuildmcp ui-automation type-text --simulator-id SIMULATOR_UDID --text "hello"
124-
xcodebuildmcp ui-automation screenshot --simulator-id SIMULATOR_UDID --return-format path
125-
```
126-
127-
To see all UI automation tools, view UI automation help:
128-
```bash
129-
xcodebuildmcp ui-automation --help
130-
```
131-
132-
### macOS App Build/Run
133-
134-
```bash
135-
xcodebuildmcp macos build --scheme MyMacApp --project-path ./MyMacApp.xcodeproj
136-
xcodebuildmcp macos build-and-run --scheme MyMacApp --project-path ./MyMacApp.xcodeproj
137-
```
138-
139-
To see all macOS tools, view macOS help:
140-
```bash
141-
xcodebuildmcp macos --help
142-
```
143-
144-
### SwiftPM Package Workflows
145-
146-
```bash
147-
xcodebuildmcp swift-package list
148-
xcodebuildmcp swift-package build --package-path ./MyPackage
149-
xcodebuildmcp swift-package test --package-path ./MyPackage
150-
```
151-
152-
To see all SwiftPM tools, view SwiftPM help:
153-
```bash
154-
xcodebuildmcp swift-package --help
29+
xcodebuildmcp --help
15530
```
15631

157-
### Project Discovery
32+
## Step 2: Use Help-First Discovery
15833

34+
Discover workflows and arguments from the CLI itself:
15935
```bash
160-
xcodebuildmcp project-discovery discover-projects --workspace-root .
161-
xcodebuildmcp project-discovery list-schemes --project-path ./MyApp.xcodeproj
162-
xcodebuildmcp project-discovery get-app-bundle-id --app-path ./Build/MyApp.app
36+
xcodebuildmcp --help
37+
xcodebuildmcp tools
38+
xcodebuildmcp <workflow> --help
39+
xcodebuildmcp <workflow> <tool> --help
16340
```
16441

165-
To see all project discovery tools, view project discovery help:
166-
```bash
167-
xcodebuildmcp project-discovery --help
168-
```
42+
Use this discovery path instead of memorizing static tool lists.
16943

170-
### Scaffolding new projects
44+
## Step 3: Keep Execution Minimal
17145

172-
It's worth viewing the --help for the scaffolding tools to see the available options.
173-
Here are some minimal examples:
46+
- Choose the smallest command sequence that satisfies the request.
47+
- Prefer direct workflow commands over manual multi-step chains unless explicitly requested.
48+
- For simulator run intent, prefer the combined `build-and-run` command.
49+
- Do not chain `build` then `build-and-run` unless explicitly requested.
17450

175-
```bash
176-
xcodebuildmcp project-scaffolding scaffold-ios --project-name MyApp --output-path ./Projects
177-
xcodebuildmcp project-scaffolding scaffold-macos --project-name MyMacApp --output-path ./Projects
178-
```
51+
## Capability Overview
17952

180-
To see all project scaffolding tools, view project scaffolding help:
181-
```bash
182-
xcodebuildmcp project-scaffolding --help
183-
```
53+
`xcodebuildmcp` supports:
54+
- simulator and device build/test/run
55+
- debugging and log capture
56+
- UI automation
57+
- project discovery and scaffolding
58+
- session defaults and workflow configuration
18459

185-
## Daemon Notes (Stateful Tools)
60+
## Exit Criteria
18661

187-
Stateful tools (logs, debug, video recording, background run) go through a per-workspace daemon that auto-starts, if you find you are getting errors with the stateful tools, you can manage the daemon process manually.
188-
189-
```bash
190-
xcodebuildmcp daemon status
191-
xcodebuildmcp daemon restart
192-
```
193-
194-
To see all daemon commands, view daemon help:
195-
```bash
196-
xcodebuildmcp daemon --help
197-
```
62+
- CLI presence is verified or installation steps are provided.
63+
- Commands are discovered via `--help` / `tools`.
64+
- Session defaults are checked before first build/run/test action.

0 commit comments

Comments
 (0)