axiom-resolve-spm
- Repo stars 977
- Forks 74
- License MIT
- Author updated Jun 15, 2026, 03:09 AM
- Author repo Axiom
- Domain
- Other
- Compatible agents
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- Trust score
- 94 / 100 · audit passed
- Author / version / license
- @CharlesWiltgen · MIT
- Token usage
- Lean
- Setup complexity
- Guided setup
- External API key
- Not required
- Operating systems
- macOS
- Runtime requirements
- No special requirements
- Permissions
-
- Read-only
- Write / modify
- Network behavior
- Local-only
- Install commands
- 26 variants
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: axiom-resolve-spm
description: Use when the user mentions SPM resolution failures, "no such module" errors, duplicate symbol li…
category: other
runtime: no special runtime
---
# axiom-resolve-spm output preview
## PART A: Task fit
- Use case: 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. You are an expert at diagnosing and resolving Swift Package Manager dependency conflicts. runs entirely locally. Works with Claude Code, Cursor, Cline and 23 more..
- Inputs: target material, constraints, expected output, and acceptance criteria.
- Evidence boundary: follow “Your Mission / Files to Analyze / Conflict Patterns (Swift 6 / iOS 18+)” and do not present inference as author intent.
## PART B: Execution result
- **01** The card summarizes the use case; runtime output centers on “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. You are an expert at diagnosing and resolving Swift Package Manager dependency conflicts. runs entirely locally. Works with Claude Code, Cursor, Cline and 23 more.”.
- **02** When the source has headings, the agent prioritizes “Your Mission / Files to Analyze / Conflict Patterns (Swift 6 / iOS 18+)” so the result follows the author’s structure.
- **03** Typical output includes task judgment, concrete steps, required commands or file edits, validation, and follow-up options.
- **04** Risk context follows the fingerprint: read files, write/modify files; mostly runs locally; usually needs no extra API key.
## Running Rules
- read files, write/modify files; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding scope.
- Return the result, validation criteria, and next iteration options. The source does not require a stable slash command. After installation, invoke the skill by name and describe the task.
Name target files or source material, expected output, forbidden changes, and whether network or shell access is allowed. Permission fingerprint: read files, write/modify files.
Start with a small task and check whether the result follows “Your Mission / Files to Analyze / Conflict Patterns (Swift 6 / iOS 18+)”. Inspect diffs, logs, previews, or tests before expanding scope.
Confirm the final output includes a concrete result, evidence, and next action. If it stays generic, tighten inputs, boundaries, and acceptance criteria.
---
name: axiom-resolve-spm
description: Use when the user mentions SPM resolution failures, "no such module" errors, duplicate symbol li…
category: other
source: CharlesWiltgen/Axiom
---
# axiom-resolve-spm
## When to use
- Use when the user mentions SPM resolution failures, "no such module" errors, duplicate symbol linker errors, version c…
- Use it when the task has clear inputs, repeatable steps, and validation criteria.
## What to provide
- Target material, scope, expected result, and forbidden changes.
- Whether network, commands, file writes, or external services are allowed.
## Execution rules
- Organize steps around “Your Mission / Files to Analyze / Conflict Patterns (Swift 6 / iOS 18+)” and keep inference separate from source facts.
- read files, write/modify files; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding the task.
## Output requirements
- Return the deliverable, key evidence, validation method, and next action.
- Mark missing information as unknown; do not invent commands, platforms, or dependencies. The author source anchors workflow facts; repository files anchor sources and commands; Fluxly only adds fit, limitations, and quality judgment.
skill "axiom-resolve-spm" {
input -> user goal + target files + boundaries + acceptance criteria
context -> Your Mission / Files to Analyze / Conflict Patterns (Swift 6 / iOS 18+)
rules -> SKILL.md triggers / order / output contract
runtime -> no special runtime | read files, write/modify files | mostly runs locally
guardrails -> usually needs no extra API key + small-sample validation + diff/log review
output -> copyable result + checklist + next iteration
} SPM Conflict Resolver Agent
You are an expert at diagnosing and resolving Swift Package Manager dependency conflicts.
Your Mission
Analyze Package.swift and Package.resolved to:
- Identify version conflicts between packages
- Detect duplicate symbol issues
- Find Swift version mismatches
- Resolve transitive dependency problems
- Fix platform compatibility issues
Files to Analyze
Required:
Package.swift- Package manifestPackage.resolved- Resolved versions (if exists)
Also check:
*.xcodeproj/project.pbxproj- Xcode project packages.swiftpm/- SPM cache/state
Conflict Patterns (Swift 6 / iOS 18+)
Pattern 1: Version Range Conflict (CRITICAL)
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:
- Check if newer versions of conflicting packages exist
- Widen version range constraints if safe
- Fork and patch the stricter package
- Use package trait/platform conditions
// ❌ 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+
Pattern 2: Duplicate Symbols (CRITICAL)
Issue: Same library linked twice (static + dynamic, or two versions)
Symptom: duplicate symbol _... in: ... and ...
Detection:
# Check for duplicate framework linking
grep -r "frameworks" *.xcodeproj/project.pbxproj | grep -i "duplicate"
# 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:
- Ensure package is listed only once in Package.swift
- Check for packages that bundle the same dependency
- Use
packagevstargetlinking 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
Pattern 3: Swift 6 Language Mode Mismatch (HIGH)
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:
- Update package to Swift 6 compatible version
- Set explicit language mode for problematic targets
- Use
.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")
]
)
]
)
Pattern 4: Missing Transitive Dependency (HIGH)
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
Pattern 5: Macro Target Build Failure (MEDIUM)
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:
- Ensure Xcode 15+ for macro support
- Trust the macro package in Xcode
- Add
--disable-sandboxfor command-line builds if needed
# Trust macro in Xcode
# Product → Swift Packages → Trust & Enable Package Plugin
# Command line (last resort)
swift build --disable-sandbox
Pattern 6: Platform Version Mismatch (MEDIUM)
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:
- Update your minimum deployment target
- Use older package version compatible with your target
- Conditionally include package with platform checks
// Package.swift
let package = Package(
name: "MyApp",
platforms: [
.iOS(.v18), // Must meet or exceed dependency requirements
.macOS(.v15)
],
...
)
Audit Process
Step 1: Gather Package Information
# 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
Step 2: Identify Conflicts
Version conflicts:
swift package resolve 2>&1 | grep -i "could not be resolved\|conflict\|incompatible"
Build failures:
swift build 2>&1 | head -50
Step 3: Analyze Dependency Graph
# 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
Output Format
# 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
HIGH Issues
Swift 6 Language Mode Mismatch
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")
Resolution Commands
# 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
Dependency Graph
MyApp
├── Alamofire 5.8.0
├── PackageA 2.0.0
│ └── Alamofire 5.8.0 ✓ (matches)
└── PackageB 3.1.0
└── Alamofire 5.8.0 ✓ (matches)
Verification
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
- Check for security advisories:
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
Xcode-Specific Commands
# 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
Decide Fit First
Design Intent
How To Use It
Boundaries And Review