diff --git a/.claude/agents/xcodebuild-mcp-qa-tester.md b/.claude/agents/xcodebuild-mcp-qa-tester.md
new file mode 100644
index 00000000..a055b237
--- /dev/null
+++ b/.claude/agents/xcodebuild-mcp-qa-tester.md
@@ -0,0 +1,220 @@
+---
+name: xcodebuild-mcp-qa-tester
+description: Use this agent when you need comprehensive black box testing of the XcodeBuildMCP server using Reloaderoo. This agent should be used after code changes, before releases, or when validating tool functionality. Examples:\n\n- \n Context: The user has made changes to XcodeBuildMCP tools and wants to validate everything works correctly.\n user: "I've updated the simulator tools and need to make sure they all work properly"\n assistant: "I'll use the xcodebuild-mcp-qa-tester agent to perform comprehensive black box testing of all simulator tools using Reloaderoo"\n \n Since the user needs thorough testing of XcodeBuildMCP functionality, use the xcodebuild-mcp-qa-tester agent to systematically validate all tools and resources.\n \n\n\n- \n Context: The user is preparing for a release and needs full QA validation.\n user: "We're about to release version 2.1.0 and need complete testing coverage"\n assistant: "I'll launch the xcodebuild-mcp-qa-tester agent to perform thorough black box testing of all XcodeBuildMCP tools and resources following the manual testing procedures"\n \n For release validation, the QA tester agent should perform comprehensive testing to ensure all functionality works as expected.\n \n
+tools: Task, Bash, Glob, Grep, LS, ExitPlanMode, Read, NotebookRead, WebFetch, TodoWrite, WebSearch, ListMcpResourcesTool, ReadMcpResourceTool
+color: purple
+---
+
+You are a senior quality assurance software engineer specializing in black box testing of the XcodeBuildMCP server. Your expertise lies in systematic, thorough testing using the Reloaderoo MCP package to validate all tools and resources exposed by the MCP server.
+
+## Your Core Responsibilities
+
+1. **Follow Manual Testing Procedures**: Strictly adhere to the instructions in @docs/MANUAL_TESTING.md for systematic test execution
+2. **Use Reloaderoo Exclusively**: Utilize the Reloaderoo CLI inspection tools as documented in @docs/RELOADEROO.md for all testing activities
+3. **Comprehensive Coverage**: Test ALL tools and resources - never skip or assume functionality works
+4. **Black Box Approach**: Test from the user perspective without knowledge of internal implementation details
+5. **Live Documentation**: Create and continuously update a markdown test report showing real-time progress
+6. **MANDATORY COMPLETION**: Continue testing until EVERY SINGLE tool and resource has been tested - DO NOT STOP until 100% completion is achieved
+
+## MANDATORY Test Report Creation and Updates
+
+### Step 1: Create Initial Test Report (IMMEDIATELY)
+**BEFORE TESTING BEGINS**, you MUST:
+
+1. **Create Test Report File**: Generate a markdown file in the workspace root named `TESTING_REPORT__.md`
+2. **Include Report Header**: Date, time, environment information, and testing scope
+3. **Discovery Phase**: Run `list-tools` and `list-resources` to get complete inventory
+4. **Create Checkbox Lists**: Add unchecked markdown checkboxes for every single tool and resource discovered
+
+### Test Report Initial Structure
+```markdown
+# XcodeBuildMCP Testing Report
+**Date:** YYYY-MM-DD HH:MM:SS
+**Environment:** [System details]
+**Testing Scope:** Comprehensive black box testing of all tools and resources
+
+## Test Summary
+- **Total Tools:** [X]
+- **Total Resources:** [Y]
+- **Tests Completed:** 0/[X+Y]
+- **Tests Passed:** 0
+- **Tests Failed:** 0
+
+## Tools Testing Checklist
+- [ ] Tool: tool_name_1 - Test with valid parameters
+- [ ] Tool: tool_name_2 - Test with valid parameters
+[... all tools discovered ...]
+
+## Resources Testing Checklist
+- [ ] Resource: resource_uri_1 - Validate content and accessibility
+- [ ] Resource: resource_uri_2 - Validate content and accessibility
+[... all resources discovered ...]
+
+## Detailed Test Results
+[Updated as tests are completed]
+
+## Failed Tests
+[Updated if any failures occur]
+```
+
+### Step 2: Continuous Updates (AFTER EACH TEST)
+**IMMEDIATELY after completing each test**, you MUST update the test report with:
+
+1. **Check the box**: Change `- [ ]` to `- [x]` for the completed test
+2. **Update test summary counts**: Increment completed/passed/failed counters
+3. **Add detailed result**: Append to "Detailed Test Results" section with:
+ - Test command used
+ - Verification method
+ - Validation summary
+ - Pass/fail status
+
+### Live Update Example
+After testing `list_sims` tool, update the report:
+```markdown
+- [x] Tool: list_sims - Test with valid parameters ✅ PASSED
+
+## Detailed Test Results
+
+### Tool: list_sims ✅ PASSED
+**Command:** `npx reloaderoo@latest inspect call-tool list_sims --params '{}' -- node build/index.js`
+**Verification:** Command returned JSON array with 6 simulator objects
+**Validation Summary:** Successfully discovered 6 available simulators with UUIDs, names, and boot status
+**Timestamp:** 2025-01-29 14:30:15
+```
+
+## Testing Methodology
+
+### Pre-Testing Setup
+- Always start by building the project: `npm run build`
+- Verify Reloaderoo is available: `npx reloaderoo@latest --help`
+- Check server connectivity: `npx reloaderoo@latest inspect ping -- node build/index.js`
+- Get server information: `npx reloaderoo@latest inspect server-info -- node build/index.js`
+
+### Systematic Testing Workflow
+1. **Create Initial Report**: Generate test report with all checkboxes unchecked
+2. **Individual Testing**: Test each tool/resource systematically
+3. **Live Updates**: Update report immediately after each test completion
+4. **Continuous Tracking**: Report serves as real-time progress tracker
+5. **CONTINUOUS EXECUTION**: Never stop until ALL tools and resources are tested (100% completion)
+6. **Progress Monitoring**: Check total tested vs total available - continue if any remain untested
+7. **Final Review**: Ensure all checkboxes are marked and results documented
+
+### CRITICAL: NO EARLY TERMINATION
+- **NEVER STOP** testing until every single tool and resource has been tested
+- If you have tested X out of Y items, IMMEDIATELY continue testing the remaining Y-X items
+- The only acceptable completion state is 100% coverage (all checkboxes checked)
+- Do not summarize or conclude until literally every tool and resource has been individually tested
+- Use the test report checkbox count as your progress indicator - if any boxes remain unchecked, CONTINUE TESTING
+
+### Tool Testing Process
+For each tool:
+1. Execute test with `npx reloaderoo@latest inspect call-tool --params '' -- node build/index.js`
+2. Verify response format and content
+3. **IMMEDIATELY** update test report with result
+4. Check the box and add detailed verification summary
+5. Move to next tool
+
+### Resource Testing Process
+For each resource:
+1. Execute test with `npx reloaderoo@latest inspect read-resource "" -- node build/index.js`
+2. Verify resource accessibility and content format
+3. **IMMEDIATELY** update test report with result
+4. Check the box and add detailed verification summary
+5. Move to next resource
+
+## Quality Standards
+
+### Thoroughness Over Speed
+- **NEVER rush testing** - take time to be comprehensive
+- Test every single tool and resource without exception
+- Update the test report after every single test - no batching
+- The markdown report is the single source of truth for progress
+
+### Test Documentation Requirements
+- Record the exact command used for each test
+- Document expected vs actual results
+- Note any warnings, errors, or unexpected behavior
+- Include full JSON responses for failed tests
+- Categorize issues by severity (critical, major, minor)
+- **MANDATORY**: Update test report immediately after each test completion
+
+### Validation Criteria
+- All tools must respond without errors for valid inputs
+- Error messages must be clear and actionable for invalid inputs
+- JSON responses must be properly formatted
+- Resource URIs must be accessible and return valid data
+- Tool descriptions must accurately reflect functionality
+
+## Testing Environment Considerations
+
+### Prerequisites Validation
+- Verify Xcode is installed and accessible
+- Check for required simulators and devices
+- Validate development environment setup
+- Ensure all dependencies are available
+
+### Platform-Specific Testing
+- Test iOS simulator tools with actual simulators
+- Validate device tools (when devices are available)
+- Test macOS-specific functionality
+- Verify Swift Package Manager integration
+
+## Test Report Management
+
+### File Naming Convention
+- Format: `TESTING_REPORT__.md`
+- Location: Workspace root directory
+- Example: `TESTING_REPORT_2025-01-29_14-30.md`
+
+### Update Requirements
+- **Real-time updates**: Update after every single test completion
+- **No batching**: Never wait to update multiple tests at once
+- **Checkbox tracking**: Visual progress through checked/unchecked boxes
+- **Detailed results**: Each test gets a dedicated result section
+- **Summary statistics**: Keep running totals updated
+
+### Verification Summary Requirements
+Every test result MUST answer: "How did you know this test passed?"
+
+Examples of strong verification summaries:
+- `Successfully discovered 84 tools in server response`
+- `Returned valid app bundle path: /path/to/MyApp.app`
+- `Listed 6 simulators with expected UUID format and boot status`
+- `Resource returned JSON array with 4 device objects containing UDID and name fields`
+- `Tool correctly rejected invalid parameters with clear error message`
+
+## Error Investigation Protocol
+
+1. **Reproduce Consistently**: Ensure errors can be reproduced reliably
+2. **Isolate Variables**: Test with minimal parameters to isolate issues
+3. **Check Prerequisites**: Verify all required tools and environments are available
+4. **Document Context**: Include system information, versions, and environment details
+5. **Update Report**: Document failures immediately in the test report
+
+## Critical Success Criteria
+
+- ✅ Test report created BEFORE any testing begins with all checkboxes unchecked
+- ✅ Every single tool has its own checkbox and detailed result section
+- ✅ Every single resource has its own checkbox and detailed result section
+- ✅ Report updated IMMEDIATELY after each individual test completion
+- ✅ No tool or resource is skipped or grouped together
+- ✅ Each verification summary clearly explains how success was determined
+- ✅ Real-time progress tracking through checkbox completion
+- ✅ Test report serves as the single source of truth for all testing progress
+- ✅ **100% COMPLETION MANDATORY**: All checkboxes must be checked before considering testing complete
+
+## ABSOLUTE COMPLETION REQUIREMENT
+
+**YOU MUST NOT STOP TESTING UNTIL:**
+- Every single tool discovered by `list-tools` has been individually tested
+- Every single resource discovered by `list-resources` has been individually tested
+- All checkboxes in your test report are marked as complete
+- The test summary shows X/X completion (100%)
+
+**IF TESTING IS NOT 100% COMPLETE:**
+- Immediately identify which tools/resources remain untested
+- Continue systematic testing of the remaining items
+- Update the test report after each additional test
+- Do not provide final summaries or conclusions until literally everything is tested
+
+Remember: Your role is to be the final quality gate before release. The test report you create and continuously update is the definitive record of testing progress and results. Be meticulous, be thorough, and update the report after every single test completion - never batch updates or wait until the end. **NEVER CONCLUDE TESTING UNTIL 100% COMPLETION IS ACHIEVED.**
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index e6d71353..741777c2 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -35,5 +35,8 @@ jobs:
- name: Check formatting
run: npm run format:check
+ - name: Type check
+ run: npm run typecheck
+
- name: Run tests
run: npm test
diff --git a/CLAUDE.md b/CLAUDE.md
index 9f877704..55db868c 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -24,7 +24,7 @@ npm run diagnostic # Diagnostic CLI
### Development with Reloaderoo
-**Reloaderoo** provides CLI-based testing and hot-reload capabilities for XcodeBuildMCP without requiring MCP client configuration.
+**Reloaderoo** (v1.1.2+) provides CLI-based testing and hot-reload capabilities for XcodeBuildMCP without requiring MCP client configuration.
#### Quick Start
@@ -88,11 +88,11 @@ npx reloaderoo inspect list-tools --working-dir /custom/path -- node build/index
# Timeout configuration
npx reloaderoo inspect call-tool slow_tool --timeout 60000 --params '{}' -- node build/index.js
-# Raw JSON output (no formatting)
-npx reloaderoo inspect server-info --raw -- node build/index.js
+# Use timeout configuration if needed
+npx reloaderoo inspect server-info --timeout 60000 -- node build/index.js
-# Debug logging
-npx reloaderoo inspect list-tools --log-level debug -- node build/index.js
+# Debug logging (use proxy mode for detailed logging)
+npx reloaderoo proxy --log-level debug -- node build/index.js
```
#### Key Benefits
diff --git a/docs/ESLINT_TYPE_SAFETY.md b/docs/ESLINT_TYPE_SAFETY.md
new file mode 100644
index 00000000..b0c4760c
--- /dev/null
+++ b/docs/ESLINT_TYPE_SAFETY.md
@@ -0,0 +1,136 @@
+# ESLint Type Safety Rules
+
+This document explains the ESLint rules added to prevent TypeScript anti-patterns and improve type safety.
+
+## Rules Added
+
+### Error-Level Rules (Block CI/Deployment)
+
+These rules prevent dangerous type casting patterns that can lead to runtime errors:
+
+#### `@typescript-eslint/consistent-type-assertions`
+- **Purpose**: Prevents dangerous object literal type assertions
+- **Example**: Prevents `{ foo: 'bar' } as ComplexType`
+- **Rationale**: Object literal assertions can hide missing properties
+
+#### `@typescript-eslint/no-unsafe-*` (5 rules)
+- **no-unsafe-argument**: Prevents passing `any` to typed parameters
+- **no-unsafe-assignment**: Prevents assigning `any` to typed variables
+- **no-unsafe-call**: Prevents calling `any` as a function
+- **no-unsafe-member-access**: Prevents accessing properties on `any`
+- **no-unsafe-return**: Prevents returning `any` from typed functions
+
+**Example of prevented anti-pattern:**
+```typescript
+// ❌ BAD - This would now be an ESLint error
+function handleParams(args: Record) {
+ const typedParams = args as MyToolParams; // Unsafe casting
+ return typedParams.someProperty as string; // Unsafe member access
+}
+
+// ✅ GOOD - Proper validation approach
+function handleParams(args: Record) {
+ const typedParams = MyToolParamsSchema.parse(args); // Runtime validation
+ return typedParams.someProperty; // Type-safe access
+}
+```
+
+#### `@typescript-eslint/ban-ts-comment`
+- **Purpose**: Prevents unsafe TypeScript comments
+- **Blocks**: `@ts-ignore`, `@ts-nocheck`
+- **Allows**: `@ts-expect-error` (with description)
+
+### Warning-Level Rules (Encourage Best Practices)
+
+These rules encourage modern TypeScript patterns but don't block builds:
+
+#### `@typescript-eslint/prefer-nullish-coalescing`
+- **Purpose**: Prefer `??` over `||` for default values
+- **Example**: `value ?? 'default'` instead of `value || 'default'`
+- **Rationale**: More precise handling of falsy values (0, '', false)
+
+#### `@typescript-eslint/prefer-optional-chain`
+- **Purpose**: Prefer `?.` for safe property access
+- **Example**: `obj?.prop` instead of `obj && obj.prop`
+- **Rationale**: More concise and readable
+
+#### `@typescript-eslint/prefer-as-const`
+- **Purpose**: Prefer `as const` for literal types
+- **Example**: `['a', 'b'] as const` instead of `['a', 'b'] as string[]`
+
+## Test File Exceptions
+
+Test files (`.test.ts`) have relaxed rules for flexibility:
+- All `no-unsafe-*` rules are disabled
+- `no-explicit-any` is disabled
+- Tests often need to test error conditions and edge cases
+
+## Impact on Codebase
+
+### Current Status (Post-Implementation)
+- **387 total issues detected**
+ - **207 errors**: Require fixing for type safety
+ - **180 warnings**: Can be gradually improved
+
+### Gradual Migration Strategy
+
+1. **Phase 1** (Immediate): Error-level rules prevent new anti-patterns
+2. **Phase 2** (Ongoing): Gradually fix warning-level violations
+3. **Phase 3** (Future): Consider promoting warnings to errors
+
+### Benefits
+
+1. **Prevents Regression**: New code can't introduce the anti-patterns we just fixed
+2. **Runtime Safety**: Catches potential runtime errors at compile time
+3. **Code Quality**: Encourages modern TypeScript best practices
+4. **Developer Experience**: Better IDE support and autocomplete
+
+## Related Issues Fixed
+
+These rules prevent the specific anti-patterns identified in PR review:
+
+1. **✅ Type Casting in Parameters**: `args as SomeType` patterns now flagged
+2. **✅ Unsafe Property Access**: `params.field as string` patterns prevented
+3. **✅ Missing Validation**: Encourages schema validation over casting
+4. **✅ Return Type Mismatches**: Function signature inconsistencies caught
+5. **✅ Nullish Coalescing**: Promotes safer default value handling
+
+## Agent Orchestration for ESLint Fixes
+
+### Parallel Agent Strategy
+
+When fixing ESLint issues across the codebase:
+
+1. **Deploy Multiple Agents**: Run agents in parallel on different files
+2. **Single File Focus**: Each agent works on ONE tool file at a time
+3. **Individual Linting**: Agents run `npm run lint path/to/single/file.ts` only
+4. **Immediate Commits**: Commit each agent's work as soon as they complete
+5. **Never Wait**: Don't wait for all agents to finish before committing
+6. **Avoid Full Linting**: Never run `npm run lint` without a file path (eats context)
+7. **Progress Tracking**: Update todo list and periodically check overall status
+8. **Loop Until Done**: Keep deploying agents until all issues are resolved
+
+### Example Commands for Agents
+
+```bash
+# Single file linting (what agents should run)
+npm run lint src/mcp/tools/device-project/test_device_proj.ts
+
+# NOT this (too much context)
+npm run lint
+```
+
+### Commit Strategy
+
+- **Individual commits**: One commit per agent completion
+- **Clear messages**: `fix: resolve ESLint errors in tool_name.ts`
+- **Never batch**: Don't wait to commit multiple files together
+- **Progress preservation**: Each fix is immediately saved
+
+## Future Improvements
+
+Consider adding these rules in future iterations:
+
+- `@typescript-eslint/strict-boolean-expressions`: Stricter boolean logic
+- `@typescript-eslint/prefer-reduce-type-parameter`: Better generic usage
+- `@typescript-eslint/switch-exhaustiveness-check`: Complete switch statements
\ No newline at end of file
diff --git a/docs/MANUAL_TESTING.md b/docs/MANUAL_TESTING.md
new file mode 100644
index 00000000..152b46ba
--- /dev/null
+++ b/docs/MANUAL_TESTING.md
@@ -0,0 +1,749 @@
+# XcodeBuildMCP Manual Testing Guidelines
+
+This document provides comprehensive guidelines for manual black-box testing of XcodeBuildMCP using Reloaderoo inspect commands. This is the authoritative guide for validating all tools through the Model Context Protocol interface.
+
+## Table of Contents
+
+1. [Testing Philosophy](#testing-philosophy)
+2. [Black Box Testing via Reloaderoo](#black-box-testing-via-reloaderoo)
+3. [Testing Psychology & Bias Prevention](#testing-psychology--bias-prevention)
+4. [Tool Dependency Graph Testing Strategy](#tool-dependency-graph-testing-strategy)
+5. [Prerequisites](#prerequisites)
+6. [Step-by-Step Testing Process](#step-by-step-testing-process)
+7. [Error Testing](#error-testing)
+8. [Testing Report Generation](#testing-report-generation)
+9. [Troubleshooting](#troubleshooting)
+
+## Testing Philosophy
+
+### 🚨 CRITICAL: THOROUGHNESS OVER EFFICIENCY - NO SHORTCUTS ALLOWED
+
+**ABSOLUTE PRINCIPLE: EVERY TOOL MUST BE TESTED INDIVIDUALLY**
+
+**🚨 MANDATORY TESTING SCOPE - NO EXCEPTIONS:**
+- **EVERY SINGLE TOOL** - All tools must be tested individually, one by one
+- **NO REPRESENTATIVE SAMPLING** - Testing similar tools does NOT validate other tools
+- **NO PATTERN RECOGNITION SHORTCUTS** - Similar-looking tools may have different behaviors
+- **NO EFFICIENCY OPTIMIZATIONS** - Thoroughness is more important than speed
+- **NO TIME CONSTRAINTS** - This is a long-running task with no deadline pressure
+
+**❌ FORBIDDEN EFFICIENCY SHORTCUTS:**
+- **NEVER** assume testing `build_sim_id_proj` validates `build_sim_name_proj`
+- **NEVER** skip tools because they "look similar" to tested ones
+- **NEVER** use representative sampling instead of complete coverage
+- **NEVER** stop testing due to time concerns or perceived redundancy
+- **NEVER** group tools together for batch testing
+- **NEVER** make assumptions about untested tools based on tested patterns
+
+**✅ REQUIRED COMPREHENSIVE APPROACH:**
+1. **Individual Tool Testing**: Each tool gets its own dedicated test execution
+2. **Complete Documentation**: Every tool result must be recorded, regardless of outcome
+3. **Systematic Progress**: Use TodoWrite to track every single tool as tested/untested
+4. **Failure Documentation**: Test tools that cannot work and mark them as failed/blocked
+5. **No Assumptions**: Treat each tool as potentially unique requiring individual validation
+
+**TESTING COMPLETENESS VALIDATION:**
+- **Start Count**: Record exact number of tools discovered using `npm run tools`
+- **End Count**: Verify same number of tools have been individually tested
+- **Missing Tools = Testing Failure**: If any tools remain untested, the testing is incomplete
+- **TodoWrite Tracking**: Every tool must appear in todo list and be marked completed
+
+## Black Box Testing via Reloaderoo
+
+### 🚨 CRITICAL: Black Box Testing via Reloaderoo Inspect
+
+**DEFINITION: Black Box Testing**
+Black Box Testing means testing ONLY through external interfaces without any knowledge of internal implementation. For XcodeBuildMCP, this means testing exclusively through the Model Context Protocol (MCP) interface using Reloaderoo as the MCP client.
+
+**🚨 MANDATORY: RELOADEROO INSPECT IS THE ONLY ALLOWED TESTING METHOD**
+
+**ABSOLUTE TESTING RULES - NO EXCEPTIONS:**
+
+1. **✅ ONLY ALLOWED: Reloaderoo Inspect Commands**
+ - `npx reloaderoo@latest inspect call-tool "TOOL_NAME" --params 'JSON' -- node build/index.js`
+ - `npx reloaderoo@latest inspect list-tools -- node build/index.js`
+ - `npx reloaderoo@latest inspect read-resource "URI" -- node build/index.js`
+ - `npx reloaderoo@latest inspect server-info -- node build/index.js`
+ - `npx reloaderoo@latest inspect ping -- node build/index.js`
+
+2. **❌ COMPLETELY FORBIDDEN ACTIONS:**
+ - **NEVER** call `mcp__XcodeBuildMCP__tool_name()` functions directly
+ - **NEVER** use MCP server tools as if they were native functions
+ - **NEVER** access internal server functionality
+ - **NEVER** read source code to understand how tools work
+ - **NEVER** examine implementation files during testing
+ - **NEVER** diagnose internal server issues or registration problems
+ - **NEVER** suggest code fixes or implementation changes
+
+3. **🚨 CRITICAL VIOLATION EXAMPLES:**
+ ```typescript
+ // ❌ FORBIDDEN - Direct MCP tool calls
+ await mcp__XcodeBuildMCP__list_devices();
+ await mcp__XcodeBuildMCP__build_sim_id_proj({ ... });
+
+ // ❌ FORBIDDEN - Using tools as native functions
+ const devices = await list_devices();
+ const result = await diagnostic();
+
+ // ✅ CORRECT - Only through Reloaderoo inspect
+ npx reloaderoo@latest inspect call-tool "list_devices" --params '{}' -- node build/index.js
+ npx reloaderoo@latest inspect call-tool "diagnostic" --params '{}' -- node build/index.js
+ ```
+
+**WHY RELOADEROO INSPECT IS MANDATORY:**
+- **Higher Fidelity**: Provides clear input/output visibility for each tool call
+- **Real-world Simulation**: Tests exactly how MCP clients interact with the server
+- **Interface Validation**: Ensures MCP protocol compliance and proper JSON formatting
+- **Black Box Enforcement**: Prevents accidental access to internal implementation details
+- **Clean State**: Each tool call runs with a fresh MCP server instance, preventing cross-contamination
+
+**IMPORTANT: STATEFUL TOOL LIMITATIONS**
+
+**Reloaderoo Inspect Behavior:**
+Reloaderoo starts a fresh MCP server instance for each individual tool call and terminates it immediately after the response. This ensures:
+- ✅ **Clean Testing Environment**: No state contamination between tool calls
+- ✅ **Isolated Testing**: Each tool test is independent and repeatable
+- ✅ **Real-world Accuracy**: Simulates how most MCP clients interact with servers
+
+**Expected False Negatives:**
+Some tools rely on in-memory state within the MCP server and will fail when tested via Reloaderoo inspect. These failures are **expected and acceptable** as false negatives:
+
+- **`swift_package_stop`** - Requires in-memory process tracking from `swift_package_run`
+- **`stop_app_device`** - Requires in-memory process tracking from `launch_app_device`
+- **`stop_app_sim`** - Requires in-memory process tracking from `launch_app_sim`
+- **`stop_device_log_cap`** - Requires in-memory session tracking from `start_device_log_cap`
+- **`stop_sim_log_cap`** - Requires in-memory session tracking from `start_sim_log_cap`
+- **`stop_mac_app`** - Requires in-memory process tracking from `launch_mac_app`
+
+**Testing Protocol for Stateful Tools:**
+1. **Test the tool anyway** - Execute the Reloaderoo inspect command
+2. **Expect failure** - Tool will likely fail due to missing state
+3. **Mark as false negative** - Document the failure as expected due to stateful limitations
+4. **Continue testing** - Do not attempt to fix or investigate the failure
+5. **Report as finding** - Note in testing report that stateful tools failed as expected
+
+**COMPLETE COVERAGE REQUIREMENTS:**
+- ✅ **Test ALL tools individually** - No exceptions, every tool gets manual verification
+- ✅ **Follow dependency graphs** - Test tools in correct order based on data dependencies
+- ✅ **Capture key outputs** - Record UUIDs, paths, schemes needed by dependent tools
+- ✅ **Test real workflows** - Complete end-to-end workflows from discovery to execution
+- ✅ **Use tool-summary.js script** - Accurate tool/resource counting and discovery
+- ✅ **Document all observations** - Record exactly what you see via testing
+- ✅ **Report discrepancies as findings** - Note unexpected results without investigation
+
+**MANDATORY INDIVIDUAL TOOL TESTING PROTOCOL:**
+
+**Step 1: Create Complete Tool Inventory**
+```bash
+# Use the official tool summary script to get accurate tool count and list
+npm run tools > /tmp/summary_output.txt
+TOTAL_TOOLS=$(grep "Tools:" /tmp/summary_output.txt | awk '{print $2}')
+echo "TOTAL TOOLS TO TEST: $TOTAL_TOOLS"
+
+# Generate detailed tool list and extract tool names
+npm run tools:list > /tmp/tools_detailed.txt
+grep "^ • " /tmp/tools_detailed.txt | sed 's/^ • //' > /tmp/tool_names.txt
+```
+
+**Step 2: Create TodoWrite Task List for Every Tool**
+```bash
+# Create individual todo items for each tool discovered
+# Use the actual tool count from step 1
+# Example for first few tools:
+# 1. [ ] Test tool: diagnostic
+# 2. [ ] Test tool: list_devices
+# 3. [ ] Test tool: list_sims
+# ... (continue for ALL $TOTAL_TOOLS tools)
+```
+
+**Step 3: Test Each Tool Individually**
+For EVERY tool in the list:
+```bash
+# Test each tool individually - NO BATCHING
+npx reloaderoo@latest inspect call-tool "TOOL_NAME" --params 'APPROPRIATE_PARAMS' -- node build/index.js
+
+# Mark tool as completed in TodoWrite IMMEDIATELY after testing
+# Record result (success/failure/blocked) for each tool
+```
+
+**Step 4: Validate Complete Coverage**
+```bash
+# Verify all tools tested
+COMPLETED_TOOLS=$(count completed todo items)
+if [ $COMPLETED_TOOLS -ne $TOTAL_TOOLS ]; then
+ echo "ERROR: Testing incomplete. $COMPLETED_TOOLS/$TOTAL_TOOLS tested"
+ exit 1
+fi
+```
+
+**CRITICAL: NO TOOL LEFT UNTESTED**
+- **Every tool name from the JSON list must be individually tested**
+- **Every tool must have a TodoWrite entry that gets marked completed**
+- **Tools that fail due to missing parameters should be tested anyway and marked as blocked**
+- **Tools that require setup (like running processes) should be tested and documented as requiring dependencies**
+- **NO ASSUMPTIONS**: Test tools even if they seem redundant or similar to others
+
+**BLACK BOX TESTING ENFORCEMENT:**
+- ✅ **Test only through Reloaderoo MCP interface** - Simulates real-world MCP client usage
+- ✅ **Use task lists** - Track progress with TodoWrite tool for every single tool
+- ✅ **Tick off each tool** - Mark completed in task list after manual verification
+- ✅ **Manual oversight** - Human verification of each tool's input and output
+- ❌ **Never examine source code** - No reading implementation files during testing
+- ❌ **Never diagnose internal issues** - No investigation of build processes or tool registration
+- ❌ **Never suggest implementation fixes** - Report issues as findings, don't solve them
+- ❌ **Never use scripts for tool testing** - Each tool must be manually executed and verified
+
+## Testing Psychology & Bias Prevention
+
+**COMMON ANTI-PATTERNS TO AVOID:**
+
+**1. Efficiency Bias (FORBIDDEN)**
+- **Symptom**: "These tools look similar, I'll test one to validate the others"
+- **Correction**: Every tool is unique and must be tested individually
+- **Enforcement**: Count tools at start, verify same count tested at end
+
+**2. Pattern Recognition Override (FORBIDDEN)**
+- **Symptom**: "I see the pattern, the rest will work the same way"
+- **Correction**: Patterns may hide edge cases, bugs, or different implementations
+- **Enforcement**: No assumptions allowed, test every tool regardless of apparent similarity
+
+**3. Time Pressure Shortcuts (FORBIDDEN)**
+- **Symptom**: "This is taking too long, let me speed up by sampling"
+- **Correction**: This is explicitly a long-running task with no time constraints
+- **Enforcement**: Thoroughness is the ONLY priority, efficiency is irrelevant
+
+**4. False Confidence (FORBIDDEN)**
+- **Symptom**: "The architecture is solid, so all tools must work"
+- **Correction**: Architecture validation does not guarantee individual tool functionality
+- **Enforcement**: Test tools to discover actual issues, not to confirm assumptions
+
+**MANDATORY MINDSET:**
+- **Every tool is potentially broken** until individually tested
+- **Every tool may have unique edge cases** not covered by similar tools
+- **Every tool deserves individual attention** regardless of apparent redundancy
+- **Testing completion means EVERY tool tested**, not "enough tools to validate patterns"
+- **The goal is discovering problems**, not confirming everything works
+
+**TESTING COMPLETENESS CHECKLIST:**
+- [ ] Generated complete tool list using `npm run tools:list`
+- [ ] Created TodoWrite entry for every single tool
+- [ ] Tested every tool individually via Reloaderoo inspect
+- [ ] Marked every tool as completed in TodoWrite
+- [ ] Verified tool count: tested_count == total_count
+- [ ] Documented all results, including failures and blocked tools
+- [ ] Created final report covering ALL tools, not just successful ones
+
+## Tool Dependency Graph Testing Strategy
+
+**CRITICAL: Tools must be tested in dependency order:**
+
+1. **Foundation Tools** (provide data for other tools):
+ - `diagnostic` - System info
+ - `list_devices` - Device UUIDs
+ - `list_sims` - Simulator UUIDs
+ - `discover_projs` - Project/workspace paths
+
+2. **Discovery Tools** (provide metadata for build tools):
+ - `list_schems_proj` / `list_schems_ws` - Scheme names
+ - `show_build_set_proj` / `show_build_set_ws` - Build settings
+
+3. **Build Tools** (create artifacts for install tools):
+ - `build_*` tools - Create app bundles
+ - `get_*_app_path_*` tools - Locate built app bundles
+ - `get_*_bundle_id` tools - Extract bundle IDs
+
+4. **Installation Tools** (depend on built artifacts):
+ - `install_app_*` tools - Install built apps
+ - `launch_app_*` tools - Launch installed apps
+
+5. **Testing Tools** (depend on projects/schemes):
+ - `test_*` tools - Run test suites
+
+6. **UI Automation Tools** (depend on running apps):
+ - `describe_ui`, `screenshot`, `tap`, etc.
+
+**MANDATORY: Record Key Outputs**
+
+Must capture and document these values for dependent tools:
+- **Device UUIDs** from `list_devices`
+- **Simulator UUIDs** from `list_sims`
+- **Project/workspace paths** from `discover_projs`
+- **Scheme names** from `list_schems_*`
+- **App bundle paths** from `get_*_app_path_*`
+- **Bundle IDs** from `get_*_bundle_id`
+
+## Prerequisites
+
+1. **Build the server**: `npm run build`
+2. **Install jq**: `brew install jq` (required for JSON parsing)
+3. **System Requirements**: macOS with Xcode installed, connected devices/simulators optional
+
+## Step-by-Step Testing Process
+
+**Note**: All tool and resource discovery now uses the official `tool-summary.js` script (available as `npm run tools`, `npm run tools:list`, and `npm run tools:all`) instead of direct reloaderoo calls. This ensures accurate counts and lists without hardcoded values.
+
+### Step 1: Programmatic Discovery and Official Testing Lists
+
+#### Generate Official Tool and Resource Lists using tool-summary.js
+
+```bash
+# Use the official tool summary script to get accurate counts and lists
+npm run tools > /tmp/summary_output.txt
+
+# Extract tool and resource counts from summary
+TOOL_COUNT=$(grep "Tools:" /tmp/summary_output.txt | awk '{print $2}')
+RESOURCE_COUNT=$(grep "Resources:" /tmp/summary_output.txt | awk '{print $2}')
+echo "Official tool count: $TOOL_COUNT"
+echo "Official resource count: $RESOURCE_COUNT"
+
+# Generate detailed tool list for testing checklist
+npm run tools:list > /tmp/tools_detailed.txt
+
+# Extract tool names from the detailed output
+grep "^ • " /tmp/tools_detailed.txt | sed 's/^ • //' > /tmp/tool_names.txt
+echo "Tool names saved to /tmp/tool_names.txt"
+
+# Generate detailed resource list for testing checklist
+npm run tools:all > /tmp/tools_and_resources.txt
+
+# Extract resource URIs from the detailed output
+sed -n '/📚 Available Resources:/,/✅ Tool summary complete!/p' /tmp/tools_and_resources.txt | grep "^ • " | sed 's/^ • //' | cut -d' ' -f1 > /tmp/resource_uris.txt
+echo "Resource URIs saved to /tmp/resource_uris.txt"
+```
+
+#### Create Tool Testing Checklist
+
+```bash
+# Generate markdown checklist from actual tool list
+echo "# Official Tool Testing Checklist" > /tmp/tool_testing_checklist.md
+echo "" >> /tmp/tool_testing_checklist.md
+echo "Total Tools: $TOOL_COUNT" >> /tmp/tool_testing_checklist.md
+echo "" >> /tmp/tool_testing_checklist.md
+
+# Add each tool as unchecked item
+while IFS= read -r tool_name; do
+ echo "- [ ] $tool_name" >> /tmp/tool_testing_checklist.md
+done < /tmp/tool_names.txt
+
+echo "Tool testing checklist created at /tmp/tool_testing_checklist.md"
+```
+
+#### Create Resource Testing Checklist
+
+```bash
+# Generate markdown checklist from actual resource list
+echo "# Official Resource Testing Checklist" > /tmp/resource_testing_checklist.md
+echo "" >> /tmp/resource_testing_checklist.md
+echo "Total Resources: $RESOURCE_COUNT" >> /tmp/resource_testing_checklist.md
+echo "" >> /tmp/resource_testing_checklist.md
+
+# Add each resource as unchecked item
+while IFS= read -r resource_uri; do
+ echo "- [ ] $resource_uri" >> /tmp/resource_testing_checklist.md
+done < /tmp/resource_uris.txt
+
+echo "Resource testing checklist created at /tmp/resource_testing_checklist.md"
+```
+
+### Step 2: Tool Schema Discovery for Parameter Testing
+
+#### Extract Tool Schema Information
+
+```bash
+# Get schema for specific tool to understand required parameters
+TOOL_NAME="list_devices"
+jq --arg tool "$TOOL_NAME" '.tools[] | select(.name == $tool) | .inputSchema' /tmp/tools.json
+
+# Get tool description for usage guidance
+jq --arg tool "$TOOL_NAME" '.tools[] | select(.name == $tool) | .description' /tmp/tools.json
+
+# Generate parameter template for tool testing
+jq --arg tool "$TOOL_NAME" '.tools[] | select(.name == $tool) | .inputSchema.properties // {}' /tmp/tools.json
+```
+
+#### Batch Schema Extraction
+
+```bash
+# Create schema reference file for all tools
+echo "# Tool Schema Reference" > /tmp/tool_schemas.md
+echo "" >> /tmp/tool_schemas.md
+
+while IFS= read -r tool_name; do
+ echo "## $tool_name" >> /tmp/tool_schemas.md
+ echo "" >> /tmp/tool_schemas.md
+
+ # Get description
+ description=$(jq -r --arg tool "$tool_name" '.tools[] | select(.name == $tool) | .description' /tmp/tools.json)
+ echo "**Description:** $description" >> /tmp/tool_schemas.md
+ echo "" >> /tmp/tool_schemas.md
+
+ # Get required parameters
+ required=$(jq -r --arg tool "$tool_name" '.tools[] | select(.name == $tool) | .inputSchema.required // [] | join(", ")' /tmp/tools.json)
+ if [ "$required" != "" ]; then
+ echo "**Required Parameters:** $required" >> /tmp/tool_schemas.md
+ else
+ echo "**Required Parameters:** None" >> /tmp/tool_schemas.md
+ fi
+ echo "" >> /tmp/tool_schemas.md
+
+ # Get all parameters
+ echo "**All Parameters:**" >> /tmp/tool_schemas.md
+ jq --arg tool "$tool_name" '.tools[] | select(.name == $tool) | .inputSchema.properties // {} | keys[]' /tmp/tools.json | while read param; do
+ echo "- $param" >> /tmp/tool_schemas.md
+ done
+ echo "" >> /tmp/tool_schemas.md
+
+done < /tmp/tool_names.txt
+
+echo "Tool schema reference created at /tmp/tool_schemas.md"
+```
+
+### Step 3: Manual Tool-by-Tool Testing
+
+#### 🚨 CRITICAL: STEP-BY-STEP BLACK BOX TESTING PROCESS
+
+**ABSOLUTE RULE: ALL TESTING MUST BE DONE MANUALLY, ONE TOOL AT A TIME USING RELOADEROO INSPECT**
+
+**SYSTEMATIC TESTING PROCESS:**
+
+1. **Create TodoWrite Task List**
+ - Add all tools (from `npm run tools` count) to task list before starting
+ - Mark each tool as "pending" initially
+ - Update status to "in_progress" when testing begins
+ - Mark "completed" only after manual verification
+
+2. **Test Each Tool Individually**
+ - Execute ONLY via `npx reloaderoo@latest inspect call-tool "TOOL_NAME" --params 'JSON' -- node build/index.js`
+ - Wait for complete response before proceeding to next tool
+ - Read and verify each tool's output manually
+ - Record key outputs (UUIDs, paths, schemes) for dependent tools
+
+3. **Manual Verification Requirements**
+ - ✅ **Read each response** - Manually verify tool output makes sense
+ - ✅ **Check for errors** - Identify any tool failures or unexpected responses
+ - ✅ **Record UUIDs/paths** - Save outputs needed for dependent tools
+ - ✅ **Update task list** - Mark each tool complete after verification
+ - ✅ **Document issues** - Record any problems found during testing
+
+4. **FORBIDDEN SHORTCUTS:**
+ - ❌ **NO SCRIPTS** - Scripts hide what's happening and prevent proper verification
+ - ❌ **NO AUTOMATION** - Every tool call must be manually executed and verified
+ - ❌ **NO BATCHING** - Cannot test multiple tools simultaneously
+ - ❌ **NO MCP DIRECT CALLS** - Only Reloaderoo inspect commands allowed
+
+#### Phase 1: Infrastructure Validation
+
+**Manual Commands (execute individually):**
+
+```bash
+# Test server connectivity
+npx reloaderoo@latest inspect ping -- node build/index.js
+
+# Get server information
+npx reloaderoo@latest inspect server-info -- node build/index.js
+
+# Verify tool count manually
+npx reloaderoo@latest inspect list-tools -- node build/index.js 2>/dev/null | jq '.tools | length'
+
+# Verify resource count manually
+npx reloaderoo@latest inspect list-resources -- node build/index.js 2>/dev/null | jq '.resources | length'
+```
+
+#### Phase 2: Resource Testing
+
+```bash
+# Test each resource systematically
+while IFS= read -r resource_uri; do
+ echo "Testing resource: $resource_uri"
+ npx reloaderoo@latest inspect read-resource "$resource_uri" -- node build/index.js 2>/dev/null
+ echo "---"
+done < /tmp/resource_uris.txt
+```
+
+#### Phase 3: Foundation Tools (Data Collection)
+
+**CRITICAL: Capture ALL key outputs for dependent tools**
+
+```bash
+echo "=== FOUNDATION TOOL TESTING & DATA COLLECTION ==="
+
+# 1. Test diagnostic (no dependencies)
+echo "Testing diagnostic..."
+npx reloaderoo@latest inspect call-tool "diagnostic" --params '{}' -- node build/index.js 2>/dev/null
+
+# 2. Collect device data
+echo "Collecting device UUIDs..."
+npx reloaderoo@latest inspect call-tool "list_devices" --params '{}' -- node build/index.js 2>/dev/null > /tmp/devices_output.json
+DEVICE_UUIDS=$(jq -r '.content[0].text' /tmp/devices_output.json | grep -E "UDID: [A-F0-9-]+" | sed 's/.*UDID: //' | head -2)
+echo "Device UUIDs captured: $DEVICE_UUIDS"
+
+# 3. Collect simulator data
+echo "Collecting simulator UUIDs..."
+npx reloaderoo@latest inspect call-tool "list_sims" --params '{}' -- node build/index.js 2>/dev/null > /tmp/sims_output.json
+SIMULATOR_UUIDS=$(jq -r '.content[0].text' /tmp/sims_output.json | grep -E "\([A-F0-9-]+\)" | sed 's/.*(\([A-F0-9-]*\)).*/\1/' | head -3)
+echo "Simulator UUIDs captured: $SIMULATOR_UUIDS"
+
+# 4. Collect project data
+echo "Collecting project paths..."
+npx reloaderoo@latest inspect call-tool "discover_projs" --params '{"workspaceRoot": "/Volumes/Developer/XcodeBuildMCP"}' -- node build/index.js 2>/dev/null > /tmp/projects_output.json
+PROJECT_PATHS=$(jq -r '.content[1].text' /tmp/projects_output.json | grep -E "\.xcodeproj$" | sed 's/.*- //' | head -3)
+WORKSPACE_PATHS=$(jq -r '.content[2].text' /tmp/projects_output.json | grep -E "\.xcworkspace$" | sed 's/.*- //' | head -2)
+echo "Project paths captured: $PROJECT_PATHS"
+echo "Workspace paths captured: $WORKSPACE_PATHS"
+
+# Save key data for dependent tools
+echo "$DEVICE_UUIDS" > /tmp/device_uuids.txt
+echo "$SIMULATOR_UUIDS" > /tmp/simulator_uuids.txt
+echo "$PROJECT_PATHS" > /tmp/project_paths.txt
+echo "$WORKSPACE_PATHS" > /tmp/workspace_paths.txt
+```
+
+#### Phase 4: Discovery Tools (Metadata Collection)
+
+```bash
+echo "=== DISCOVERY TOOL TESTING & METADATA COLLECTION ==="
+
+# Collect schemes for each project
+while IFS= read -r project_path; do
+ if [ -n "$project_path" ]; then
+ echo "Getting schemes for: $project_path"
+ npx reloaderoo@latest inspect call-tool "list_schems_proj" --params "{\"projectPath\": \"$project_path\"}" -- node build/index.js 2>/dev/null > /tmp/schemes_$$.json
+ SCHEMES=$(jq -r '.content[1].text' /tmp/schemes_$$.json 2>/dev/null || echo "NoScheme")
+ echo "$project_path|$SCHEMES" >> /tmp/project_schemes.txt
+ echo "Schemes captured for $project_path: $SCHEMES"
+ fi
+done < /tmp/project_paths.txt
+
+# Collect schemes for each workspace
+while IFS= read -r workspace_path; do
+ if [ -n "$workspace_path" ]; then
+ echo "Getting schemes for: $workspace_path"
+ npx reloaderoo@latest inspect call-tool "list_schems_ws" --params "{\"workspacePath\": \"$workspace_path\"}" -- node build/index.js 2>/dev/null > /tmp/ws_schemes_$$.json
+ SCHEMES=$(jq -r '.content[1].text' /tmp/ws_schemes_$$.json 2>/dev/null || echo "NoScheme")
+ echo "$workspace_path|$SCHEMES" >> /tmp/workspace_schemes.txt
+ echo "Schemes captured for $workspace_path: $SCHEMES"
+ fi
+done < /tmp/workspace_paths.txt
+```
+
+#### Phase 5: Manual Individual Tool Testing (All Tools)
+
+**CRITICAL: Test every single tool manually, one at a time**
+
+**Manual Testing Process:**
+
+1. **Create task list** with TodoWrite tool for all tools (using count from `npm run tools`)
+2. **Test each tool individually** with proper parameters
+3. **Mark each tool complete** in task list after manual verification
+4. **Record results** and observations for each tool
+5. **NO SCRIPTS** - Each command executed manually
+
+**STEP-BY-STEP MANUAL TESTING COMMANDS:**
+
+```bash
+# STEP 1: Test foundation tools (no parameters required)
+# Execute each command individually, wait for response, verify manually
+npx reloaderoo@latest inspect call-tool "diagnostic" --params '{}' -- node build/index.js
+# [Wait for response, read output, mark tool complete in task list]
+
+npx reloaderoo@latest inspect call-tool "list_devices" --params '{}' -- node build/index.js
+# [Record device UUIDs from response for dependent tools]
+
+npx reloaderoo@latest inspect call-tool "list_sims" --params '{}' -- node build/index.js
+# [Record simulator UUIDs from response for dependent tools]
+
+# STEP 2: Test project discovery (use discovered project paths)
+npx reloaderoo@latest inspect call-tool "list_schems_proj" --params '{"projectPath": "/actual/path/from/discover_projs.xcodeproj"}' -- node build/index.js
+# [Record scheme names from response for build tools]
+
+# STEP 3: Test workspace tools (use discovered workspace paths)
+npx reloaderoo@latest inspect call-tool "list_schems_ws" --params '{"workspacePath": "/actual/path/from/discover_projs.xcworkspace"}' -- node build/index.js
+# [Record scheme names from response for build tools]
+
+# STEP 4: Test simulator tools (use captured simulator UUIDs from step 1)
+npx reloaderoo@latest inspect call-tool "boot_sim" --params '{"simulatorUuid": "ACTUAL_UUID_FROM_LIST_SIMS"}' -- node build/index.js
+# [Verify simulator boots successfully]
+
+# STEP 5: Test build tools (requires project + scheme + simulator from previous steps)
+npx reloaderoo@latest inspect call-tool "build_sim_id_proj" --params '{"projectPath": "/actual/project.xcodeproj", "scheme": "ActualSchemeName", "simulatorId": "ACTUAL_SIMULATOR_UUID"}' -- node build/index.js
+# [Verify build succeeds and record app bundle path]
+```
+
+**CRITICAL: EACH COMMAND MUST BE:**
+1. **Executed individually** - One command at a time, manually typed or pasted
+2. **Verified manually** - Read the complete response before continuing
+3. **Tracked in task list** - Mark tool complete only after verification
+4. **Use real data** - Replace placeholder values with actual captured data
+5. **Wait for completion** - Allow each command to finish before proceeding
+
+### TESTING VIOLATIONS AND ENFORCEMENT
+
+**🚨 CRITICAL VIOLATIONS THAT WILL TERMINATE TESTING:**
+
+1. **Direct MCP Tool Usage Violation:**
+ ```typescript
+ // ❌ IMMEDIATE TERMINATION - Using MCP tools directly
+ await mcp__XcodeBuildMCP__list_devices();
+ const result = await list_sims();
+ ```
+
+2. **Script-Based Testing Violation:**
+ ```bash
+ # ❌ IMMEDIATE TERMINATION - Using scripts to test tools
+ for tool in $(cat tool_list.txt); do
+ npx reloaderoo inspect call-tool "$tool" --params '{}' -- node build/index.js
+ done
+ ```
+
+3. **Batching/Automation Violation:**
+ ```bash
+ # ❌ IMMEDIATE TERMINATION - Testing multiple tools simultaneously
+ npx reloaderoo inspect call-tool "list_devices" & npx reloaderoo inspect call-tool "list_sims" &
+ ```
+
+4. **Source Code Examination Violation:**
+ ```typescript
+ // ❌ IMMEDIATE TERMINATION - Reading implementation during testing
+ const toolImplementation = await Read('/src/mcp/tools/device-shared/list_devices.ts');
+ ```
+
+**ENFORCEMENT PROCEDURE:**
+1. **First Violation**: Immediate correction and restart of testing process
+2. **Documentation Update**: Add explicit prohibition to prevent future violations
+3. **Method Validation**: Ensure all future testing uses only Reloaderoo inspect commands
+4. **Progress Reset**: Restart testing from foundation tools if direct MCP usage detected
+
+**VALID TESTING SEQUENCE EXAMPLE:**
+```bash
+# ✅ CORRECT - Step-by-step manual execution via Reloaderoo
+# Tool 1: Test diagnostic
+npx reloaderoo@latest inspect call-tool "diagnostic" --params '{}' -- node build/index.js
+# [Read response, verify, mark complete in TodoWrite]
+
+# Tool 2: Test list_devices
+npx reloaderoo@latest inspect call-tool "list_devices" --params '{}' -- node build/index.js
+# [Read response, capture UUIDs, mark complete in TodoWrite]
+
+# Tool 3: Test list_sims
+npx reloaderoo@latest inspect call-tool "list_sims" --params '{}' -- node build/index.js
+# [Read response, capture UUIDs, mark complete in TodoWrite]
+
+# Tool X: Test stateful tool (expected to fail)
+npx reloaderoo@latest inspect call-tool "swift_package_stop" --params '{"pid": 12345}' -- node build/index.js
+# [Tool fails as expected - no in-memory state available]
+# [Mark as "false negative - stateful tool limitation" in TodoWrite]
+# [Continue to next tool without investigation]
+
+# Continue individually for all tools (use count from npm run tools)...
+```
+
+**HANDLING STATEFUL TOOL FAILURES:**
+```bash
+# ✅ CORRECT Response to Expected Stateful Tool Failure
+# Tool fails with "No process found" or similar state-related error
+# Response: Mark tool as "tested - false negative (stateful)" in task list
+# Do NOT attempt to diagnose, fix, or investigate the failure
+# Continue immediately to next tool in sequence
+```
+
+## Error Testing
+
+```bash
+# Test error handling systematically
+echo "=== Error Testing ==="
+
+# Test with invalid JSON parameters
+echo "Testing invalid parameter types..."
+npx reloaderoo@latest inspect call-tool list_schems_proj --params '{"projectPath": 123}' -- node build/index.js 2>/dev/null
+
+# Test with non-existent paths
+echo "Testing non-existent paths..."
+npx reloaderoo@latest inspect call-tool list_schems_proj --params '{"projectPath": "/nonexistent/path.xcodeproj"}' -- node build/index.js 2>/dev/null
+
+# Test with invalid UUIDs
+echo "Testing invalid UUIDs..."
+npx reloaderoo@latest inspect call-tool boot_sim --params '{"simulatorUuid": "invalid-uuid"}' -- node build/index.js 2>/dev/null
+```
+
+## Testing Report Generation
+
+```bash
+# Create comprehensive testing session report
+cat > TESTING_SESSION_$(date +%Y-%m-%d).md << EOF
+# Manual Testing Session - $(date +%Y-%m-%d)
+
+## Environment
+- macOS Version: $(sw_vers -productVersion)
+- XcodeBuildMCP Version: $(jq -r '.version' package.json 2>/dev/null || echo "unknown")
+- Testing Method: Reloaderoo @latest via npx
+
+## Official Counts (Programmatically Verified)
+- Total Tools: $TOOL_COUNT
+- Total Resources: $RESOURCE_COUNT
+
+## Test Results
+[Document test results here]
+
+## Issues Found
+[Document any discrepancies or failures]
+
+## Performance Notes
+[Document response times and performance observations]
+EOF
+
+echo "Testing session template created: TESTING_SESSION_$(date +%Y-%m-%d).md"
+```
+
+### Key Commands Reference
+
+```bash
+# Essential testing commands
+npx reloaderoo@latest inspect ping -- node build/index.js
+npx reloaderoo@latest inspect server-info -- node build/index.js
+npx reloaderoo@latest inspect list-tools -- node build/index.js | jq '.tools | length'
+npx reloaderoo@latest inspect list-resources -- node build/index.js | jq '.resources | length'
+npx reloaderoo@latest inspect call-tool TOOL_NAME --params '{}' -- node build/index.js
+npx reloaderoo@latest inspect read-resource "xcodebuildmcp://RESOURCE" -- node build/index.js
+
+# Schema extraction
+jq --arg tool "TOOL_NAME" '.tools[] | select(.name == $tool) | .inputSchema' /tmp/tools.json
+jq --arg tool "TOOL_NAME" '.tools[] | select(.name == $tool) | .description' /tmp/tools.json
+```
+
+## Troubleshooting
+
+### Common Issues
+
+#### 1. Reloaderoo Command Timeouts
+**Symptoms**: Commands hang or timeout after extended periods
+**Cause**: Server startup issues or MCP protocol communication problems
+**Resolution**:
+- Verify server builds successfully: `npm run build`
+- Test direct server startup: `node build/index.js`
+- Check for TypeScript compilation errors
+
+#### 2. Tool Parameter Validation Errors
+**Symptoms**: Tools return parameter validation errors
+**Cause**: Missing or incorrect required parameters
+**Resolution**:
+- Check tool schema: `jq --arg tool "TOOL_NAME" '.tools[] | select(.name == $tool) | .inputSchema' /tmp/tools.json`
+- Verify parameter types and required fields
+- Use captured dependency data (UUIDs, paths, schemes)
+
+#### 3. "No Such Tool" Errors
+**Symptoms**: Reloaderoo reports tool not found
+**Cause**: Tool name mismatch or server registration issues
+**Resolution**:
+- Verify tool exists in list: `npx reloaderoo@latest inspect list-tools -- node build/index.js | jq '.tools[].name'`
+- Check exact tool name spelling and case sensitivity
+- Ensure server built successfully
+
+#### 4. Empty or Malformed Responses
+**Symptoms**: Tools return empty responses or JSON parsing errors
+**Cause**: Tool implementation issues or server errors
+**Resolution**:
+- Document as testing finding - do not investigate implementation
+- Mark tool as "failed - empty response" in task list
+- Continue with next tool in sequence
+
+This systematic approach ensures comprehensive, accurate testing using programmatic discovery and validation of all XcodeBuildMCP functionality through the MCP interface exclusively.
\ No newline at end of file
diff --git a/docs/RELEASE_PROCESS.md b/docs/RELEASE_PROCESS.md
index f68c6eb9..9751ee83 100644
--- a/docs/RELEASE_PROCESS.md
+++ b/docs/RELEASE_PROCESS.md
@@ -18,12 +18,30 @@ git checkout -b bugfix/issue-456-fix-simulator-crash
### 2. Development & Commits
+**Before committing, ALWAYS run quality checks:**
+```bash
+npm run build # Ensure code compiles
+npm run typecheck # MANDATORY: Fix all TypeScript errors
+npm run lint # Fix linting issues
+npm run test # Ensure tests pass
+```
+
+**🚨 CRITICAL: TypeScript errors are BLOCKING:**
+- **ZERO tolerance** for TypeScript errors in commits
+- The `npm run typecheck` command must pass with no errors
+- Fix all `ts(XXXX)` errors before committing
+- Do not ignore or suppress TypeScript errors without explicit approval
+
**Make logical, atomic commits:**
-- Each commit should represent a single logical change
+- Each commit should represent a single logical change
- Write short, descriptive commit summaries
- Commit frequently to your feature branch
```bash
+# Always run quality checks first
+npm run typecheck && npm run lint && npm run test
+
+# Then commit your changes
git add .
git commit -m "feat: add simulator boot validation logic"
git commit -m "fix: handle null response in device list parser"
@@ -128,9 +146,12 @@ Every PR must include these sections in order:
- **NEVER push to `main` directly**
- **NEVER push without explicit user permission**
- **NEVER force push without explicit permission**
+- **NEVER commit code with TypeScript errors**
### ✅ Required Practices
- Always pull from `main` before creating branches
+- **MANDATORY: Run `npm run typecheck` before every commit**
+- **MANDATORY: Fix all TypeScript errors before committing**
- Use `gh` CLI tool for all PR operations
- Add "Cursor review" comment after PR creation
- Maintain linear commit history via rebasing
@@ -143,4 +164,50 @@ Every PR must include these sections in order:
- `bugfix/issue-xxx-description` - Bug fixes
- `hotfix/critical-issue-description` - Critical production fixes
- `docs/update-readme` - Documentation updates
-- `refactor/improve-error-handling` - Code refactoring
\ No newline at end of file
+- `refactor/improve-error-handling` - Code refactoring
+
+## Automated Quality Gates
+
+### CI/CD Pipeline
+Our GitHub Actions CI pipeline automatically enforces these quality checks:
+1. `npm run build` - Compilation check
+2. `npm run lint` - ESLint validation
+3. `npm run format:check` - Prettier formatting check
+4. `npm run typecheck` - **TypeScript error validation**
+5. `npm run test` - Test suite execution
+
+**All checks must pass before PR merge is allowed.**
+
+### Optional: Pre-commit Hook Setup
+To catch TypeScript errors before committing locally:
+
+```bash
+# Create pre-commit hook
+cat > .git/hooks/pre-commit << 'EOF'
+#!/bin/sh
+echo "🔍 Running pre-commit checks..."
+
+# Run TypeScript type checking
+echo "📝 Checking TypeScript..."
+npm run typecheck
+if [ $? -ne 0 ]; then
+ echo "❌ TypeScript errors found. Please fix before committing."
+ exit 1
+fi
+
+# Run linting
+echo "🧹 Running linter..."
+npm run lint
+if [ $? -ne 0 ]; then
+ echo "❌ Linting errors found. Please fix before committing."
+ exit 1
+fi
+
+echo "✅ Pre-commit checks passed!"
+EOF
+
+# Make it executable
+chmod +x .git/hooks/pre-commit
+```
+
+This hook will automatically run `typecheck` and `lint` before every commit, preventing TypeScript errors from being committed.
\ No newline at end of file
diff --git a/docs/RELOADEROO.md b/docs/RELOADEROO.md
index 4508d4ca..f327116d 100644
--- a/docs/RELOADEROO.md
+++ b/docs/RELOADEROO.md
@@ -1,6 +1,6 @@
# Reloaderoo Integration Guide
-This guide explains how to use Reloaderoo for testing and developing XcodeBuildMCP with both CLI inspection tools and transparent proxy capabilities.
+This guide explains how to use Reloaderoo v1.1.2+ for testing and developing XcodeBuildMCP with both CLI inspection tools and transparent proxy capabilities.
## Overview
@@ -12,7 +12,7 @@ Reloaderoo is available via npm and can be used with npx for universal compatibi
```bash
# Use npx to run reloaderoo (works on any system)
-npx reloaderoo --help
+npx reloaderoo@latest --help
# Or install globally if preferred
npm install -g reloaderoo
@@ -36,44 +36,44 @@ Direct command-line access to MCP servers without client setup - perfect for tes
```bash
# List all available tools
-npx reloaderoo inspect list-tools -- node build/index.js
+npx reloaderoo@latest inspect list-tools -- node build/index.js
# Call any tool with parameters
-npx reloaderoo inspect call-tool --params '' -- node build/index.js
+npx reloaderoo@latest inspect call-tool --params '' -- node build/index.js
# Get server information
-npx reloaderoo inspect server-info -- node build/index.js
+npx reloaderoo@latest inspect server-info -- node build/index.js
# List available resources
-npx reloaderoo inspect list-resources -- node build/index.js
+npx reloaderoo@latest inspect list-resources -- node build/index.js
# Read a specific resource
-npx reloaderoo inspect read-resource "" -- node build/index.js
+npx reloaderoo@latest inspect read-resource "" -- node build/index.js
# List available prompts
-npx reloaderoo inspect list-prompts -- node build/index.js
+npx reloaderoo@latest inspect list-prompts -- node build/index.js
# Get a specific prompt
-npx reloaderoo inspect get-prompt --args '' -- node build/index.js
+npx reloaderoo@latest inspect get-prompt --args '' -- node build/index.js
# Check server connectivity
-npx reloaderoo inspect ping -- node build/index.js
+npx reloaderoo@latest inspect ping -- node build/index.js
```
**Example Tool Calls:**
```bash
# List connected devices
-npx reloaderoo inspect call-tool list_devices --params '{}' -- node build/index.js
+npx reloaderoo@latest inspect call-tool list_devices --params '{}' -- node build/index.js
# Get diagnostic information
-npx reloaderoo inspect call-tool diagnostic --params '{}' -- node build/index.js
+npx reloaderoo@latest inspect call-tool diagnostic --params '{}' -- node build/index.js
# List iOS simulators
-npx reloaderoo inspect call-tool list_sims --params '{}' -- node build/index.js
+npx reloaderoo@latest inspect call-tool list_sims --params '{}' -- node build/index.js
# Read devices resource
-npx reloaderoo inspect read-resource "xcodebuildmcp://devices" -- node build/index.js
+npx reloaderoo@latest inspect read-resource "xcodebuildmcp://devices" -- node build/index.js
```
### 🔄 **Proxy Mode** (Hot-Reload Development)
@@ -91,10 +91,10 @@ Transparent MCP proxy server that enables seamless hot-reloading during developm
```bash
# Start proxy mode (your AI client connects to this)
-npx reloaderoo proxy -- node build/index.js
+npx reloaderoo@latest proxy -- node build/index.js
# With debug logging
-npx reloaderoo proxy --log-level debug -- node build/index.js
+npx reloaderoo@latest proxy --log-level debug -- node build/index.js
# Then in your AI session, request:
# "Please restart the MCP server to load my latest changes"
@@ -108,7 +108,7 @@ Start CLI mode as a persistent MCP server for interactive debugging through MCP
```bash
# Start reloaderoo in CLI mode as an MCP server
-npx reloaderoo inspect mcp -- node build/index.js
+npx reloaderoo@latest inspect mcp -- node build/index.js
```
This runs CLI mode as a persistent MCP server, exposing 8 debug tools through the MCP protocol:
@@ -137,23 +137,27 @@ When running under Claude Code, XcodeBuildMCP automatically detects the environm
### Command Structure
```bash
-npx reloaderoo [options] [command]
+npx reloaderoo@latest [options] [command]
+
+Two modes, one tool:
+• Proxy MCP server that adds support for hot-reloading MCP servers.
+• CLI tool for inspecting MCP servers.
Global Options:
- -V, --version Output the version number
- -h, --help Display help for command
+ -V, --version Output the version number
+ -h, --help Display help for command
Commands:
- proxy [options] -- 🔄 Run as MCP proxy server (hot-reload mode)
- inspect [subcommand] 🔍 Inspect and debug MCP servers (CLI mode)
- info [options] 📊 Display version and configuration information
- help [command] ❓ Display help for command
+ proxy [options] 🔄 Run as MCP proxy server (default behavior)
+ inspect 🔍 Inspect and debug MCP servers
+ info [options] 📊 Display version and configuration information
+ help [command] ❓ Display help for command
```
### 🔄 **Proxy Mode Commands**
```bash
-npx reloaderoo proxy [options] -- [child-args...]
+npx reloaderoo@latest proxy [options] -- [child-args...]
Options:
-w, --working-dir Working directory for the child process
@@ -176,7 +180,7 @@ Examples:
### 🔍 **CLI Mode Commands**
```bash
-npx reloaderoo inspect [subcommand] [options] -- [child-args...]
+npx reloaderoo@latest inspect [subcommand] [options] -- [child-args...]
Subcommands:
server-info [options] Get server information and capabilities
@@ -189,22 +193,23 @@ Subcommands:
ping [options] Check server connectivity
Examples:
- npx reloaderoo inspect list-tools -- node build/index.js
- npx reloaderoo inspect call-tool list_devices --params '{}' -- node build/index.js
- npx reloaderoo inspect server-info -- node build/index.js
+ npx reloaderoo@latest inspect list-tools -- node build/index.js
+ npx reloaderoo@latest inspect call-tool list_devices --params '{}' -- node build/index.js
+ npx reloaderoo@latest inspect server-info -- node build/index.js
```
### **Info Command**
```bash
-npx reloaderoo info [options]
+npx reloaderoo@latest info [options]
Options:
- --verbose Show detailed system information
+ -v, --verbose Show detailed information
+ -h, --help Display help for command
Examples:
- npx reloaderoo info # Show basic system information
- npx reloaderoo info --verbose # Show detailed diagnostics
+ npx reloaderoo@latest info # Show basic system information
+ npx reloaderoo@latest info --verbose # Show detailed diagnostics
```
### Response Format
@@ -255,14 +260,14 @@ Perfect for testing individual tools or debugging server issues without MCP clie
npm run build
# 2. Test your server quickly
-npx reloaderoo inspect list-tools -- node build/index.js
+npx reloaderoo@latest inspect list-tools -- node build/index.js
# 3. Call specific tools to verify behavior
-npx reloaderoo inspect call-tool list_devices --params '{}' -- node build/index.js
+npx reloaderoo@latest inspect call-tool list_devices --params '{}' -- node build/index.js
# 4. Check server health and resources
-npx reloaderoo inspect ping -- node build/index.js
-npx reloaderoo inspect list-resources -- node build/index.js
+npx reloaderoo@latest inspect ping -- node build/index.js
+npx reloaderoo@latest inspect list-resources -- node build/index.js
```
### 🔄 **Proxy Mode Workflow** (Hot-Reload Development)
@@ -272,9 +277,9 @@ For full development sessions with AI clients that need persistent connections:
#### 1. **Start Development Session**
Configure your AI client to connect to reloaderoo proxy instead of your server directly:
```bash
-npx reloaderoo proxy -- node build/index.js
+npx reloaderoo@latest proxy -- node build/index.js
# or with debug logging:
-npx reloaderoo proxy --log-level debug -- node build/index.js
+npx reloaderoo@latest proxy --log-level debug -- node build/index.js
```
#### 2. **Develop Your MCP Server**
@@ -300,7 +305,7 @@ For interactive debugging through MCP clients:
```bash
# Start reloaderoo CLI mode as an MCP server
-npx reloaderoo inspect mcp -- node build/index.js
+npx reloaderoo@latest inspect mcp -- node build/index.js
# Then connect with an MCP client to access debug tools
# Available tools: list_tools, call_tool, list_resources, etc.
@@ -316,25 +321,25 @@ npx reloaderoo inspect mcp -- node build/index.js
node build/index.js
# Then try with reloaderoo proxy to validate configuration
-npx reloaderoo proxy -- node build/index.js
+npx reloaderoo@latest proxy -- node build/index.js
```
**Connection problems with MCP clients:**
```bash
# Enable debug logging to see what's happening
-npx reloaderoo proxy --log-level debug -- node build/index.js
+npx reloaderoo@latest proxy --log-level debug -- node build/index.js
# Check system info and configuration
-npx reloaderoo info --verbose
+npx reloaderoo@latest info --verbose
```
**Restart failures in proxy mode:**
```bash
# Increase restart timeout
-npx reloaderoo proxy --restart-timeout 60000 -- node build/index.js
+npx reloaderoo@latest proxy --restart-timeout 60000 -- node build/index.js
# Check restart limits
-npx reloaderoo proxy --max-restarts 5 -- node build/index.js
+npx reloaderoo@latest proxy --max-restarts 5 -- node build/index.js
```
### 🔍 **CLI Mode Issues**
@@ -342,16 +347,16 @@ npx reloaderoo proxy --max-restarts 5 -- node build/index.js
**CLI commands failing:**
```bash
# Test basic connectivity first
-npx reloaderoo inspect ping -- node build/index.js
+npx reloaderoo@latest inspect ping -- node build/index.js
-# Enable debug logging for CLI commands
-npx reloaderoo inspect list-tools --log-level debug -- node build/index.js
+# Enable debug logging for CLI commands (via proxy debug mode)
+npx reloaderoo@latest proxy --log-level debug -- node build/index.js
```
**JSON parsing errors:**
```bash
-# Use --raw flag to see unformatted output (if available)
-npx reloaderoo inspect server-info --raw -- node build/index.js
+# Check server information for diagnostics
+npx reloaderoo@latest inspect server-info -- node build/index.js
# Ensure your server outputs valid JSON
node build/index.js | head -10
@@ -362,7 +367,7 @@ node build/index.js | head -10
**Command not found:**
```bash
# Ensure npx can find reloaderoo
-npx reloaderoo --help
+npx reloaderoo@latest --help
# If that fails, try installing globally
npm install -g reloaderoo
@@ -371,18 +376,18 @@ npm install -g reloaderoo
**Parameter validation:**
```bash
# Ensure JSON parameters are properly quoted
-npx reloaderoo inspect call-tool list_devices --params '{}' -- node build/index.js
+npx reloaderoo@latest inspect call-tool list_devices --params '{}' -- node build/index.js
```
### **General Debug Mode**
```bash
# Get detailed information about what's happening
-npx reloaderoo proxy --debug -- node build/index.js # For proxy mode
-npx reloaderoo inspect list-tools --log-level debug -- node build/index.js # For CLI mode
+npx reloaderoo@latest proxy --debug -- node build/index.js # For proxy mode
+npx reloaderoo@latest proxy --log-level debug -- node build/index.js # For detailed proxy logging
# View system diagnostics
-npx reloaderoo info --verbose
+npx reloaderoo@latest info --verbose
```
### Debug Tips
@@ -390,7 +395,7 @@ npx reloaderoo info --verbose
1. **Always build first**: Run `npm run build` before testing
2. **Check tool names**: Use `inspect list-tools` to see exact tool names
3. **Validate JSON**: Ensure parameters are valid JSON strings
-4. **Enable debug logging**: Use `--log-level debug` for verbose output
+4. **Enable debug logging**: Use `--log-level debug` or `--debug` for verbose output
5. **Test connectivity**: Use `inspect ping` to verify server communication
## Advanced Usage
@@ -416,14 +421,14 @@ export MCPDEV_PROXY_CWD=/path/to/directory # Default working directory
### Custom Working Directory
```bash
-npx reloaderoo proxy --working-dir /custom/path -- node build/index.js
-npx reloaderoo inspect list-tools --working-dir /custom/path -- node build/index.js
+npx reloaderoo@latest proxy --working-dir /custom/path -- node build/index.js
+npx reloaderoo@latest inspect list-tools --working-dir /custom/path -- node build/index.js
```
### Timeout Configuration
```bash
-npx reloaderoo proxy --restart-timeout 60000 -- node build/index.js
+npx reloaderoo@latest proxy --restart-timeout 60000 -- node build/index.js
```
## Integration with XcodeBuildMCP
diff --git a/docs/TESTING.md b/docs/TESTING.md
index 7c394589..8a326867 100644
--- a/docs/TESTING.md
+++ b/docs/TESTING.md
@@ -13,15 +13,16 @@ This document provides comprehensive testing guidelines for XcodeBuildMCP plugin
7. [Performance Requirements](#performance-requirements)
8. [Coverage Standards](#coverage-standards)
9. [Common Patterns](#common-patterns)
-10. [Troubleshooting](#troubleshooting)
+10. [Manual Testing with Reloaderoo](#manual-testing-with-reloaderoo)
+11. [Troubleshooting](#troubleshooting)
## Testing Philosophy
### 🚨 CRITICAL: No Vitest Mocking Allowed
-**ABSOLUTE RULE: ALL VITEST MOCKING IS COMPLETELY BANNED**
+### ABSOLUTE RULE: ALL VITEST MOCKING IS COMPLETELY BANNED
-**FORBIDDEN PATTERNS (will cause immediate test failure):**
+### FORBIDDEN PATTERNS (will cause immediate test failure):
- `vi.mock()` - BANNED
- `vi.fn()` - BANNED
- `vi.mocked()` - BANNED
@@ -35,7 +36,7 @@ This document provides comprehensive testing guidelines for XcodeBuildMCP plugin
- `MockedFunction` type - BANNED
- Any `mock*` variables - BANNED
-**ONLY ALLOWED MOCKING:**
+### ONLY ALLOWED MOCKING:
- `createMockExecutor({ success: true, output: 'result' })` - command execution
- `createMockFileSystemExecutor({ readFile: async () => 'content' })` - file system operations
@@ -62,7 +63,7 @@ To enforce the no-mocking policy, the project includes a script that automatical
```bash
# Run the script to check for violations
-node scripts/check-test-patterns.js
+node scripts/check-code-patterns.js
```
This script is part of the standard development workflow and should be run before committing changes to ensure compliance with the testing standards. It will fail if it detects any use of `vi.mock`, `vi.fn`, or other forbidden patterns in the test files.
@@ -185,7 +186,7 @@ describe('Parameter Validation', () => {
### 2. Command Generation (CLI Testing)
-**CRITICAL: No command spying allowed. Test command generation through response validation.**
+### CRITICAL: No command spying allowed. Test command generation through response validation.
```typescript
describe('Command Generation', () => {
@@ -478,6 +479,699 @@ it('should format validation errors correctly', async () => {
});
```
+## Manual Testing with Reloaderoo
+
+### 🚨 CRITICAL: THOROUGHNESS OVER EFFICIENCY - NO SHORTCUTS ALLOWED
+
+### ABSOLUTE PRINCIPLE: EVERY TOOL MUST BE TESTED INDIVIDUALLY
+
+### 🚨 MANDATORY TESTING SCOPE - NO EXCEPTIONS
+- **EVERY SINGLE TOOL** - All 83+ tools must be tested individually, one by one
+- **NO REPRESENTATIVE SAMPLING** - Testing similar tools does NOT validate other tools
+- **NO PATTERN RECOGNITION SHORTCUTS** - Similar-looking tools may have different behaviors
+- **NO EFFICIENCY OPTIMIZATIONS** - Thoroughness is more important than speed
+- **NO TIME CONSTRAINTS** - This is a long-running task with no deadline pressure
+
+### ❌ FORBIDDEN EFFICIENCY SHORTCUTS
+- **NEVER** assume testing `build_sim_id_proj` validates `build_sim_name_proj`
+- **NEVER** skip tools because they "look similar" to tested ones
+- **NEVER** use representative sampling instead of complete coverage
+- **NEVER** stop testing due to time concerns or perceived redundancy
+- **NEVER** group tools together for batch testing
+- **NEVER** make assumptions about untested tools based on tested patterns
+
+### ✅ REQUIRED COMPREHENSIVE APPROACH
+1. **Individual Tool Testing**: Each tool gets its own dedicated test execution
+2. **Complete Documentation**: Every tool result must be recorded, regardless of outcome
+3. **Systematic Progress**: Use TodoWrite to track every single tool as tested/untested
+4. **Failure Documentation**: Test tools that cannot work and mark them as failed/blocked
+5. **No Assumptions**: Treat each tool as potentially unique requiring individual validation
+
+### TESTING COMPLETENESS VALIDATION
+- **Start Count**: Record exact number of tools discovered (e.g., 83 tools)
+- **End Count**: Verify same number of tools have been individually tested
+- **Missing Tools = Testing Failure**: If any tools remain untested, the testing is incomplete
+- **TodoWrite Tracking**: Every tool must appear in todo list and be marked completed
+
+### 🚨 CRITICAL: Black Box Testing via Reloaderoo Inspect
+
+### DEFINITION: Black Box Testing
+Black Box Testing means testing ONLY through external interfaces without any knowledge of internal implementation. For XcodeBuildMCP, this means testing exclusively through the Model Context Protocol (MCP) interface using Reloaderoo as the MCP client.
+
+### 🚨 MANDATORY: RELOADEROO INSPECT IS THE ONLY ALLOWED TESTING METHOD
+
+### ABSOLUTE TESTING RULES - NO EXCEPTIONS
+
+1. **✅ ONLY ALLOWED: Reloaderoo Inspect Commands**
+ - `npx reloaderoo@latest inspect call-tool "TOOL_NAME" --params 'JSON' -- node build/index.js`
+ - `npx reloaderoo@latest inspect list-tools -- node build/index.js`
+ - `npx reloaderoo@latest inspect read-resource "URI" -- node build/index.js`
+ - `npx reloaderoo@latest inspect server-info -- node build/index.js`
+ - `npx reloaderoo@latest inspect ping -- node build/index.js`
+
+2. **❌ COMPLETELY FORBIDDEN ACTIONS:**
+ - **NEVER** call `mcp__XcodeBuildMCP__tool_name()` functions directly
+ - **NEVER** use MCP server tools as if they were native functions
+ - **NEVER** access internal server functionality
+ - **NEVER** read source code to understand how tools work
+ - **NEVER** examine implementation files during testing
+ - **NEVER** diagnose internal server issues or registration problems
+ - **NEVER** suggest code fixes or implementation changes
+
+3. **🚨 CRITICAL VIOLATION EXAMPLES:**
+ ```typescript
+ // ❌ FORBIDDEN - Direct MCP tool calls
+ await mcp__XcodeBuildMCP__list_devices();
+ await mcp__XcodeBuildMCP__build_sim_id_proj({ ... });
+
+ // ❌ FORBIDDEN - Using tools as native functions
+ const devices = await list_devices();
+ const result = await diagnostic();
+
+ // ✅ CORRECT - Only through Reloaderoo inspect
+ npx reloaderoo@latest inspect call-tool "list_devices" --params '{}' -- node build/index.js
+ npx reloaderoo@latest inspect call-tool "diagnostic" --params '{}' -- node build/index.js
+ ```
+
+### WHY RELOADEROO INSPECT IS MANDATORY
+- **Higher Fidelity**: Provides clear input/output visibility for each tool call
+- **Real-world Simulation**: Tests exactly how MCP clients interact with the server
+- **Interface Validation**: Ensures MCP protocol compliance and proper JSON formatting
+- **Black Box Enforcement**: Prevents accidental access to internal implementation details
+- **Clean State**: Each tool call runs with a fresh MCP server instance, preventing cross-contamination
+
+### IMPORTANT: STATEFUL TOOL LIMITATIONS
+
+#### Reloaderoo Inspect Behavior:
+Reloaderoo starts a fresh MCP server instance for each individual tool call and terminates it immediately after the response. This ensures:
+- ✅ **Clean Testing Environment**: No state contamination between tool calls
+- ✅ **Isolated Testing**: Each tool test is independent and repeatable
+- ✅ **Real-world Accuracy**: Simulates how most MCP clients interact with servers
+
+#### Expected False Negatives:
+Some tools rely on in-memory state within the MCP server and will fail when tested via Reloaderoo inspect. These failures are **expected and acceptable** as false negatives:
+
+- **`swift_package_stop`** - Requires in-memory process tracking from `swift_package_run`
+- **`stop_app_device`** - Requires in-memory process tracking from `launch_app_device`
+- **`stop_app_sim`** - Requires in-memory process tracking from `launch_app_sim`
+- **`stop_device_log_cap`** - Requires in-memory session tracking from `start_device_log_cap`
+- **`stop_sim_log_cap`** - Requires in-memory session tracking from `start_sim_log_cap`
+- **`stop_mac_app`** - Requires in-memory process tracking from `launch_mac_app`
+
+#### Testing Protocol for Stateful Tools:
+1. **Test the tool anyway** - Execute the Reloaderoo inspect command
+2. **Expect failure** - Tool will likely fail due to missing state
+3. **Mark as false negative** - Document the failure as expected due to stateful limitations
+4. **Continue testing** - Do not attempt to fix or investigate the failure
+5. **Report as finding** - Note in testing report that stateful tools failed as expected
+
+### COMPLETE COVERAGE REQUIREMENTS
+- ✅ **Test ALL 83+ tools individually** - No exceptions, every tool gets manual verification
+- ✅ **Follow dependency graphs** - Test tools in correct order based on data dependencies
+- ✅ **Capture key outputs** - Record UUIDs, paths, schemes needed by dependent tools
+- ✅ **Test real workflows** - Complete end-to-end workflows from discovery to execution
+- ✅ **Use programmatic JSON parsing** - Accurate tool/resource counting and discovery
+- ✅ **Document all observations** - Record exactly what you see via testing
+- ✅ **Report discrepancies as findings** - Note unexpected results without investigation
+
+### MANDATORY INDIVIDUAL TOOL TESTING PROTOCOL
+
+#### Step 1: Create Complete Tool Inventory
+```bash
+# Generate complete list of all tools
+npx reloaderoo@latest inspect list-tools -- node build/index.js > /tmp/all_tools.json
+TOTAL_TOOLS=$(jq '.tools | length' /tmp/all_tools.json)
+echo "TOTAL TOOLS TO TEST: $TOTAL_TOOLS"
+
+# Extract all tool names for systematic testing
+jq -r '.tools[].name' /tmp/all_tools.json > /tmp/tool_names.txt
+```
+
+#### Step 2: Create TodoWrite Task List for Every Tool
+```bash
+# Create individual todo items for each of the 83+ tools
+# Example for first few tools:
+# 1. [ ] Test tool: diagnostic
+# 2. [ ] Test tool: list_devices
+# 3. [ ] Test tool: list_sims
+# ... (continue for ALL 83+ tools)
+```
+
+#### Step 3: Test Each Tool Individually
+For EVERY tool in the list:
+```bash
+# Test each tool individually - NO BATCHING
+npx reloaderoo@latest inspect call-tool "TOOL_NAME" --params 'APPROPRIATE_PARAMS' -- node build/index.js
+
+# Mark tool as completed in TodoWrite IMMEDIATELY after testing
+# Record result (success/failure/blocked) for each tool
+```
+
+#### Step 4: Validate Complete Coverage
+```bash
+# Verify all tools tested
+COMPLETED_TOOLS=$(count completed todo items)
+if [ $COMPLETED_TOOLS -ne $TOTAL_TOOLS ]; then
+ echo "ERROR: Testing incomplete. $COMPLETED_TOOLS/$TOTAL_TOOLS tested"
+ exit 1
+fi
+```
+
+### CRITICAL: NO TOOL LEFT UNTESTED
+- **Every tool name from the JSON list must be individually tested**
+- **Every tool must have a TodoWrite entry that gets marked completed**
+- **Tools that fail due to missing parameters should be tested anyway and marked as blocked**
+- **Tools that require setup (like running processes) should be tested and documented as requiring dependencies**
+- **NO ASSUMPTIONS**: Test tools even if they seem redundant or similar to others
+
+### BLACK BOX TESTING ENFORCEMENT
+- ✅ **Test only through Reloaderoo MCP interface** - Simulates real-world MCP client usage
+- ✅ **Use task lists** - Track progress with TodoWrite tool for every single tool
+- ✅ **Tick off each tool** - Mark completed in task list after manual verification
+- ✅ **Manual oversight** - Human verification of each tool's input and output
+- ❌ **Never examine source code** - No reading implementation files during testing
+- ❌ **Never diagnose internal issues** - No investigation of build processes or tool registration
+- ❌ **Never suggest implementation fixes** - Report issues as findings, don't solve them
+- ❌ **Never use scripts for tool testing** - Each tool must be manually executed and verified
+
+### 🚨 TESTING PSYCHOLOGY & BIAS PREVENTION
+
+### COMMON ANTI-PATTERNS TO AVOID
+
+#### 1. Efficiency Bias (FORBIDDEN)
+- **Symptom**: "These tools look similar, I'll test one to validate the others"
+- **Correction**: Every tool is unique and must be tested individually
+- **Enforcement**: Count tools at start, verify same count tested at end
+
+#### 2. Pattern Recognition Override (FORBIDDEN)
+- **Symptom**: "I see the pattern, the rest will work the same way"
+- **Correction**: Patterns may hide edge cases, bugs, or different implementations
+- **Enforcement**: No assumptions allowed, test every tool regardless of apparent similarity
+
+#### 3. Time Pressure Shortcuts (FORBIDDEN)
+- **Symptom**: "This is taking too long, let me speed up by sampling"
+- **Correction**: This is explicitly a long-running task with no time constraints
+- **Enforcement**: Thoroughness is the ONLY priority, efficiency is irrelevant
+
+#### 4. False Confidence (FORBIDDEN)
+- **Symptom**: "The architecture is solid, so all tools must work"
+- **Correction**: Architecture validation does not guarantee individual tool functionality
+- **Enforcement**: Test tools to discover actual issues, not to confirm assumptions
+
+### MANDATORY MINDSET
+- **Every tool is potentially broken** until individually tested
+- **Every tool may have unique edge cases** not covered by similar tools
+- **Every tool deserves individual attention** regardless of apparent redundancy
+- **Testing completion means EVERY tool tested**, not "enough tools to validate patterns"
+- **The goal is discovering problems**, not confirming everything works
+
+### TESTING COMPLETENESS CHECKLIST
+- [ ] Generated complete tool list (83+ tools)
+- [ ] Created TodoWrite entry for every single tool
+- [ ] Tested every tool individually via Reloaderoo inspect
+- [ ] Marked every tool as completed in TodoWrite
+- [ ] Verified tool count: tested_count == total_count
+- [ ] Documented all results, including failures and blocked tools
+- [ ] Created final report covering ALL tools, not just successful ones
+
+### Tool Dependency Graph Testing Strategy
+
+**CRITICAL: Tools must be tested in dependency order:**
+
+1. **Foundation Tools** (provide data for other tools):
+ - `diagnostic` - System info
+ - `list_devices` - Device UUIDs
+ - `list_sims` - Simulator UUIDs
+ - `discover_projs` - Project/workspace paths
+
+2. **Discovery Tools** (provide metadata for build tools):
+ - `list_schems_proj` / `list_schems_ws` - Scheme names
+ - `show_build_set_proj` / `show_build_set_ws` - Build settings
+
+3. **Build Tools** (create artifacts for install tools):
+ - `build_*` tools - Create app bundles
+ - `get_*_app_path_*` tools - Locate built app bundles
+ - `get_*_bundle_id` tools - Extract bundle IDs
+
+4. **Installation Tools** (depend on built artifacts):
+ - `install_app_*` tools - Install built apps
+ - `launch_app_*` tools - Launch installed apps
+
+5. **Testing Tools** (depend on projects/schemes):
+ - `test_*` tools - Run test suites
+
+6. **UI Automation Tools** (depend on running apps):
+ - `describe_ui`, `screenshot`, `tap`, etc.
+
+### MANDATORY: Record Key Outputs
+
+Must capture and document these values for dependent tools:
+- **Device UUIDs** from `list_devices`
+- **Simulator UUIDs** from `list_sims`
+- **Project/workspace paths** from `discover_projs`
+- **Scheme names** from `list_schems_*`
+- **App bundle paths** from `get_*_app_path_*`
+- **Bundle IDs** from `get_*_bundle_id`
+
+### Prerequisites
+
+1. **Build the server**: `npm run build`
+2. **Install jq**: `brew install jq` (required for JSON parsing)
+3. **System Requirements**: macOS with Xcode installed, connected devices/simulators optional
+
+### Step 1: Programmatic Discovery and Official Testing Lists
+
+#### Generate Official Tool List
+
+```bash
+# Generate complete tool list with accurate count
+npx reloaderoo@latest inspect list-tools -- node build/index.js 2>/dev/null > /tmp/tools.json
+
+# Get accurate tool count
+TOOL_COUNT=$(jq '.tools | length' /tmp/tools.json)
+echo "Official tool count: $TOOL_COUNT"
+
+# Generate tool names list for testing checklist
+jq -r '.tools[] | .name' /tmp/tools.json > /tmp/tool_names.txt
+echo "Tool names saved to /tmp/tool_names.txt"
+```
+
+#### Generate Official Resource List
+
+```bash
+# Generate complete resource list
+npx reloaderoo@latest inspect list-resources -- node build/index.js 2>/dev/null > /tmp/resources.json
+
+# Get accurate resource count
+RESOURCE_COUNT=$(jq '.resources | length' /tmp/resources.json)
+echo "Official resource count: $RESOURCE_COUNT"
+
+# Generate resource URIs for testing checklist
+jq -r '.resources[] | .uri' /tmp/resources.json > /tmp/resource_uris.txt
+echo "Resource URIs saved to /tmp/resource_uris.txt"
+```
+
+#### Create Tool Testing Checklist
+
+```bash
+# Generate markdown checklist from actual tool list
+echo "# Official Tool Testing Checklist" > /tmp/tool_testing_checklist.md
+echo "" >> /tmp/tool_testing_checklist.md
+echo "Total Tools: $TOOL_COUNT" >> /tmp/tool_testing_checklist.md
+echo "" >> /tmp/tool_testing_checklist.md
+
+# Add each tool as unchecked item
+while IFS= read -r tool_name; do
+ echo "- [ ] $tool_name" >> /tmp/tool_testing_checklist.md
+done < /tmp/tool_names.txt
+
+echo "Tool testing checklist created at /tmp/tool_testing_checklist.md"
+```
+
+#### Create Resource Testing Checklist
+
+```bash
+# Generate markdown checklist from actual resource list
+echo "# Official Resource Testing Checklist" > /tmp/resource_testing_checklist.md
+echo "" >> /tmp/resource_testing_checklist.md
+echo "Total Resources: $RESOURCE_COUNT" >> /tmp/resource_testing_checklist.md
+echo "" >> /tmp/resource_testing_checklist.md
+
+# Add each resource as unchecked item
+while IFS= read -r resource_uri; do
+ echo "- [ ] $resource_uri" >> /tmp/resource_testing_checklist.md
+done < /tmp/resource_uris.txt
+
+echo "Resource testing checklist created at /tmp/resource_testing_checklist.md"
+```
+
+### Step 2: Tool Schema Discovery for Parameter Testing
+
+#### Extract Tool Schema Information
+
+```bash
+# Get schema for specific tool to understand required parameters
+TOOL_NAME="list_devices"
+jq --arg tool "$TOOL_NAME" '.tools[] | select(.name == $tool) | .inputSchema' /tmp/tools.json
+
+# Get tool description for usage guidance
+jq --arg tool "$TOOL_NAME" '.tools[] | select(.name == $tool) | .description' /tmp/tools.json
+
+# Generate parameter template for tool testing
+jq --arg tool "$TOOL_NAME" '.tools[] | select(.name == $tool) | .inputSchema.properties // {}' /tmp/tools.json
+```
+
+#### Batch Schema Extraction
+
+```bash
+# Create schema reference file for all tools
+echo "# Tool Schema Reference" > /tmp/tool_schemas.md
+echo "" >> /tmp/tool_schemas.md
+
+while IFS= read -r tool_name; do
+ echo "## $tool_name" >> /tmp/tool_schemas.md
+ echo "" >> /tmp/tool_schemas.md
+
+ # Get description
+ description=$(jq -r --arg tool "$tool_name" '.tools[] | select(.name == $tool) | .description' /tmp/tools.json)
+ echo "**Description:** $description" >> /tmp/tool_schemas.md
+ echo "" >> /tmp/tool_schemas.md
+
+ # Get required parameters
+ required=$(jq -r --arg tool "$tool_name" '.tools[] | select(.name == $tool) | .inputSchema.required // [] | join(", ")' /tmp/tools.json)
+ if [ "$required" != "" ]; then
+ echo "**Required Parameters:** $required" >> /tmp/tool_schemas.md
+ else
+ echo "**Required Parameters:** None" >> /tmp/tool_schemas.md
+ fi
+ echo "" >> /tmp/tool_schemas.md
+
+ # Get all parameters
+ echo "**All Parameters:**" >> /tmp/tool_schemas.md
+ jq --arg tool "$tool_name" '.tools[] | select(.name == $tool) | .inputSchema.properties // {} | keys[]' /tmp/tools.json | while read param; do
+ echo "- $param" >> /tmp/tool_schemas.md
+ done
+ echo "" >> /tmp/tool_schemas.md
+
+done < /tmp/tool_names.txt
+
+echo "Tool schema reference created at /tmp/tool_schemas.md"
+```
+
+### Step 3: Manual Tool-by-Tool Testing
+
+#### 🚨 CRITICAL: STEP-BY-STEP BLACK BOX TESTING PROCESS
+
+### ABSOLUTE RULE: ALL TESTING MUST BE DONE MANUALLY, ONE TOOL AT A TIME USING RELOADEROO INSPECT
+
+### SYSTEMATIC TESTING PROCESS
+
+1. **Create TodoWrite Task List**
+ - Add all 83 tools to task list before starting
+ - Mark each tool as "pending" initially
+ - Update status to "in_progress" when testing begins
+ - Mark "completed" only after manual verification
+
+2. **Test Each Tool Individually**
+ - Execute ONLY via `npx reloaderoo@latest inspect call-tool "TOOL_NAME" --params 'JSON' -- node build/index.js`
+ - Wait for complete response before proceeding to next tool
+ - Read and verify each tool's output manually
+ - Record key outputs (UUIDs, paths, schemes) for dependent tools
+
+3. **Manual Verification Requirements**
+ - ✅ **Read each response** - Manually verify tool output makes sense
+ - ✅ **Check for errors** - Identify any tool failures or unexpected responses
+ - ✅ **Record UUIDs/paths** - Save outputs needed for dependent tools
+ - ✅ **Update task list** - Mark each tool complete after verification
+ - ✅ **Document issues** - Record any problems found during testing
+
+4. **FORBIDDEN SHORTCUTS:**
+ - ❌ **NO SCRIPTS** - Scripts hide what's happening and prevent proper verification
+ - ❌ **NO AUTOMATION** - Every tool call must be manually executed and verified
+ - ❌ **NO BATCHING** - Cannot test multiple tools simultaneously
+ - ❌ **NO MCP DIRECT CALLS** - Only Reloaderoo inspect commands allowed
+
+#### Phase 1: Infrastructure Validation
+
+#### Manual Commands (execute individually):
+
+```bash
+# Test server connectivity
+npx reloaderoo@latest inspect ping -- node build/index.js
+
+# Get server information
+npx reloaderoo@latest inspect server-info -- node build/index.js
+
+# Verify tool count manually
+npx reloaderoo@latest inspect list-tools -- node build/index.js 2>/dev/null | jq '.tools | length'
+
+# Verify resource count manually
+npx reloaderoo@latest inspect list-resources -- node build/index.js 2>/dev/null | jq '.resources | length'
+```
+
+#### Phase 2: Resource Testing
+
+```bash
+# Test each resource systematically
+while IFS= read -r resource_uri; do
+ echo "Testing resource: $resource_uri"
+ npx reloaderoo@latest inspect read-resource "$resource_uri" -- node build/index.js 2>/dev/null
+ echo "---"
+done < /tmp/resource_uris.txt
+```
+
+#### Phase 3: Foundation Tools (Data Collection)
+
+### CRITICAL: Capture ALL key outputs for dependent tools
+
+```bash
+echo "=== FOUNDATION TOOL TESTING & DATA COLLECTION ==="
+
+# 1. Test diagnostic (no dependencies)
+echo "Testing diagnostic..."
+npx reloaderoo@latest inspect call-tool "diagnostic" --params '{}' -- node build/index.js 2>/dev/null
+
+# 2. Collect device data
+echo "Collecting device UUIDs..."
+npx reloaderoo@latest inspect call-tool "list_devices" --params '{}' -- node build/index.js 2>/dev/null > /tmp/devices_output.json
+DEVICE_UUIDS=$(jq -r '.content[0].text' /tmp/devices_output.json | grep -E "UDID: [A-F0-9-]+" | sed 's/.*UDID: //' | head -2)
+echo "Device UUIDs captured: $DEVICE_UUIDS"
+
+# 3. Collect simulator data
+echo "Collecting simulator UUIDs..."
+npx reloaderoo@latest inspect call-tool "list_sims" --params '{}' -- node build/index.js 2>/dev/null > /tmp/sims_output.json
+SIMULATOR_UUIDS=$(jq -r '.content[0].text' /tmp/sims_output.json | grep -E "\([A-F0-9-]+\)" | sed 's/.*(\([A-F0-9-]*\)).*/\1/' | head -3)
+echo "Simulator UUIDs captured: $SIMULATOR_UUIDS"
+
+# 4. Collect project data
+echo "Collecting project paths..."
+npx reloaderoo@latest inspect call-tool "discover_projs" --params '{"workspaceRoot": "/Volumes/Developer/XcodeBuildMCP"}' -- node build/index.js 2>/dev/null > /tmp/projects_output.json
+PROJECT_PATHS=$(jq -r '.content[1].text' /tmp/projects_output.json | grep -E "\.xcodeproj$" | sed 's/.*- //' | head -3)
+WORKSPACE_PATHS=$(jq -r '.content[2].text' /tmp/projects_output.json | grep -E "\.xcworkspace$" | sed 's/.*- //' | head -2)
+echo "Project paths captured: $PROJECT_PATHS"
+echo "Workspace paths captured: $WORKSPACE_PATHS"
+
+# Save key data for dependent tools
+echo "$DEVICE_UUIDS" > /tmp/device_uuids.txt
+echo "$SIMULATOR_UUIDS" > /tmp/simulator_uuids.txt
+echo "$PROJECT_PATHS" > /tmp/project_paths.txt
+echo "$WORKSPACE_PATHS" > /tmp/workspace_paths.txt
+```
+
+#### Phase 4: Discovery Tools (Metadata Collection)
+
+```bash
+echo "=== DISCOVERY TOOL TESTING & METADATA COLLECTION ==="
+
+# Collect schemes for each project
+while IFS= read -r project_path; do
+ if [ -n "$project_path" ]; then
+ echo "Getting schemes for: $project_path"
+ npx reloaderoo@latest inspect call-tool "list_schems_proj" --params "{\"projectPath\": \"$project_path\"}" -- node build/index.js 2>/dev/null > /tmp/schemes_$$.json
+ SCHEMES=$(jq -r '.content[1].text' /tmp/schemes_$$.json 2>/dev/null || echo "NoScheme")
+ echo "$project_path|$SCHEMES" >> /tmp/project_schemes.txt
+ echo "Schemes captured for $project_path: $SCHEMES"
+ fi
+done < /tmp/project_paths.txt
+
+# Collect schemes for each workspace
+while IFS= read -r workspace_path; do
+ if [ -n "$workspace_path" ]; then
+ echo "Getting schemes for: $workspace_path"
+ npx reloaderoo@latest inspect call-tool "list_schems_ws" --params "{\"workspacePath\": \"$workspace_path\"}" -- node build/index.js 2>/dev/null > /tmp/ws_schemes_$$.json
+ SCHEMES=$(jq -r '.content[1].text' /tmp/ws_schemes_$$.json 2>/dev/null || echo "NoScheme")
+ echo "$workspace_path|$SCHEMES" >> /tmp/workspace_schemes.txt
+ echo "Schemes captured for $workspace_path: $SCHEMES"
+ fi
+done < /tmp/workspace_paths.txt
+```
+
+#### Phase 5: Manual Individual Tool Testing (All 83 Tools)
+
+### CRITICAL: Test every single tool manually, one at a time
+
+#### Manual Testing Process:
+
+1. **Create task list** with TodoWrite tool for all 83 tools
+2. **Test each tool individually** with proper parameters
+3. **Mark each tool complete** in task list after manual verification
+4. **Record results** and observations for each tool
+5. **NO SCRIPTS** - Each command executed manually
+
+### STEP-BY-STEP MANUAL TESTING COMMANDS
+
+```bash
+# STEP 1: Test foundation tools (no parameters required)
+# Execute each command individually, wait for response, verify manually
+npx reloaderoo@latest inspect call-tool "diagnostic" --params '{}' -- node build/index.js
+# [Wait for response, read output, mark tool complete in task list]
+
+npx reloaderoo@latest inspect call-tool "list_devices" --params '{}' -- node build/index.js
+# [Record device UUIDs from response for dependent tools]
+
+npx reloaderoo@latest inspect call-tool "list_sims" --params '{}' -- node build/index.js
+# [Record simulator UUIDs from response for dependent tools]
+
+# STEP 2: Test project discovery (use discovered project paths)
+npx reloaderoo@latest inspect call-tool "list_schems_proj" --params '{"projectPath": "/actual/path/from/discover_projs.xcodeproj"}' -- node build/index.js
+# [Record scheme names from response for build tools]
+
+# STEP 3: Test workspace tools (use discovered workspace paths)
+npx reloaderoo@latest inspect call-tool "list_schems_ws" --params '{"workspacePath": "/actual/path/from/discover_projs.xcworkspace"}' -- node build/index.js
+# [Record scheme names from response for build tools]
+
+# STEP 4: Test simulator tools (use captured simulator UUIDs from step 1)
+npx reloaderoo@latest inspect call-tool "boot_sim" --params '{"simulatorUuid": "ACTUAL_UUID_FROM_LIST_SIMS"}' -- node build/index.js
+# [Verify simulator boots successfully]
+
+# STEP 5: Test build tools (requires project + scheme + simulator from previous steps)
+npx reloaderoo@latest inspect call-tool "build_sim_id_proj" --params '{"projectPath": "/actual/project.xcodeproj", "scheme": "ActualSchemeName", "simulatorId": "ACTUAL_SIMULATOR_UUID"}' -- node build/index.js
+# [Verify build succeeds and record app bundle path]
+```
+
+### CRITICAL: EACH COMMAND MUST BE
+1. **Executed individually** - One command at a time, manually typed or pasted
+2. **Verified manually** - Read the complete response before continuing
+3. **Tracked in task list** - Mark tool complete only after verification
+4. **Use real data** - Replace placeholder values with actual captured data
+5. **Wait for completion** - Allow each command to finish before proceeding
+
+### TESTING VIOLATIONS AND ENFORCEMENT
+
+### 🚨 CRITICAL VIOLATIONS THAT WILL TERMINATE TESTING
+
+1. **Direct MCP Tool Usage Violation:**
+ ```typescript
+ // ❌ IMMEDIATE TERMINATION - Using MCP tools directly
+ await mcp__XcodeBuildMCP__list_devices();
+ const result = await list_sims();
+ ```
+
+2. **Script-Based Testing Violation:**
+ ```bash
+ # ❌ IMMEDIATE TERMINATION - Using scripts to test tools
+ for tool in $(cat tool_list.txt); do
+ npx reloaderoo inspect call-tool "$tool" --params '{}' -- node build/index.js
+ done
+ ```
+
+3. **Batching/Automation Violation:**
+ ```bash
+ # ❌ IMMEDIATE TERMINATION - Testing multiple tools simultaneously
+ npx reloaderoo inspect call-tool "list_devices" & npx reloaderoo inspect call-tool "list_sims" &
+ ```
+
+4. **Source Code Examination Violation:**
+ ```typescript
+ // ❌ IMMEDIATE TERMINATION - Reading implementation during testing
+ const toolImplementation = await Read('/src/mcp/tools/device-shared/list_devices.ts');
+ ```
+
+### ENFORCEMENT PROCEDURE
+1. **First Violation**: Immediate correction and restart of testing process
+2. **Documentation Update**: Add explicit prohibition to prevent future violations
+3. **Method Validation**: Ensure all future testing uses only Reloaderoo inspect commands
+4. **Progress Reset**: Restart testing from foundation tools if direct MCP usage detected
+
+### VALID TESTING SEQUENCE EXAMPLE
+```bash
+# ✅ CORRECT - Step-by-step manual execution via Reloaderoo
+# Tool 1: Test diagnostic
+npx reloaderoo@latest inspect call-tool "diagnostic" --params '{}' -- node build/index.js
+# [Read response, verify, mark complete in TodoWrite]
+
+# Tool 2: Test list_devices
+npx reloaderoo@latest inspect call-tool "list_devices" --params '{}' -- node build/index.js
+# [Read response, capture UUIDs, mark complete in TodoWrite]
+
+# Tool 3: Test list_sims
+npx reloaderoo@latest inspect call-tool "list_sims" --params '{}' -- node build/index.js
+# [Read response, capture UUIDs, mark complete in TodoWrite]
+
+# Tool X: Test stateful tool (expected to fail)
+npx reloaderoo@latest inspect call-tool "swift_package_stop" --params '{"pid": 12345}' -- node build/index.js
+# [Tool fails as expected - no in-memory state available]
+# [Mark as "false negative - stateful tool limitation" in TodoWrite]
+# [Continue to next tool without investigation]
+
+# Continue individually for all 83 tools...
+```
+
+### HANDLING STATEFUL TOOL FAILURES
+```bash
+# ✅ CORRECT Response to Expected Stateful Tool Failure
+# Tool fails with "No process found" or similar state-related error
+# Response: Mark tool as "tested - false negative (stateful)" in task list
+# Do NOT attempt to diagnose, fix, or investigate the failure
+# Continue immediately to next tool in sequence
+```
+
+### Step 4: Error Testing
+
+```bash
+# Test error handling systematically
+echo "=== Error Testing ==="
+
+# Test with invalid JSON parameters
+echo "Testing invalid parameter types..."
+npx reloaderoo@latest inspect call-tool list_schems_proj --params '{"projectPath": 123}' -- node build/index.js 2>/dev/null
+
+# Test with non-existent paths
+echo "Testing non-existent paths..."
+npx reloaderoo@latest inspect call-tool list_schems_proj --params '{"projectPath": "/nonexistent/path.xcodeproj"}' -- node build/index.js 2>/dev/null
+
+# Test with invalid UUIDs
+echo "Testing invalid UUIDs..."
+npx reloaderoo@latest inspect call-tool boot_sim --params '{"simulatorUuid": "invalid-uuid"}' -- node build/index.js 2>/dev/null
+```
+
+### Step 5: Generate Testing Report
+
+```bash
+# Create comprehensive testing session report
+cat > TESTING_SESSION_$(date +%Y-%m-%d).md << EOF
+# Manual Testing Session - $(date +%Y-%m-%d)
+
+## Environment
+- macOS Version: $(sw_vers -productVersion)
+- XcodeBuildMCP Version: $(jq -r '.version' package.json 2>/dev/null || echo "unknown")
+- Testing Method: Reloaderoo @latest via npx
+
+## Official Counts (Programmatically Verified)
+- Total Tools: $TOOL_COUNT
+- Total Resources: $RESOURCE_COUNT
+
+## Test Results
+[Document test results here]
+
+## Issues Found
+[Document any discrepancies or failures]
+
+## Performance Notes
+[Document response times and performance observations]
+EOF
+
+echo "Testing session template created: TESTING_SESSION_$(date +%Y-%m-%d).md"
+```
+
+### Key Commands Reference
+
+```bash
+# Essential testing commands
+npx reloaderoo@latest inspect ping -- node build/index.js
+npx reloaderoo@latest inspect server-info -- node build/index.js
+npx reloaderoo@latest inspect list-tools -- node build/index.js | jq '.tools | length'
+npx reloaderoo@latest inspect list-resources -- node build/index.js | jq '.resources | length'
+npx reloaderoo@latest inspect call-tool TOOL_NAME --params '{}' -- node build/index.js
+npx reloaderoo@latest inspect read-resource "xcodebuildmcp://RESOURCE" -- node build/index.js
+
+# Schema extraction
+jq --arg tool "TOOL_NAME" '.tools[] | select(.name == $tool) | .inputSchema' /tmp/tools.json
+jq --arg tool "TOOL_NAME" '.tools[] | select(.name == $tool) | .description' /tmp/tools.json
+```
+
+This systematic approach ensures comprehensive, accurate testing using programmatic discovery and validation of all XcodeBuildMCP functionality.
+
## Troubleshooting
### Common Issues
@@ -528,7 +1222,7 @@ npm test -- src/plugins/simulator-workspace/__tests__/tool_name.test.ts
npm test -- --reporter=verbose
# Check for banned patterns
-node scripts/check-test-patterns.js
+node scripts/check-code-patterns.js
# Verify dependency injection compliance
node scripts/audit-dependency-container.js
@@ -541,7 +1235,7 @@ npm run test:coverage -- src/plugins/simulator-workspace/
```bash
# Check for vitest mocking violations
-node scripts/check-test-patterns.js --pattern=vitest
+node scripts/check-code-patterns.js --pattern=vitest
# Check dependency injection compliance
node scripts/audit-dependency-container.js
diff --git a/eslint.config.js b/eslint.config.js
index 9cf9ec53..f6d0c19c 100644
--- a/eslint.config.js
+++ b/eslint.config.js
@@ -31,6 +31,30 @@ export default [
varsIgnorePattern: '^_'
}],
'no-console': ['warn', { allow: ['error'] }],
+
+ // Prevent dangerous type casting anti-patterns (errors)
+ '@typescript-eslint/consistent-type-assertions': ['error', {
+ assertionStyle: 'as',
+ objectLiteralTypeAssertions: 'never'
+ }],
+ '@typescript-eslint/no-unsafe-argument': 'error',
+ '@typescript-eslint/no-unsafe-assignment': 'error',
+ '@typescript-eslint/no-unsafe-call': 'error',
+ '@typescript-eslint/no-unsafe-member-access': 'error',
+ '@typescript-eslint/no-unsafe-return': 'error',
+
+ // Prevent specific anti-patterns we found
+ '@typescript-eslint/ban-ts-comment': ['error', {
+ 'ts-expect-error': 'allow-with-description',
+ 'ts-ignore': true,
+ 'ts-nocheck': true,
+ 'ts-check': false,
+ }],
+
+ // Encourage best practices (warnings - can be gradually fixed)
+ '@typescript-eslint/prefer-as-const': 'warn',
+ '@typescript-eslint/prefer-nullish-coalescing': 'warn',
+ '@typescript-eslint/prefer-optional-chain': 'warn',
},
},
{
@@ -46,6 +70,13 @@ export default [
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'prefer-const': 'off',
+
+ // Relax unsafe rules for tests - tests often need more flexibility
+ '@typescript-eslint/no-unsafe-argument': 'off',
+ '@typescript-eslint/no-unsafe-assignment': 'off',
+ '@typescript-eslint/no-unsafe-call': 'off',
+ '@typescript-eslint/no-unsafe-member-access': 'off',
+ '@typescript-eslint/no-unsafe-return': 'off',
},
},
];
diff --git a/package.json b/package.json
index 7065d0c1..4b7e614c 100644
--- a/package.json
+++ b/package.json
@@ -20,6 +20,9 @@
"typecheck": "npx tsc --noEmit",
"inspect": "npx @modelcontextprotocol/inspector node build/index.js",
"diagnostic": "node build/diagnostic-cli.js",
+ "tools": "node scripts/tool-summary.js",
+ "tools:list": "node scripts/tool-summary.js --list-tools",
+ "tools:all": "node scripts/tool-summary.js --list-tools --list-resources",
"test": "vitest run",
"test:watch": "vitest",
"test:ui": "vitest --ui",
diff --git a/scripts/check-test-patterns.js b/scripts/check-code-patterns.js
similarity index 69%
rename from scripts/check-test-patterns.js
rename to scripts/check-code-patterns.js
index bb74110f..31772529 100755
--- a/scripts/check-test-patterns.js
+++ b/scripts/check-code-patterns.js
@@ -1,21 +1,22 @@
#!/usr/bin/env node
/**
- * XcodeBuildMCP Test Pattern Violations Checker
+ * XcodeBuildMCP Code Pattern Violations Checker
*
- * Validates that all test files follow established testing patterns and
- * identifies violations of the project's testing guidelines.
+ * Validates that all code files follow established patterns and
+ * identifies violations of the project's coding guidelines.
*
* USAGE:
- * node scripts/check-test-patterns.js [--pattern=vitest|timeout|all]
- * node scripts/check-test-patterns.js --help
+ * node scripts/check-code-patterns.js [--pattern=vitest|timeout|typescript|handler|all]
+ * node scripts/check-code-patterns.js --help
*
- * TESTING GUIDELINES ENFORCED:
+ * CODE GUIDELINES ENFORCED:
* 1. NO vitest mocking patterns (vi.mock, vi.fn, .mockResolvedValue, etc.)
* 2. NO setTimeout-based mocking patterns
* 3. ONLY dependency injection with createMockExecutor() and createMockFileSystemExecutor()
- * 4. Proper test architecture compliance
- * 5. NO handler signature violations (handlers must have exact MCP SDK signatures)
+ * 4. NO TypeScript anti-patterns (as unknown casts, unsafe type assertions)
+ * 5. Proper test architecture compliance
+ * 6. NO handler signature violations (handlers must have exact MCP SDK signatures)
*/
import { readFileSync, readdirSync, statSync } from 'fs';
@@ -34,25 +35,27 @@ const showHelp = args.includes('--help') || args.includes('-h');
if (showHelp) {
console.log(`
-XcodeBuildMCP Test Pattern Violations Checker
+XcodeBuildMCP Code Pattern Violations Checker
USAGE:
- node scripts/check-test-patterns.js [options]
+ node scripts/check-code-patterns.js [options]
OPTIONS:
- --pattern=TYPE Check specific pattern type (vitest|timeout|handler|all) [default: all]
+ --pattern=TYPE Check specific pattern type (vitest|timeout|typescript|handler|all) [default: all]
--help, -h Show this help message
PATTERN TYPES:
vitest Check only vitest mocking violations (vi.mock, vi.fn, etc.)
timeout Check only setTimeout-based mocking patterns
+ typescript Check only TypeScript anti-patterns (as unknown, unsafe casts)
handler Check only handler signature violations
all Check all pattern violations (default)
EXAMPLES:
- node scripts/check-test-patterns.js
- node scripts/check-test-patterns.js --pattern=vitest
- node scripts/check-test-patterns.js --pattern=timeout
+ node scripts/check-code-patterns.js
+ node scripts/check-code-patterns.js --pattern=vitest
+ node scripts/check-code-patterns.js --pattern=typescript
+ node scripts/check-code-patterns.js --pattern=handler
`);
process.exit(0);
}
@@ -99,6 +102,18 @@ const VITEST_MOCKING_PATTERNS = [
/\bexecSyncFn\b/, // execSyncFn usage - BANNED (use executeCommand instead)
];
+// CRITICAL: TYPESCRIPT ANTI-PATTERNS ARE FORBIDDEN
+// Prefer structural typing and object literals over unsafe type assertions
+const TYPESCRIPT_ANTIPATTERNS = [
+ /as unknown(?!\s*,)/, // 'as unknown' casting - ANTI-PATTERN (prefer object literals)
+ /as any/, // 'as any' casting - BANNED (defeats TypeScript safety)
+ /\@ts-ignore/, // @ts-ignore comments - ANTI-PATTERN (fix the root cause)
+ /\@ts-expect-error/, // @ts-expect-error comments - USE SPARINGLY (document why)
+ /\!\s*\;/, // Non-null assertion operator - USE SPARINGLY (ensure safety)
+ /\/, // Explicit any type - BANNED (use unknown or proper typing)
+ /:\s*any(?!\[\])/, // Parameter/variable typed as any - BANNED
+];
+
// CRITICAL: HANDLER SIGNATURE VIOLATIONS ARE FORBIDDEN
// MCP SDK requires handlers to have exact signatures:
// Tools: (args: Record) => Promise
@@ -186,12 +201,16 @@ function analyzeTestFile(filePath) {
// Check for vitest mocking patterns (FORBIDDEN)
const hasVitestMockingPatterns = VITEST_MOCKING_PATTERNS.some(pattern => pattern.test(content));
+ // Check for TypeScript anti-patterns (ANTI-PATTERN)
+ const hasTypescriptAntipatterns = TYPESCRIPT_ANTIPATTERNS.some(pattern => pattern.test(content));
+
// Check for dependency injection patterns (TRUE DI)
const hasDIPatterns = DEPENDENCY_INJECTION_PATTERNS.some(pattern => pattern.test(content));
// Extract specific pattern occurrences for details
const timeoutDetails = [];
const vitestMockingDetails = [];
+ const typescriptAntipatternDetails = [];
const lines = content.split('\n');
lines.forEach((line, index) => {
@@ -221,18 +240,30 @@ function analyzeTestFile(filePath) {
}
}
});
+
+ TYPESCRIPT_ANTIPATTERNS.forEach(pattern => {
+ if (pattern.test(line)) {
+ typescriptAntipatternDetails.push({
+ line: index + 1,
+ content: line.trim(),
+ pattern: pattern.source
+ });
+ }
+ });
});
return {
filePath: relativePath,
hasTimeoutPatterns,
hasVitestMockingPatterns,
+ hasTypescriptAntipatterns,
hasDIPatterns,
timeoutDetails,
vitestMockingDetails,
- needsConversion: hasTimeoutPatterns || hasVitestMockingPatterns,
- isConverted: hasDIPatterns && !hasTimeoutPatterns && !hasVitestMockingPatterns,
- isMixed: (hasTimeoutPatterns || hasVitestMockingPatterns) && hasDIPatterns
+ typescriptAntipatternDetails,
+ needsConversion: hasTimeoutPatterns || hasVitestMockingPatterns || hasTypescriptAntipatterns,
+ isConverted: hasDIPatterns && !hasTimeoutPatterns && !hasVitestMockingPatterns && !hasTypescriptAntipatterns,
+ isMixed: (hasTimeoutPatterns || hasVitestMockingPatterns || hasTypescriptAntipatterns) && hasDIPatterns
};
} catch (error) {
console.error(`Error reading file ${filePath}: ${error.message}`);
@@ -245,11 +276,66 @@ function analyzeToolOrResourceFile(filePath) {
const content = readFileSync(filePath, 'utf8');
const relativePath = relative(projectRoot, filePath);
+ // Check for setTimeout patterns
+ const hasTimeoutPatterns = TIMEOUT_PATTERNS.some(pattern => pattern.test(content));
+
+ // Check for vitest mocking patterns (FORBIDDEN)
+ const hasVitestMockingPatterns = VITEST_MOCKING_PATTERNS.some(pattern => pattern.test(content));
+
+ // Check for TypeScript anti-patterns (ANTI-PATTERN)
+ const hasTypescriptAntipatterns = TYPESCRIPT_ANTIPATTERNS.some(pattern => pattern.test(content));
+
+ // Check for dependency injection patterns (TRUE DI)
+ const hasDIPatterns = DEPENDENCY_INJECTION_PATTERNS.some(pattern => pattern.test(content));
+
// Check for handler signature violations (FORBIDDEN)
const hasHandlerSignatureViolations = HANDLER_SIGNATURE_VIOLATIONS.some(pattern => pattern.test(content));
- // Extract handler signature violation details
+ // Extract specific pattern occurrences for details
+ const timeoutDetails = [];
+ const vitestMockingDetails = [];
+ const typescriptAntipatternDetails = [];
const handlerSignatureDetails = [];
+ const lines = content.split('\n');
+
+ lines.forEach((line, index) => {
+ TIMEOUT_PATTERNS.forEach(pattern => {
+ if (pattern.test(line)) {
+ timeoutDetails.push({
+ line: index + 1,
+ content: line.trim(),
+ pattern: pattern.source
+ });
+ }
+ });
+
+ VITEST_MOCKING_PATTERNS.forEach(pattern => {
+ if (pattern.test(line)) {
+ // Check if this line matches any allowed cleanup patterns
+ const isAllowedCleanup = ALLOWED_CLEANUP_PATTERNS.some(allowedPattern =>
+ allowedPattern.test(line.trim())
+ );
+
+ if (!isAllowedCleanup) {
+ vitestMockingDetails.push({
+ line: index + 1,
+ content: line.trim(),
+ pattern: pattern.source
+ });
+ }
+ }
+ });
+
+ TYPESCRIPT_ANTIPATTERNS.forEach(pattern => {
+ if (pattern.test(line)) {
+ typescriptAntipatternDetails.push({
+ line: index + 1,
+ content: line.trim(),
+ pattern: pattern.source
+ });
+ }
+ });
+ });
if (hasHandlerSignatureViolations) {
// Use regex to find the violation and its line number
const lines = content.split('\n');
@@ -274,9 +360,18 @@ function analyzeToolOrResourceFile(filePath) {
return {
filePath: relativePath,
+ hasTimeoutPatterns,
+ hasVitestMockingPatterns,
+ hasTypescriptAntipatterns,
+ hasDIPatterns,
hasHandlerSignatureViolations,
+ timeoutDetails,
+ vitestMockingDetails,
+ typescriptAntipatternDetails,
handlerSignatureDetails,
- needsConversion: hasHandlerSignatureViolations
+ needsConversion: hasTimeoutPatterns || hasVitestMockingPatterns || hasTypescriptAntipatterns || hasHandlerSignatureViolations,
+ isConverted: hasDIPatterns && !hasTimeoutPatterns && !hasVitestMockingPatterns && !hasTypescriptAntipatterns && !hasHandlerSignatureViolations,
+ isMixed: (hasTimeoutPatterns || hasVitestMockingPatterns || hasTypescriptAntipatterns || hasHandlerSignatureViolations) && hasDIPatterns
};
} catch (error) {
console.error(`Error reading file ${filePath}: ${error.message}`);
@@ -285,22 +380,27 @@ function analyzeToolOrResourceFile(filePath) {
}
function main() {
- console.log('🔍 XcodeBuildMCP Test Pattern Violations Checker\n');
+ console.log('🔍 XcodeBuildMCP Code Pattern Violations Checker\n');
console.log(`🎯 Checking pattern type: ${patternFilter.toUpperCase()}\n`);
- console.log('TESTING GUIDELINES ENFORCED:');
+ console.log('CODE GUIDELINES ENFORCED:');
console.log('✅ ONLY ALLOWED: createMockExecutor() and createMockFileSystemExecutor()');
console.log('❌ BANNED: vitest mocking patterns (vi.mock, vi.fn, .mockResolvedValue, etc.)');
console.log('❌ BANNED: setTimeout-based mocking patterns');
+ console.log('❌ ANTI-PATTERN: TypeScript unsafe casts (as unknown, as any, @ts-ignore)');
console.log('❌ BANNED: handler signature violations (handlers must have exact MCP SDK signatures)\n');
const testFiles = findTestFiles(join(projectRoot, 'src'));
- const results = testFiles.map(analyzeTestFile).filter(Boolean);
+ const testResults = testFiles.map(analyzeTestFile).filter(Boolean);
- // Also check tool and resource files for handler signature violations
+ // Also check tool and resource files for TypeScript anti-patterns AND handler signature violations
const toolFiles = findToolAndResourceFiles(join(projectRoot, 'src', 'mcp', 'tools'));
const resourceFiles = findToolAndResourceFiles(join(projectRoot, 'src', 'mcp', 'resources'));
const allToolAndResourceFiles = [...toolFiles, ...resourceFiles];
- const handlerResults = allToolAndResourceFiles.map(analyzeToolOrResourceFile).filter(Boolean);
+ const toolResults = allToolAndResourceFiles.map(analyzeToolOrResourceFile).filter(Boolean);
+
+ // Combine test and tool file results for TypeScript analysis
+ const results = [...testResults, ...toolResults];
+ const handlerResults = toolResults;
// Filter results based on pattern type
let filteredResults;
@@ -315,6 +415,10 @@ function main() {
filteredResults = results.filter(r => r.hasTimeoutPatterns);
console.log(`Filtering to show only setTimeout violations (${filteredResults.length} files)`);
break;
+ case 'typescript':
+ filteredResults = results.filter(r => r.hasTypescriptAntipatterns);
+ console.log(`Filtering to show only TypeScript anti-pattern violations (${filteredResults.length} files)`);
+ break;
case 'handler':
filteredResults = [];
filteredHandlerResults = handlerResults.filter(r => r.hasHandlerSignatureViolations);
@@ -331,17 +435,19 @@ function main() {
const needsConversion = filteredResults;
const converted = results.filter(r => r.isConverted);
const mixed = results.filter(r => r.isMixed);
- const timeoutOnly = results.filter(r => r.hasTimeoutPatterns && !r.hasVitestMockingPatterns && !r.hasDIPatterns);
- const vitestMockingOnly = results.filter(r => r.hasVitestMockingPatterns && !r.hasTimeoutPatterns && !r.hasDIPatterns);
- const noPatterns = results.filter(r => !r.hasTimeoutPatterns && !r.hasVitestMockingPatterns && !r.hasDIPatterns);
+ const timeoutOnly = results.filter(r => r.hasTimeoutPatterns && !r.hasVitestMockingPatterns && !r.hasTypescriptAntipatterns && !r.hasDIPatterns);
+ const vitestMockingOnly = results.filter(r => r.hasVitestMockingPatterns && !r.hasTimeoutPatterns && !r.hasTypescriptAntipatterns && !r.hasDIPatterns);
+ const typescriptOnly = results.filter(r => r.hasTypescriptAntipatterns && !r.hasTimeoutPatterns && !r.hasVitestMockingPatterns && !r.hasDIPatterns);
+ const noPatterns = results.filter(r => !r.hasTimeoutPatterns && !r.hasVitestMockingPatterns && !r.hasTypescriptAntipatterns && !r.hasDIPatterns);
- console.log(`📊 VITEST MOCKING VIOLATION ANALYSIS`);
- console.log(`===================================`);
- console.log(`Total test files analyzed: ${results.length}`);
- console.log(`🚨 FILES VIOLATING VITEST MOCKING BAN: ${needsConversion.length}`);
+ console.log(`📊 CODE PATTERN VIOLATION ANALYSIS`);
+ console.log(`=================================`);
+ console.log(`Total files analyzed: ${results.length}`);
+ console.log(`🚨 FILES WITH VIOLATIONS: ${needsConversion.length}`);
console.log(` └─ setTimeout-based violations: ${timeoutOnly.length}`);
console.log(` └─ vitest mocking violations: ${vitestMockingOnly.length}`);
- console.log(`✅ COMPLIANT (pure dependency injection): ${converted.length}`);
+ console.log(` └─ TypeScript anti-patterns: ${typescriptOnly.length}`);
+ console.log(`✅ COMPLIANT (best practices): ${converted.length}`);
console.log(`⚠️ MIXED VIOLATIONS: ${mixed.length}`);
console.log(`📝 No patterns detected: ${noPatterns.length}`);
console.log('');
@@ -372,6 +478,16 @@ function main() {
}
}
+ if (result.typescriptAntipatternDetails.length > 0) {
+ console.log(` 🚫 TYPESCRIPT ANTI-PATTERNS (${result.typescriptAntipatternDetails.length}):`);
+ result.typescriptAntipatternDetails.slice(0, 2).forEach(detail => {
+ console.log(` Line ${detail.line}: ${detail.content}`);
+ });
+ if (result.typescriptAntipatternDetails.length > 2) {
+ console.log(` ... and ${result.typescriptAntipatternDetails.length - 2} more TypeScript anti-patterns`);
+ }
+ }
+
console.log('');
});
}
@@ -428,13 +544,17 @@ function main() {
// Show top files by total violation count
const sortedByPatterns = needsConversion
- .sort((a, b) => (b.timeoutDetails.length + b.vitestMockingDetails.length) - (a.timeoutDetails.length + a.vitestMockingDetails.length))
+ .sort((a, b) => {
+ const totalA = a.timeoutDetails.length + a.vitestMockingDetails.length + a.typescriptAntipatternDetails.length;
+ const totalB = b.timeoutDetails.length + b.vitestMockingDetails.length + b.typescriptAntipatternDetails.length;
+ return totalB - totalA;
+ })
.slice(0, 5);
- console.log(`🚨 TOP 5 TEST FILES WITH MOST VIOLATIONS:`);
+ console.log(`🚨 TOP 5 FILES WITH MOST VIOLATIONS:`);
sortedByPatterns.forEach((result, index) => {
- const totalPatterns = result.timeoutDetails.length + result.vitestMockingDetails.length;
- console.log(`${index + 1}. ${result.filePath} (${totalPatterns} violations: ${result.timeoutDetails.length} timeout + ${result.vitestMockingDetails.length} vitest)`);
+ const totalPatterns = result.timeoutDetails.length + result.vitestMockingDetails.length + result.typescriptAntipatternDetails.length;
+ console.log(`${index + 1}. ${result.filePath} (${totalPatterns} violations: ${result.timeoutDetails.length} timeout + ${result.vitestMockingDetails.length} vitest + ${result.typescriptAntipatternDetails.length} typescript)`);
});
console.log('');
}
@@ -453,7 +573,8 @@ function main() {
if (!hasViolations && mixed.length === 0) {
console.log(`🎉 ALL FILES COMPLY WITH PROJECT STANDARDS!`);
console.log(`==========================================`);
- console.log(`✅ All test files use ONLY createMockExecutor() and createMockFileSystemExecutor()`);
+ console.log(`✅ All files use ONLY createMockExecutor() and createMockFileSystemExecutor()`);
+ console.log(`✅ All files follow TypeScript best practices (no unsafe casts)`);
console.log(`✅ All handler signatures comply with MCP SDK requirements`);
console.log(`✅ No violations detected!`);
}
diff --git a/scripts/tool-summary.js b/scripts/tool-summary.js
new file mode 100755
index 00000000..716dc6d3
--- /dev/null
+++ b/scripts/tool-summary.js
@@ -0,0 +1,338 @@
+#!/usr/bin/env node
+
+/**
+ * XcodeBuildMCP Tool Summary CLI
+ *
+ * A command-line tool that provides comprehensive information about available
+ * tools and resources in the XcodeBuildMCP server.
+ *
+ * Usage:
+ * node scripts/tool-summary.js [options]
+ *
+ * Options:
+ * --list-tools, -t List all tool names
+ * --list-resources, -r List all resource URIs
+ * --runtime-only Show only tools enabled at runtime (dynamic mode)
+ * --help, -h Show this help message
+ *
+ * Examples:
+ * node scripts/tool-summary.js # Show summary counts only
+ * node scripts/tool-summary.js --list-tools # Show summary + tool names
+ * node scripts/tool-summary.js --list-resources # Show summary + resource URIs
+ * node scripts/tool-summary.js -t -r # Show summary + tools + resources
+ * node scripts/tool-summary.js --runtime-only # Show only runtime-enabled tools
+ */
+
+import { spawn } from 'child_process';
+import path from 'path';
+import { fileURLToPath } from 'url';
+import fs from 'fs';
+
+// Get __dirname equivalent in ES modules
+const __filename = fileURLToPath(import.meta.url);
+const __dirname = path.dirname(__filename);
+
+// CLI argument parsing
+const args = process.argv.slice(2);
+const options = {
+ listTools: args.includes('--list-tools') || args.includes('-t'),
+ listResources: args.includes('--list-resources') || args.includes('-r'),
+ runtimeOnly: args.includes('--runtime-only'),
+ help: args.includes('--help') || args.includes('-h')
+};
+
+// Help text
+if (options.help) {
+ console.log(`
+XcodeBuildMCP Tool Summary CLI
+
+A command-line tool that provides comprehensive information about available
+tools and resources in the XcodeBuildMCP server.
+
+Usage:
+ node scripts/tool-summary.js [options]
+
+Options:
+ --list-tools, -t List all tool names
+ --list-resources, -r List all resource URIs
+ --runtime-only Show only tools enabled at runtime (dynamic mode)
+ --help, -h Show this help message
+
+Examples:
+ node scripts/tool-summary.js # Show summary counts only
+ node scripts/tool-summary.js --list-tools # Show summary + tool names
+ node scripts/tool-summary.js --list-resources # Show summary + resource URIs
+ node scripts/tool-summary.js -t -r # Show summary + tools + resources
+ node scripts/tool-summary.js --runtime-only # Show only runtime-enabled tools
+
+Environment Variables:
+ XCODEBUILDMCP_DYNAMIC_TOOLS=true Enable dynamic tool discovery mode
+ `);
+ process.exit(0);
+}
+
+/**
+ * Execute reloaderoo command and parse JSON response
+ * @param {string[]} reloaderooArgs - Arguments to pass to reloaderoo
+ * @returns {Promise