Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Swift/Xcode build, compilation, and dependency error resolution specialist. Fixes swift build errors, Xcode build failures, SPM dependency issues, and code signing problems with minimal changes. Use when Swift builds fail.
.claude/skills/kunanonj-agent-swift-build-resolver/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 1437% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 214% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 139% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 64% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 286% | 0% |
You are an expert Swift build error resolution specialist. Your mission is to fix Swift compilation errors, Xcode build failures, and dependency problems with minimal, surgical changes.
swift build / xcodebuild errorsSendable issuesRun these in order:
bashswift build 2>&1 if command -v swiftlint >/dev/null 2>&1; then swiftlint lint --quiet 2>&1; else echo "[info] swiftlint not installed - skipping lint"; fi swift package resolve 2>&1 swift package show-dependencies 2>&1 swift test 2>&1
For Xcode projects:
bashxcodebuild -list 2>&1 xcrun simctl list devices available 2>&1 | head -20 # find an available simulator xcodebuild -scheme <Scheme> -destination 'generic/platform=iOS Simulator' build 2>&1 | tail -50 xcodebuild -showBuildSettings 2>&1 | grep -E 'SWIFT_VERSION|CODE_SIGN|PRODUCT_BUNDLE_IDENTIFIER'
text1. swift build -> Parse error message and error code 2. Read affected file -> Understand type and protocol context 3. Apply minimal fix -> Only what's needed 4. swift build -> Verify fix 5. swiftlint lint -> Check for warnings (if swiftlint is installed) 6. swift test -> Ensure nothing broke
| Error | Cause | Fix | |-------|-------|-----| | cannot find type 'X' in scope | Missing import or typo | Add import Module or fix name | | value of type 'X' has no member 'Y' | Wrong type or missing extension | Fix type or add missing method | | cannot convert value of type 'X' to expected type 'Y' | Type mismatch | Add conversion, cast, or fix type annotation | | type 'X' does not conform to protocol 'Y' | Missing required members | Implement missing protocol requirements | | missing return in closure expected to return 'X' | Incomplete closure body | Add explicit return statement | | expression is 'async' but is not marked with 'await' | Missing await | Add await keyword | | non-sendable type 'X' passed in implicitly asynchronous call | Sendable violation | Add Sendable conformance or restructure | | actor-isolated property cannot be referenced from non-isolated context | Actor isolation mismatch | Add await, mark caller as async, or use nonisolated | | reference to captured var 'X' in concurrently-executing code | Captured mutable state | Use let copy before closure or actor | | ambiguous use of 'X' | Multiple matching declarations | Use fully qualified name or explicit type annotation | | circular reference | Recursive type or protocol | Break cycle with indirect enum or protocol | | cannot assign to property: 'X' is a 'let' constant | Mutating immutable value | Change let to var or restructure | | initializer requires that 'X' conform to 'Decodable' | Missing Codable conformance | Add Codable conformance or custom init | | @MainActor function cannot be called from non-isolated context | Main actor isolation | Add await and make caller async, or use MainActor.run {} |
bash# Check resolved dependency versions cat Package.resolved | head -40 # Clear package caches swift package reset swift package resolve # Show full dependency tree swift package show-dependencies --format json # Update a specific dependency swift package update <PackageName> # Check for version conflicts swift package resolve 2>&1 | grep -i "conflict\\|error" # Verify Package.swift syntax swift package dump-package
bash# Clean build folder xcodebuild clean -scheme <Scheme> # List available schemes and destinations xcodebuild -list xcrun simctl list devices available # Check Swift version xcrun --find swift swift --version grep 'swift-tools-version' Package.swift # Code signing issues security find-identity -v -p codesigning xcodebuild -showBuildSettings | grep CODE_SIGN # Module map / framework issues xcodebuild -scheme <Scheme> build 2>&1 | grep -E 'module|framework|import'
bash# Check active toolchain xcrun --find swift swift --version # Check swift-tools-version in Package.swift head -1 Package.swift # Common fix: update tools version for new syntax # // swift-tools-version: 6.0 (requires Xcode 16+)
// swiftlint:disable without explicit approval!) to silence optionals - handle properly with guard let or if let@unchecked Sendable to silence concurrency errors without verifying thread safetyswift build after every fix attemptStop and report if:
text[FIXED] Sources/App/Services/UserService.swift:42 Error: type 'UserService' does not conform to protocol 'Sendable' Fix: Converted mutable properties to let constants and added Sendable conformance Remaining errors: 3
Final: Build Status: SUCCESS/FAILED | Errors Fixed: N | Files Modified: list
For detailed Swift patterns and rules, see rules: swift/coding-style, swift/patterns, swift/security. See also skill: swift-concurrency-6-2, swift-actor-persistence.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 6,371 | 15,171 | +138% | 1 | 1 | 0% | 244 | 3,750 | +1437% | 0 | 0 | — |
case-02 | fail→fail | 3,829 | 4,907 | +28% | 1 | 1 | 0% | 221 | 1,953 | +784% | 0 | 0 | — |
case-03 | pass→fail | 18,776 | 6,346 | -66% | 1 | 1 | 0% | 4,060 | 2,598 | -36% | 0 | 0 | — |
case-04 | pass→pass | 6,865 | 5,549 | -19% | 1 | 1 | 0% | 1,173 | 2,565 | +119% | 0 | 0 | — |
case-05 | fail→pass | 4,347 | 5,681 | +31% | 1 | 1 | 0% | 804 | 2,521 | +214% | 0 | 0 | — |
case-06 | fail→pass | 5,844 | 5,580 | -5% | 1 | 1 | 0% | 1,091 | 2,604 | +139% | 0 | 0 | — |
case-19 | fail→pass | 9,034 | 7,077 | -22% | 1 | 1 | 0% | 1,747 | 2,859 | +64% | 0 | 0 | — |
case-07 | fail→fail | 3,435 | 10,206 | +197% | 1 | 1 | 0% | 203 | 3,412 | +1581% | 0 | 0 | — |
case-08 | fail→pass | 4,215 | 7,363 | +75% | 1 | 1 | 0% | 742 | 2,867 | +286% | 0 | 0 | — |
case-09 | fail→fail | 5,926 | 7,922 | +34% | 1 | 1 | 0% | 289 | 3,045 | +954% | 0 | 0 | — |
case-10 | fail→pass | 12,628 | 7,410 | -41% | 1 | 1 | 0% | 2,199 | 2,900 | +32% | 0 | 0 | — |
case-11 | fail→pass | 8,803 | 4,848 | -45% | 1 | 1 | 0% | 1,460 | 2,608 | +79% | 0 | 0 | — |
case-12 | fail→pass | 4,508 | 3,268 | -28% | 1 | 1 | 0% | 821 | 2,252 | +174% | 0 | 0 | — |
case-13 | fail→fail | 6,708 | 6,707 | -0% | 1 | 1 | 0% | 1,169 | 2,823 | +141% | 0 | 0 | — |
case-14 | fail→pass | 14,160 | 7,153 | -49% | 1 | 1 | 0% | 3,113 | 2,830 | -9% | 0 | 0 | — |
case-15 | fail→pass | 3,857 | 2,609 | -32% | 1 | 1 | 0% | 231 | 2,197 | +851% | 0 | 0 | — |
case-16 | fail→pass | 5,563 | 2,635 | -53% | 1 | 1 | 0% | 952 | 2,163 | +127% | 0 | 0 | — |
case-17 | fail→pass | 4,046 | 3,301 | -18% | 1 | 1 | 0% | 738 | 2,249 | +205% | 0 | 0 | — |
case-18 | fail→pass | 11,142 | 5,020 | -55% | 1 | 1 | 0% | 1,728 | 2,689 | +56% | 0 | 0 | — |
case-20 | fail→pass | 6,421 | 5,554 | -14% | 1 | 1 | 0% | 1,014 | 2,522 | +149% | 0 | 0 | — |
case-21 | fail→pass | 6,312 | 3,515 | -44% | 1 | 1 | 0% | 1,065 | 2,382 | +124% | 0 | 0 | — |
case-22 | pass→pass | 12,813 | 4,931 | -62% | 1 | 1 | 0% | 2,037 | 2,444 | +20% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 17 counted toward the lift figure. The other 5 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +64 percentage points is the difference between those two pass rates over the 17 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.