Skip to content

Commit f0bd066

Browse files
authored
Merge pull request #202 from cameroncooke/xcode-tools-support
Xcode IDE and Xcode MCP support + Insane refactor of tool/workflow management, discovery and run-time visibility
2 parents 84c29d1 + 13807c9 commit f0bd066

File tree

430 files changed

+14105
-7897
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

430 files changed

+14105
-7897
lines changed

.claude/agents/xcodebuild-mcp-qa-tester.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ After testing `list_sims` tool, update the report:
7676
## Detailed Test Results
7777

7878
### Tool: list_sims ✅ PASSED
79-
**Command:** `npx reloaderoo@latest inspect call-tool list_sims --params '{}' -- node build/index.js`
79+
**Command:** `npx reloaderoo@latest inspect call-tool list_sims --params '{}' -- node build/cli.js mcp`
8080
**Verification:** Command returned JSON array with 6 simulator objects
8181
**Validation Summary:** Successfully discovered 6 available simulators with UUIDs, names, and boot status
8282
**Timestamp:** 2025-01-29 14:30:15
@@ -87,8 +87,8 @@ After testing `list_sims` tool, update the report:
8787
### Pre-Testing Setup
8888
- Always start by building the project: `npm run build`
8989
- Verify Reloaderoo is available: `npx reloaderoo@latest --help`
90-
- Check server connectivity: `npx reloaderoo@latest inspect ping -- node build/index.js`
91-
- Get server information: `npx reloaderoo@latest inspect server-info -- node build/index.js`
90+
- Check server connectivity: `npx reloaderoo@latest inspect ping -- node build/cli.js mcp`
91+
- Get server information: `npx reloaderoo@latest inspect server-info -- node build/cli.js mcp`
9292

9393
### Systematic Testing Workflow
9494
1. **Create Initial Report**: Generate test report with all checkboxes unchecked
@@ -108,15 +108,15 @@ After testing `list_sims` tool, update the report:
108108

109109
### Tool Testing Process
110110
For each tool:
111-
1. Execute test with `npx reloaderoo@latest inspect call-tool <tool_name> --params '<json>' -- node build/index.js`
111+
1. Execute test with `npx reloaderoo@latest inspect call-tool <tool_name> --params '<json>' -- node build/cli.js mcp`
112112
2. Verify response format and content
113113
3. **IMMEDIATELY** update test report with result
114114
4. Check the box and add detailed verification summary
115115
5. Move to next tool
116116

117117
### Resource Testing Process
118118
For each resource:
119-
1. Execute test with `npx reloaderoo@latest inspect read-resource "<uri>" -- node build/index.js`
119+
1. Execute test with `npx reloaderoo@latest inspect read-resource "<uri>" -- node build/cli.js mcp`
120120
2. Verify resource accessibility and content format
121121
3. **IMMEDIATELY** update test report with result
122122
4. Check the box and add detailed verification summary

.claude/commands/rp-build-cli.md

Lines changed: 44 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Build with rp-cli context builder → chat → implement
33
repoprompt_managed: true
4-
repoprompt_commands_version: 5
4+
repoprompt_skills_version: 6
55
repoprompt_variant: cli
66
---
77

@@ -40,9 +40,12 @@ rp-cli -e 'select set src/ && context'
4040

4141
Use `rp-cli -e 'describe <tool>'` for help on a specific tool, or `rp-cli --help` for CLI usage.
4242

43+
**⚠️ TIMEOUT WARNING:** The `builder` and `chat` commands can take several minutes to complete. When invoking rp-cli, **set your command timeout to at least 2700 seconds (45 minutes)** to avoid premature termination.
44+
4345
---
4446
## The Workflow
4547

48+
0. **Verify workspace** – Confirm the target codebase is loaded
4649
1. **Quick scan** – Understand how the task relates to the codebase
4750
2. **Context builder** – Call `builder` with a clear prompt to get deep context + an architectural plan
4851
3. **Refine with chat** – Use `chat` to clarify the plan if needed
@@ -53,26 +56,51 @@ Use `rp-cli -e 'describe <tool>'` for help on a specific tool, or `rp-cli --help
5356
## CRITICAL REQUIREMENT
5457

5558
⚠️ **DO NOT START IMPLEMENTATION** until you have:
56-
1. Completed Phase 1 (Quick Scan)
57-
2. **Called `builder`** and received its plan
59+
1. Completed Phase 0 (Workspace Verification)
60+
2. Completed Phase 1 (Quick Scan)
61+
3. **Called `builder`** and received its plan
5862

5963
Skipping `builder` results in shallow implementations that miss architectural patterns, related code, and edge cases. The quick scan alone is NOT sufficient for implementation.
6064

6165
---
6266

67+
## Phase 0: Workspace Verification (REQUIRED)
68+
69+
Before any exploration, confirm the target codebase is loaded:
70+
71+
```bash
72+
# First, list available windows to find the right one
73+
rp-cli -e 'windows'
74+
75+
# Then check roots in a specific window (REQUIRED - CLI cannot auto-bind)
76+
rp-cli -w <window_id> -e 'tree --type roots'
77+
```
78+
79+
**Check the output:**
80+
- If your target root appears in a window → note the window ID and proceed to Phase 1
81+
- If not → the codebase isn't loaded in any window
82+
83+
**CLI Window Routing (CRITICAL):**
84+
- CLI invocations are stateless—you MUST pass `-w <window_id>` to target the correct window
85+
- Use `rp-cli -e 'windows'` to list all open windows and their workspaces
86+
- Always include `-w <window_id>` in ALL subsequent commands
87+
- Without `-w`, commands may target the wrong workspace
88+
89+
---
90+
6391
## Phase 1: Quick Scan (LIMITED - 2-3 tool calls max)
6492

6593
⚠️ **This phase is intentionally brief.** Do NOT do extensive exploration here—that's what `builder` is for.
6694

6795
Start by getting a lay of the land with the file tree:
6896
```bash
69-
rp-cli -e 'tree'
97+
rp-cli -w <window_id> -e 'tree'
7098
```
7199

72100
Then use targeted searches to understand how the task maps to the codebase:
73101
```bash
74-
rp-cli -e 'search "<key term from task>"'
75-
rp-cli -e 'structure RootName/likely/relevant/area/'
102+
rp-cli -w <window_id> -e 'search "<key term from task>"'
103+
rp-cli -w <window_id> -e 'structure RootName/likely/relevant/area/'
76104
```
77105

78106
Use what you learn to **reformulate the user's prompt** with added clarity—reference specific modules, patterns, or terminology from the codebase.
@@ -86,7 +114,7 @@ Use what you learn to **reformulate the user's prompt** with added clarity—ref
86114
Call `builder` with your informed prompt. Use `response_type: "plan"` to get an actionable architectural plan.
87115

88116
```bash
89-
rp-cli -e 'builder "<reformulated prompt with codebase context>" --response-type plan'
117+
rp-cli -w <window_id> -e 'builder "<reformulated prompt with codebase context>" --response-type plan'
90118
```
91119

92120
**What you get back:**
@@ -139,21 +167,21 @@ Implement the plan directly. **Do not use `chat` with `mode:"edit"`** – you im
139167
**Primary tools:**
140168
```bash
141169
# Modify existing files (search/replace) - JSON format required
142-
rp-cli -e 'call apply_edits {"path":"Root/File.swift","search":"old","replace":"new"}'
170+
rp-cli -w <window_id> -e 'call apply_edits {"path":"Root/File.swift","search":"old","replace":"new"}'
143171

144172
# Multiline edits
145-
rp-cli -e 'call apply_edits {"path":"Root/File.swift","search":"old\ntext","replace":"new\ntext"}'
173+
rp-cli -w <window_id> -e 'call apply_edits {"path":"Root/File.swift","search":"old\ntext","replace":"new\ntext"}'
146174

147175
# Create new files
148-
rp-cli -e 'file create Root/NewFile.swift "content..."'
176+
rp-cli -w <window_id> -e 'file create Root/NewFile.swift "content..."'
149177

150178
# Read specific sections during implementation
151-
rp-cli -e 'read Root/File.swift --start-line 50 --limit 30'
179+
rp-cli -w <window_id> -e 'read Root/File.swift --start-line 50 --limit 30'
152180
```
153181

154182
**Ask the chat when stuck:**
155183
```bash
156-
rp-cli -t '<tab_id>' -e 'chat "I'\''m implementing X but unsure about Y. What pattern should I follow?" --mode chat'
184+
rp-cli -w <window_id> -t '<tab_id>' -e 'chat "I'\''m implementing X but unsure about Y. What pattern should I follow?" --mode chat'
157185
```
158186

159187
---
@@ -169,13 +197,13 @@ rp-cli -t '<tab_id>' -e 'chat "I'\''m implementing X but unsure about Y. What pa
169197

170198
```bash
171199
# Check current selection and tokens
172-
rp-cli -e 'select get'
200+
rp-cli -w <window_id> -e 'select get'
173201

174202
# Add a file if needed
175-
rp-cli -e 'select add Root/path/to/file.swift'
203+
rp-cli -w <window_id> -e 'select add Root/path/to/file.swift'
176204

177205
# Add a slice of a large file
178-
rp-cli -e 'select add Root/large/file.swift:100-200'
206+
rp-cli -w <window_id> -e 'select add Root/large/file.swift:100-200'
179207
```
180208

181209
**Chat sees only the selection:** If you need the chat's insight on a file, it must be selected first.
@@ -193,6 +221,7 @@ rp-cli -e 'select add Root/large/file.swift:100-200'
193221
- 🚫 **CRITICAL:** Doing extensive exploration (5+ tool calls) before calling `builder` – the quick scan should be 2-3 calls max
194222
- 🚫 Reading full file contents during Phase 1 – save that for after `builder` builds context
195223
- 🚫 Convincing yourself you understand enough to skip `builder` – you don't
224+
- 🚫 **CLI:** Forgetting to pass `-w <window_id>` – CLI invocations are stateless and require explicit window targeting
196225

197226
---
198227

.claude/commands/rp-investigate-cli.md

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Deep codebase investigation and architecture research with rp-cli commands
33
repoprompt_managed: true
4-
repoprompt_commands_version: 5
4+
repoprompt_skills_version: 6
55
repoprompt_variant: cli
66
---
77

@@ -40,6 +40,8 @@ rp-cli -e 'select set src/ && context'
4040

4141
Use `rp-cli -e 'describe <tool>'` for help on a specific tool, or `rp-cli --help` for CLI usage.
4242

43+
**⚠️ TIMEOUT WARNING:** The `builder` and `chat` commands can take several minutes to complete. When invoking rp-cli, **set your command timeout to at least 2700 seconds (45 minutes)** to avoid premature termination.
44+
4345
---
4446
## Investigation Protocol
4547

@@ -49,6 +51,27 @@ Use `rp-cli -e 'describe <tool>'` for help on a specific tool, or `rp-cli --help
4951
3. **Question everything** - if something seems off, investigate it
5052
4. **Use `builder` aggressively** - it's designed for deep exploration
5153

54+
### Phase 0: Workspace Verification (REQUIRED)
55+
56+
Before any investigation, confirm the target codebase is loaded:
57+
58+
```bash
59+
# First, list available windows to find the right one
60+
rp-cli -e 'windows'
61+
62+
# Then check roots in a specific window (REQUIRED - CLI cannot auto-bind)
63+
rp-cli -w <window_id> -e 'tree --type roots'
64+
```
65+
66+
**Check the output:**
67+
- If your target root appears in a window → note the window ID and proceed to Phase 1
68+
- If not → the codebase isn't loaded in any window
69+
70+
**CLI Window Routing (CRITICAL):**
71+
- CLI invocations are stateless—you MUST pass `-w <window_id>` to target the correct window
72+
- Use `rp-cli -e 'windows'` to list all open windows and their workspaces
73+
- Always include `-w <window_id>` in ALL subsequent commands
74+
5275
### Phase 1: Initial Assessment
5376

5477
1. Read any provided files/reports (traces, logs, error reports)
@@ -62,7 +85,7 @@ Use `rp-cli -e 'describe <tool>'` for help on a specific tool, or `rp-cli --help
6285
Use `builder` with detailed instructions:
6386

6487
```bash
65-
rp-cli -e 'builder "Investigate: <specific area>
88+
rp-cli -w <window_id> -e 'builder "Investigate: <specific area>
6689
6790
Symptoms observed:
6891
- <symptom 1>
@@ -82,10 +105,10 @@ Areas to explore:
82105
After `builder` returns, continue with targeted questions:
83106

84107
```bash
85-
rp-cli -t '<tab_id>' -e 'chat "<specific follow-up based on findings>" --mode plan'
108+
rp-cli -w <window_id> -t '<tab_id>' -e 'chat "<specific follow-up based on findings>" --mode plan'
86109
```
87110

88-
> Pass `-t <tab_id>` to target the same tab across separate CLI invocations.
111+
> Pass `-w <window_id>` to target the correct window and `-t <tab_id>` to target the same tab across separate CLI invocations.
89112
90113
### Phase 4: Evidence Gathering
91114

@@ -156,12 +179,14 @@ Create a findings report as you investigate:
156179
## Anti-patterns to Avoid
157180

158181
- 🚫 **CRITICAL:** Skipping `builder` and attempting to investigate by reading files manually – you'll miss critical context
182+
- 🚫 Skipping Phase 0 (Workspace Verification) – you must confirm the target codebase is loaded first
159183
- 🚫 Doing extensive exploration (5+ tool calls) before calling `builder` – initial assessment should be brief
160184
- 🚫 Drawing conclusions before `builder` has built proper context
161185
- 🚫 Reading many full files during Phase 1 – save deep reading for after `builder`
162186
- 🚫 Assuming you understand the issue without systematic exploration via `builder`
163187
- 🚫 Using only chat follow-ups without an initial `builder` call
188+
- 🚫 **CLI:** Forgetting to pass `-w <window_id>` – CLI invocations are stateless and require explicit window targeting
164189

165190
---
166191

167-
Now begin the investigation. Read any provided context, then **immediately** use `builder` to start systematic exploration. Do not attempt manual exploration first.
192+
Now begin the investigation. First run `rp-cli -e 'windows'` to find the correct window, then Read any provided context, then **immediately** use `builder` to start systematic exploration. Do not attempt manual exploration first.

.claude/commands/rp-oracle-export-cli.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Export context for oracle consultation using rp-cli
33
repoprompt_managed: true
4-
repoprompt_commands_version: 5
4+
repoprompt_skills_version: 6
55
repoprompt_variant: cli
66
---
77

@@ -22,10 +22,31 @@ You don't need to specify which files to include—just describe what you need h
2222

2323
## Workflow
2424

25+
### 0. Workspace Verification (REQUIRED)
26+
27+
Before building context, confirm the target codebase is loaded:
28+
29+
```bash
30+
# First, list available windows to find the right one
31+
rp-cli -e 'windows'
32+
33+
# Then check roots in a specific window (REQUIRED - CLI cannot auto-bind)
34+
rp-cli -w <window_id> -e 'tree --type roots'
35+
```
36+
37+
**Check the output:**
38+
- If your target root appears in a window → note the window ID and proceed
39+
- If not → the codebase isn't loaded in any window
40+
41+
**CLI Window Routing (CRITICAL):**
42+
- CLI invocations are stateless—you MUST pass `-w <window_id>` to target the correct window
43+
- Use `rp-cli -e 'windows'` to list all open windows and their workspaces
44+
- Always include `-w <window_id>` in ALL subsequent commands
45+
2546
### 1. Build Context
2647

2748
```bash
28-
rp-cli -e 'builder "<the task/question above>" --response-type clarify'
49+
rp-cli -w <window_id> -e 'builder "<the task/question above>" --response-type clarify'
2950
```
3051

3152
Wait for context_builder to complete. It will explore the codebase and build optimal context.
@@ -35,7 +56,7 @@ Wait for context_builder to complete. It will explore the codebase and build opt
3556
Confirm the export path with the user (default: `~/Downloads/oracle-prompt.md`), then export:
3657

3758
```bash
38-
rp-cli -e 'prompt export "<confirmed path>"'
59+
rp-cli -w <window_id> -e 'prompt export "<confirmed path>"'
3960
```
4061

4162
Report the export path and token count to the user.

0 commit comments

Comments
 (0)