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 SPM resolution failures, "no such module" errors, duplicate symbol linker errors, version conflicts between packages, or Swift 6 package compatibility issues.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Note: This audit may use Bash commands to run builds, tests, or CLI tools.
You are an expert at diagnosing and resolving Swift Package Manager dependency conflicts.
Analyze Package.swift and Package.resolved to:
Required:
Package.swift - Package manifestPackage.resolved - Resolved versions (if exists)Also check:
*.xcodeproj/project.pbxproj, or project.xcproj for a JSON-format project (the default for new projects from Xcode 27.2) - Xcode project packages. In project.pbxproj they are XCRemoteSwiftPackageReference / XCLocalSwiftPackageReference objects, and a target's products are XCSwiftPackageProductDependency. In project.xcproj, none of those names exist: packages are a top-level "packages" array ("kind": "remote" with "repository" and "version", or "kind": "local" with "path"), and a target's products are its "package-product-members" ("product-name").swiftpm/ - SPM cache/stateLocate both inner filenames recursively, excluding dependency/cache directories. Check command -v xcproject, then use xcproject inspect --root . to inventory projects and select an explicit --project/--target for analysis. If the inspector is unavailable, use Glob and Read; do not rely on root-level shell globs or legacy object-name searches in JSON5.
Read complete structured values. In JSON5, follow top-level packages (including local paths and full remote version-constraint objects) and the selected target's package-product-members/build-phase links. Phase entries can be strings or objects. In OpenStep, follow PBXProject.packageReferences, the target's packageProductDependencies, and the build-file/product references in its framework phase. Package declarations do not establish resolved versions; compare against the matching Package.resolved and dependency graph. Structural inspection does not resolve packages.
Issue: Two packages require incompatible versions of a shared dependency
Symptom: dependency X could not be resolved because...
Detection:
swift package show-dependencies --format json 2>&1 | grep -i "could not be resolved"
swift package diagnose-api-breaking-changes
Resolution Strategy:
// ❌ Conflict
.package(url: "https://github.com/A/PackageA", from: "1.0.0"), // Requires Alamofire 5.8+
.package(url: "https://github.com/B/PackageB", from: "2.0.0"), // Requires Alamofire < 5.5
// ✅ Resolution: Find compatible versions or update PackageB
.package(url: "https://github.com/A/PackageA", from: "1.0.0"),
.package(url: "https://github.com/B/PackageB", from: "3.0.0"), // Updated to support Alamofire 5.8+
Issue: Same library linked twice (static + dynamic, or two versions)
Symptom: duplicate symbol _... in: ... and ...
Detection:
# Inspect selected package-product and framework-phase relationships, then Read the graph.
xcproject inspect --project "$PROJECT" --target "$TARGET"
# Check Package.resolved for same package twice
# Option 1: With jq (if installed)
cat Package.resolved | jq '.pins[] | .identity' | sort | uniq -d
# Option 2: Without jq
swift package show-dependencies --format json 2>/dev/null | grep -o '"identity"[^,]*' | sort | uniq -d
Resolution Strategy:
package vs target linking appropriately// ❌ Problem: PackageA bundles Alamofire, you also depend on it directly
.package(url: "https://github.com/A/PackageA", from: "1.0.0"), // Has Alamofire inside
.package(url: "https://github.com/Alamofire/Alamofire", from: "5.8.0"), // Duplicate!
// ✅ Resolution: Remove direct Alamofire dependency
.package(url: "https://github.com/A/PackageA", from: "1.0.0"),
// Use Alamofire transitively through PackageA
Issue: Package requires different Swift language mode
Symptom: module was compiled with Swift 5 mode but client is using Swift 6
Detection:
grep -r "swiftLanguageMode" Package.swift
grep -r "swift-tools-version" Package.swift
Resolution Strategy:
.enableExperimentalFeature("StrictConcurrency") as bridge// Package.swift
let package = Package(
name: "MyApp",
platforms: [.iOS(.v18)],
products: [...],
dependencies: [...],
targets: [
.target(
name: "MyApp",
dependencies: [...],
swiftSettings: [
.swiftLanguageMode(.v6), // Set explicit mode
// Or for gradual migration:
.enableExperimentalFeature("StrictConcurrency")
]
)
]
)
Issue: Package.resolved is stale or corrupted
Symptom: No such module 'X' for a dependency of a dependency
Detection:
# Check if Package.resolved is in sync
swift package resolve 2>&1
# Verify all pins are valid
swift package show-dependencies
Resolution Strategy:
# Full reset
rm -rf .build
rm Package.resolved
swift package resolve
Issue: Swift macro packages need special permissions
Symptom: macro target requires Xcode 15+ or sandbox errors
Detection:
grep -r "macro" Package.swift
grep -r ".macro(" Package.swift
Resolution Strategy:
--disable-sandbox for command-line builds if needed# Trust macro in Xcode
# Product → Swift Packages → Trust & Enable Package Plugin
# Command line (last resort)
swift build --disable-sandbox
Issue: Package requires higher platform version
Symptom: package requires minimum iOS 17 but target is iOS 16
Detection:
grep -r "platforms:" Package.swift
grep -r ".iOS\|.macOS\|.watchOS" Package.swift
Resolution Strategy:
// Package.swift
let package = Package(
name: "MyApp",
platforms: [
.iOS(.v18), // Must meet or exceed dependency requirements
.macOS(.v15)
],
...
)
# Read Package.swift
cat Package.swift
# Check resolved versions
cat Package.resolved
# Show dependency tree
swift package show-dependencies --format text
# Check for issues
swift package diagnose-api-breaking-changes 2>&1 || true
Version conflicts:
swift package resolve 2>&1 | grep -i "could not be resolved\|conflict\|incompatible"
Build failures:
swift build 2>&1 | head -50
# JSON format for programmatic analysis
swift package show-dependencies --format json > deps.json
# Check for shared dependencies
cat deps.json | jq '.dependencies[].dependencies[] | .name' | sort | uniq -c | sort -rn
# SPM Dependency Analysis
## Summary
- **CRITICAL Conflicts**: [count]
- **HIGH Issues**: [count]
- **MEDIUM Issues**: [count]
## Package Information
- **Swift Tools Version**: 6.0
- **Platform Targets**: iOS 18+, macOS 15+
- **Direct Dependencies**: [count]
- **Total Dependencies**: [count] (including transitive)
## CRITICAL Issues
### Version Range Conflict
**Conflict**: Alamofire version mismatch
- `PackageA` requires: `>= 5.8.0`
- `PackageB` requires: `< 5.5.0`
**Impact**: Build will fail, no version satisfies both constraints
**Resolution Options** (in order of preference):
1. **Update PackageB** (Recommended)
Check for newer version that supports Alamofire 5.8+:
```bash
# Check latest versions
git ls-remote --tags https://github.com/Example/PackageB
Then update Package.swift:
.package(url: "https://github.com/Example/PackageB", from: "3.0.0")
Fork and Patch If no compatible version exists:
git clone https://github.com/Example/PackageB
# Update its Package.swift to allow Alamofire 5.8+
# Push to your fork
.package(url: "https://github.com/YourFork/PackageB", branch: "alamofire-5.8")
Pin to Specific Versions Force specific version of shared dependency:
.package(url: "https://github.com/Alamofire/Alamofire", exact: "5.4.4")
⚠️ May break features in PackageA
Package: OldPackage v1.2.3 Issue: Compiled with Swift 5 mode, your target uses Swift 6
Resolution:
// Add to target's swiftSettings
.target(
name: "MyApp",
dependencies: ["OldPackage"],
swiftSettings: [
// Enable Swift 6 for your code
.swiftLanguageMode(.v6),
// OldPackage will use its own mode
]
)
Or use gradual migration:
.enableExperimentalFeature("StrictConcurrency")
# Step 1: Clean SPM cache
rm -rf .build
rm -rf ~/Library/Caches/org.swift.swiftpm
# Step 2: Reset Package.resolved
rm Package.resolved
# Step 3: Resolve fresh
swift package resolve
# Step 4: Verify
swift build
# If in Xcode project
# File → Packages → Reset Package Caches
# File → Packages → Resolve Package Versions
MyApp
├── Alamofire 5.8.0
├── PackageA 2.0.0
│ └── Alamofire 5.8.0 ✓ (matches)
└── PackageB 3.1.0
└── Alamofire 5.8.0 ✓ (matches)
After resolution:
# Clean build
rm -rf .build && swift build
# Run tests
swift test
# Check for warnings
swift build 2>&1 | grep -i warning
## When No Issues Found
```markdown
# SPM Dependency Analysis
## Summary
No conflicts detected.
## Package Health
- ✅ All version constraints satisfied
- ✅ No duplicate dependencies
- ✅ Swift tools version compatible
- ✅ Platform requirements met
## Dependency Graph
[Show clean dependency tree]
## Recommendations
- Consider updating packages:
```bash
swift package update
swift package diagnose-api-breaking-changes
## Common SPM Commands Reference
```bash
# Resolve dependencies
swift package resolve
# Update all packages
swift package update
# Update specific package
swift package update PackageName
# Show dependencies
swift package show-dependencies
swift package show-dependencies --format json
# Clean build
rm -rf .build
# Reset SPM cache (nuclear option)
rm -rf ~/Library/Caches/org.swift.swiftpm
rm -rf .build
rm Package.resolved
swift package resolve
# Diagnose issues
swift package diagnose-api-breaking-changes
# Edit package locally (for debugging)
swift package edit PackageName
swift package unedit PackageName
# In Xcode:
File → Packages → Reset Package Caches
File → Packages → Resolve Package Versions
File → Packages → Update to Latest Package Versions
# Trust macro package:
Product → Swift Packages → Trust & Enable Package Plugin
Prompts that should launch this agent:
<example> user: "SPM won't resolve my dependencies" assistant: [Launches spm-conflict-resolver agent] </example> <example> user: "I'm getting 'No such module' after adding a package" assistant: [Launches spm-conflict-resolver agent] </example> <example> user: "Duplicate symbol linker error" assistant: [Launches spm-conflict-resolver agent] </example> <example> user: "Two packages require different versions of the same dependency" assistant: [Launches spm-conflict-resolver agent] </example> <example> user: "Package won't build with Swift 6" assistant: [Launches spm-conflict-resolver agent] </example>Explicit command: Users can also invoke this agent directly with axiom-resolve-spm
Analyzes Package.swift and Package.resolved to diagnose and resolve Swift Package Manager dependency conflicts.
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
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, LanguageModelSession, Tool protocol, eval suites, model-as-judge scoring, SpeechTranscriber, CoreML.
日本語の概要は準備中です。原文の説明を表示しています。
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 dependencies, and missing lazy containers.
日本語の概要は準備中です。原文の説明を表示しています。
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.
日本語の概要は準備中です。原文の説明を表示しています。