xcode-build-fix

A command for fixing Swift compiler and Xcode build errors step by step. Xcode is Apple's app-development tool, and a build checks whether the project's code can be compiled.

In plain words
What is it for?
Use it to diagnose errors in an Xcode project or Swift Package, fix issues such as Swift 6 concurrency and type errors, and review remaining errors, warnings, or new problems.
Why use it?
It groups and explains build errors, applies proposed fixes, and rebuilds the project to check whether the errors are gone.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/okminlee/everything-claude-code-ios/xcode-build-fix
Clone the repo
git clone --depth 1 https://github.com/OkminLee/everything-claude-code-ios
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,130 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00023 $0.01130
Opus 5 $0.00012 $0.00565
Sonnet 5 $0.00005 $0.00226
Haiku 4.5 $0.00002 $0.00113

Measured 2d ago against content hash 551cf5ae9095, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

xcode-build-fix scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/xcode-build-fix.md · 197 lines

How it starts

The opening of the file, as written. The whole thing — 197 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Xcode Build Fix

Incrementally fix Swift compiler and Xcode build errors.

This command invokes the xcode-build-resolver agent.

Process

  1. Run build:

    xcodebuild build \
      -scheme MyApp \
      -destination 'platform=iOS Simulator,name=iPhone 16' \
      2>&1 | xcpretty
    

    Or for SPM:

    swift build 2>&1
    
  2. Parse error output:

    • Group by file
    • Sort by severity (error > warning)
    • Identify error patterns
  3. For each error:

    • Show error context (5 lines before/after)
    • Explain the issue
    • Propose fix
    • Apply fix
    • Re-run build
    • Verify error resolved
  4. Stop if:

    • Fix introduces new errors
    • Same error persists after 3 attempts
    • User requests pause
    • Circular dependency detected
  5. Show summary:

    • Errors fixed
    • Errors remaining
    • New errors introduced
    • Warnings to address

Common Error Patterns

Swift 6 Concurrency

error: sending 'self.data' risks causing data races

Fix: Add @MainActor, use actor, or make type Sendable

error: call to main actor-isolated method cannot be made from nonisolated context

Fix: Add await MainActor.run { } or mark caller @MainActor

Type Errors

error: cannot convert value of type 'X' to expected argument type 'Y'

Fix: Check type compatibility, add conversion, or fix generic constraints

error: value of optional type 'X?' must be unwrapped

Fix: Add guard let, if let, or nil-coalescing ??

Module/Import Errors

error: no such module 'ModuleName'

Fix: Check SPM dependencies, pod install, or Framework search paths

error: cannot find 'TypeName' in scope

Fix: Add import statement or check access level

Xcode Project Issues

error: multiple commands produce 'X'

Fix: Check duplicate file references in Build Phases

error: provisioning profile doesn't match

Fix: Update signing settings in Signing & Capabilities

Read the full file on GitHub · 197 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 197 lines · 23 tokens per session scan A 551cf5ae9095

Subscribe to this mod's changes

xcode-build-fix is a command published in the GitHub repository OkminLee/everything-claude-code-ios (58 stars, last pushed 5mo ago), licensed MIT. It adds 23 tokens to every session and 1,130 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.