Axiom Resolve Spm 标志

Axiom Resolve Spm

社区热门
CharlesWiltgen
axiom-resolve-spm

当用户提到 SPM 解析失败、“no such module”错误、重复符号链接器错误、软件包版本冲突,或 Swift 6 软件包兼容性问题时使用。

Add to TypingMind

概览

发布者CharlesWiltgen
代码仓库Axiom
技能名称axiom-resolve-spm
星标数
1.2K
复刻数
86
附带文件
1
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 1 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 CharlesWiltgen 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Axiom Resolve Spm AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/CharlesWiltgen/Axiom/tree/main/axiom-codex/skills/axiom-resolve-spm
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/CharlesWiltgen/Axiom.git /tmp/Axiom
mkdir -p .claude/skills
cp -r /tmp/Axiom/axiom-codex/skills/axiom-resolve-spm .claude/skills/axiom-resolve-spm
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Axiom Resolve Spm,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Axiom Resolve Spm。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Axiom Resolve Spm 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Note: This audit may use Bash commands to run builds, tests, or CLI tools.

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 manifest
  • Package.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/state

Project Package Relationships

Locate 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.

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:

bash
swift package show-dependencies --format json 2>&1 | grep -i "could not be resolved"
swift package diagnose-api-breaking-changes

Resolution Strategy:

  1. Check if newer versions of conflicting packages exist
  2. Widen version range constraints if safe
  3. Fork and patch the stricter package
  4. Use package trait/platform conditions
swift
// ❌ 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:

bash
# 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:

  1. Ensure package is listed only once in Package.swift
  2. Check for packages that bundle the same dependency
  3. Use package vs target linking appropriately
swift
// ❌ 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:

bash
grep -r "swiftLanguageMode" Package.swift
grep -r "swift-tools-version" Package.swift

Resolution Strategy:

  1. Update package to Swift 6 compatible version
  2. Set explicit language mode for problematic targets
  3. Use .enableExperimentalFeature("StrictConcurrency") as bridge
swift
// 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:

bash
# Check if Package.resolved is in sync
swift package resolve 2>&1

# Verify all pins are valid
swift package show-dependencies

Resolution Strategy:

bash
# 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:

bash
grep -r "macro" Package.swift
grep -r ".macro(" Package.swift

Resolution Strategy:

  1. Ensure Xcode 15+ for macro support
  2. Trust the macro package in Xcode
  3. Add --disable-sandbox for command-line builds if needed
bash
# 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:

bash
grep -r "platforms:" Package.swift
grep -r ".iOS\|.macOS\|.watchOS" Package.swift

Resolution Strategy:

  1. Update your minimum deployment target
  2. Use older package version compatible with your target
  3. Conditionally include package with platform checks
swift
// 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

bash
# 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:

bash
swift package resolve 2>&1 | grep -i "could not be resolved\|conflict\|incompatible"

Build failures:

bash
swift build 2>&1 | head -50

Step 3: Analyze Dependency Graph

bash
# 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

markdown
# 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:

swift
.package(url: "https://github.com/Example/PackageB", from: "3.0.0")
  1. Fork and Patch If no compatible version exists:

    bash
    git clone https://github.com/Example/PackageB
    # Update its Package.swift to allow Alamofire 5.8+
    # Push to your fork
    swift
    .package(url: "https://github.com/YourFork/PackageB", branch: "alamofire-5.8")
  2. Pin to Specific Versions Force specific version of shared dependency:

    swift
    .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:

swift
// 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:

swift
.enableExperimentalFeature("StrictConcurrency")

Resolution Commands

bash
# 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:

bash
# 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:
    bash
    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

Invocation Examples

Prompts that should launch this agent:

Explicit command: Users can also invoke this agent directly with axiom-resolve-spm

Scope

Analyzes Package.swift and Package.resolved to diagnose and resolve Swift Package Manager dependency conflicts.

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Axiom Resolve Spm AI 技能有什么作用?

当用户提到 SPM 解析失败、“no such module”错误、重复符号链接器错误、软件包版本冲突,或 Swift 6 软件包兼容性问题时使用。

为什么在 TypingMind 中使用 Axiom Resolve Spm?

因为您只需安装一次,就能搭配任何模型使用。Axiom Resolve Spm 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Axiom Resolve Spm?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/CharlesWiltgen/Axiom/tree/main/axiom-codex/skills/axiom-resolve-spm。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Axiom Resolve Spm?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Axiom Resolve Spm 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Axiom Resolve Spm 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Axiom Resolve Spm AI 技能免费吗?

是的。CharlesWiltgen 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇