axiom-accessibility
Use when fixing or auditing ANY accessibility issue — VoiceOver, Dynamic Type, color contrast, touch targets, WCAG compliance, App Store accessibility review.
Use when the user mentions Xcode build failures, build errors, or environment issues.
$ npx -y skills add charleswiltgen/axiom --skill axiom-fix-build --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/axiom-fix-buildContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when the user mentions Xcode build failures, build errors, or environment issues.
name: axiom-fix-build description: Use when the user mentions Xcode build failures, build errors, or environment issues. license: MIT
> **Note:** This audit may use Bash commands to run builds, tests, or CLI tools.
You are an expert at diagnosing and fixing Xcode build failures using **environment-first diagnostics**.
**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.
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
**ALWAYS run these diagnostic commands FIRST** before any investigation:
# 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}'**Clean environment** (probably a code issue):
**Environment problem** (apply fixes below):
If user mentions ANY of these, it's definitely an environment issue:
Whenever you run a build or test — to reproduce the failure or to verify a fix — **build to a result bundle and read the structured diagnostics**, not the raw `xcodebuild` output. A failing build floods the context with ~25K tokens of raw log; `xcrun xcresulttool` returns the same errors (file, line, column, message), de-duplicated, in ~500 tokens.
# Stamp the bundle AND its log together, so a later verify-build doesn't overwrite them. STAMP=$(date +%s) RESULT="/tmp/fix-build-$STAMP.xcresult" LOG="/tmp/fix-build-$STAMP.log" # Redirect to a file — never pipe xcodebuild (a pipe orphans the build if interrupted; # see iOS-9). Let the build finish, then read the bundle whether it SUCCEEDED or FAILED — # a failed build still writes its diagnostics to the bundle. xcodebuild build -scheme <ACTUAL_SCHEME_NAME> \ -destination 'platform=iOS Simulator,name=iPhone 16' \ -resultBundlePath "$RESULT" \ > "$LOG" 2>&1 # Read the distilled errors (each compiler error once, with its source location): xcrun xcresulttool get build-results --compact --path "$RESULT"
For `xcodebuild test` runs, read failures from the bundle with `xcrun xcresulttool get test-results summary --path "$RESULT"` — `test-results` takes a sub-command (`summary`, `tests`, …) and has no `--compact`; the `test-runner` agent has the full recipe.
**Fallback**: if the bundle is missing/malformed (or `xcrun xcresulttool get build-results` errors — it needs Xcode 16+, which is below Axiom's supported floor, so it should always be present), read the redirected log `"$LOG"` and grep it for `error:` lines. Grepping the saved file is safe; piping `xcodebuild` itself is not.
Result bundles are disposable — `rm -rf "$RESULT" "$LOG"` once you've extracted what you need.
When running in CI/CD environments, some diagnostics don't apply and fixes need adjustment.
Check for environment variables that indicate CI/CD:
# 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**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:**
**CI/CD-Specific Fixes:**
# 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 (capture to a result bundle; read errors per "Running Builds") xcodebuild clean build -scheme <ACTUAL_SCHEME_NAME> \ -destination 'platform=iOS Simulator,name=iPhone 16' \ -allowProvisioningUpdates \ -resultBundlePath /tmp
Battle-tested skills, agents, and tools for modern Apple OS development — Swift 6, SwiftUI, Liquid Glass, Apple Intelligence, and more. Supports Claude Code, Codex, and all other popular coding harnesses and AI-savvy IDEs.
Repo: charleswiltgen/axiom
Use when fixing or auditing ANY accessibility issue — VoiceOver, Dynamic Type, color contrast, touch targets, WCAG compliance, App Store accessibility review.
Use when implementing, testing, or evaluating ANY Apple Intelligence, on-device AI, or speech-to-text feature. Covers Foundation Models, @Generable,…
Use when the user has a crash log (.ips, MetricKit JSON, legacy .crash text, .xccrashpoint bundle, or pasted text) that needs analysis.
Use when the user mentions Swift performance audit, code optimization, or performance review — ARC issues, allocation patterns, and generic specialization.
Use when the user mentions SwiftUI performance, janky scrolling, slow animations, or view update issues — expensive bodies, formatters, whole-collection…
Use when the user mentions flaky tests, tests that pass locally but fail in CI, race conditions in tests, or needs to diagnose WHY a specific test fails.