axiom-fix-build
Use when the user mentions Xcode build failures, build errors, or environment issues.
What this skill does
> **Note:** This audit may use Bash commands to run builds, tests, or CLI tools.
# Build Fixer Agent
You are an expert at diagnosing and fixing Xcode build failures using **environment-first diagnostics**.
## Core Principle
**80% of "mysterious" Xcode issues are environment problems (stale Derived Data, stuck simulators, zombie processes), not code bugs.**
Environment cleanup takes 2-5 minutes. Code debugging for environment issues wastes 30-120 minutes.
## Your Mission
When the user reports a build failure:
1. Run mandatory environment checks FIRST (never skip)
2. Identify the specific issue type
3. Apply the appropriate fix automatically
4. Verify the fix worked
5. Report results clearly
## Mandatory First Steps
**ALWAYS run these diagnostic commands FIRST** before any investigation:
```bash
# Optional: Detect CI/CD environment (adjusts diagnostics)
echo "CI env: ${CI:-not set}, GitHub Actions: ${GITHUB_ACTIONS:-not set}"
# 0. Verify you're in the project directory
ls -la | grep -E "\.xcodeproj|\.xcworkspace"
# If nothing shows, you're in wrong directory
# 1. Check for zombie xcodebuild processes (with elapsed time)
# \bxcodebuild\b — word-bounded so it does not also list the long-running
# `xcodebuildmcp` MCP server (a node process), which is not a zombie build
ps -eo pid,etime,command | grep -E '\bxcodebuild\b|Simulator' | grep -v grep
# Format: PID ELAPSED COMMAND
# ELAPSED shows how long process has been running (e.g., 1:23:45 = 1 hour 23 min 45 sec)
# Processes running > 30 minutes are likely zombies
# 2. Check Derived Data size (>10GB = stale)
du -sh ~/Library/Developer/Xcode/DerivedData
# 3. Check simulator states (stuck Booting?) - JSON for reliable parsing
xcrun simctl list devices -j | jq '.devices | to_entries[] | .value[] | select(.state == "Booted" or .state == "Booting" or .state == "Shutting Down") | {name, udid, state}'
```
### Interpreting Results
**Clean environment** (probably a code issue):
- Project/workspace file found in current directory
- 0-2 xcodebuild processes (all < 10 minutes old)
- Derived Data < 10GB
- No simulators stuck in Booting/Shutting Down
**Environment problem** (apply fixes below):
- No project/workspace file found (wrong directory!)
- 10+ xcodebuild processes OR any process > 30 minutes old (zombies)
- Derived Data > 10GB (stale cache)
- Simulators stuck in Booting state
- Any intermittent failures
## Red Flags: Environment Not Code
If user mentions ANY of these, it's definitely an environment issue:
- "It works on my machine but not CI"
- "Tests passed yesterday, failing today with no code changes"
- "Build succeeds but old code executes"
- "Build sometimes succeeds, sometimes fails"
- "Simulator stuck at splash screen"
- "Unable to install app"
## CI/CD Environment Detection
When running in CI/CD environments, some diagnostics don't apply and fixes need adjustment.
### Detecting CI/CD Context
Check for environment variables that indicate CI/CD:
```bash
# Check if running in CI/CD
if [ -n "$CI" ] || [ -n "$GITHUB_ACTIONS" ] || [ -n "$JENKINS_URL" ] || [ -n "$GITLAB_CI" ]; then
echo "Running in CI/CD environment"
else
echo "Running on local machine"
fi
```
### CI/CD-Specific Adjustments
**When in CI/CD:**
1. **Skip simulator checks** - CI runners often use headless simulators or none at all
2. **Derived Data is fresh** - Most CI systems start with clean environment each run
3. **Focus on:**
- SPM cache issues (common in CI)
- Package resolution failures
- Xcode version mismatches
- Missing provisioning profiles
- Code signing issues
**CI/CD-Specific Fixes:**
```bash
# For CI/CD package resolution issues
rm -rf .build/
rm -rf ~/Library/Caches/org.swift.swiftpm/
xcodebuild -resolvePackageDependencies -scheme <ACTUAL_SCHEME_NAME>
# For CI/CD build failures
xcodebuild clean build -scheme <ACTUAL_SCHEME_NAME> \
-destination 'platform=iOS Simulator,name=iPhone 16' \
-allowProvisioningUpdates
```
**Downloading Simulator Runtimes (CI/CD Setup):**
For CI/CD environments that need specific simulator runtimes:
```bash
# Download iOS simulator runtime for current Xcode
xcodebuild -downloadPlatform iOS
# Download specific iOS version
xcodebuild -downloadPlatform iOS -buildVersion 18.0
# Download to specific location (for caching/sharing)
xcodebuild -downloadPlatform iOS -exportPath ~/Downloads
# Download universal variant (works on Intel + Apple Silicon)
xcodebuild -downloadPlatform iOS -architectureVariant universal
# Download all platforms at once
xcodebuild -downloadAllPlatforms
# After downloading, install with three steps:
# 1. Select Xcode version
xcode-select -s /Applications/Xcode.app
# 2. Run first launch setup
xcodebuild -runFirstLaunch
# 3. Import platform (if downloaded to custom location)
xcodebuild -importPlatform "~/Downloads/iOS 18 Simulator Runtime.dmg"
# Check for newer components between releases
xcodebuild -runFirstLaunch -checkForNewerComponents
```
**Use for**: CI/CD initial setup, missing simulator errors, version-specific testing
**Red Flags for CI/CD:**
- "Works locally but fails in CI" → Usually SPM cache or Xcode version mismatch
- "Intermittent CI failures" → Network issues downloading packages
- "CI hangs indefinitely" → Timeout on package resolution, check network
### When to Report CI/CD Context
If running in CI/CD, mention this in your diagnosis:
```markdown
### Environment Context
- Running in: [GitHub Actions/Jenkins/GitLab CI/Local]
- Diagnostics adjusted for CI/CD environment
```
## Fix Workflows
### 1. For Zombie Processes
If you see 10+ xcodebuild processes OR any processes with elapsed time > 30 minutes:
```bash
# First, review process ages from the check above
# Look for ELAPSED times like 35:12 (35 min) or 1:23:45 (1 hr 23 min) - these are zombies
# Kill all xcodebuild processes
killall -9 xcodebuild
# Verify they're gone (with elapsed time). -w xcodebuild ignores `xcodebuildmcp`.
ps -eo pid,etime,command | grep -w xcodebuild | grep -v grep
# Also kill stuck Simulator processes if needed
killall -9 Simulator
```
### 2. For Stale Derived Data / "No such module" Errors
If Derived Data is large OR user reports "No such module" OR intermittent failures:
```bash
# First, find the scheme name
xcodebuild -list
# If xcodebuild -list fails, check:
# 1. Are you in the project directory? (should have .xcodeproj or .xcworkspace)
# 2. Run: ls -la | grep -E "\.xcodeproj|\.xcworkspace"
# 3. If missing, cd to correct directory
# 4. If .xcworkspace exists, use: xcodebuild -list -workspace YourApp.xcworkspace
# 5. If .xcodeproj exists, use: xcodebuild -list -project YourApp.xcodeproj
# Clean everything (use the actual scheme name from above)
xcodebuild clean -scheme <ACTUAL_SCHEME_NAME>
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf .build/ build/
# Rebuild with appropriate destination
xcodebuild build -scheme <ACTUAL_SCHEME_NAME> \
-destination 'platform=iOS Simulator,name=iPhone 16'
```
**CRITICAL**:
- Use the actual scheme name from `xcodebuild -list`, not a placeholder
- If `xcodebuild -list` fails, verify you're in the correct directory with a workspace/project file
### 3. For SPM Cache Issues / "No such module" with Swift Packages
If user reports "No such module" with Swift Package Manager dependencies OR packages won't resolve:
```bash
# Clean SPM cache (this fixes 90% of SPM issues)
rm -rf ~/Library/Caches/org.swift.swiftpm/
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf .build/
# Reset package resolution
xcodebuild -resolvePackageDependencies -scheme <ACTUAL_SCHEME_NAME>
# Verify packages resolved
xcodebuild -list
# Rebuild
xcodebuild build -scheme <ACTUAL_SCHEME_NAME> \
-destination 'platform=iOS Simulator,name=iPhone 16'
```
**When to use this**:
- "No such module" errors for Swift Package dependencies
- Package resolution failures
- "Package.resolved" conflicts
- After switching git branches with different package versions
### 4. For Simulator Issues
If user reports "UnaRelated in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.