pfw-spm

Modify Package.swift to add platforms, products, dependencies, targets, and macros.

16|2|Updated Mar 29, 2018
One-click install
npx skills add https://github.com/khoi/dotfiles --skill pfw-spm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pfw-spm
Source: https://github.com/khoi/dotfiles/tree/main/chezmoi/dot_pfw/skills/spm
Command: npx skills add https://github.com/khoi/dotfiles --skill pfw-spm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Efficiently configure and extend Package.swift for Swift packages, eliminating repetitive manual edits and ensuring consistency across platforms, products, and targets.

Core Features & Use Cases

  • Add platforms to Package.swift to target required OS versions.
  • Add products and dependencies to the package and individual targets.
  • Add new targets (including test targets) and macro targets for advanced builds.
  • Integrate with Xcode projects and workspaces to streamline development.

Quick Start

Provide your current Package.swift and let the skill propose and apply the necessary edits.

Frequently Asked Questions about pfw-spm

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add new dependencies and targets to a Swift Package.swift file?

To add dependencies and targets to a Swift Package.swift file, you apply guided edits that define new products, link dependencies, and configure test or macro targets for your SPM package. This ensures safe syntax verification for macOS and Xcode integration.

What is the best way to configure platform constraints in Swift Package Manager?

Configuring platform constraints in Swift Package Manager requires modifying Package.swift to specify required OS versions. By applying safe edits to the manifest, you ensure your Swift package accurately targets the intended platforms without syntax errors.

Can I use Swift macros in my Xcode workspace with SPM?

Yes, you can use Swift macros in an Xcode workspace by adding macro targets to your Package.swift. This SPM configuration integrates advanced macro builds directly into your Xcode projects and workspaces for streamlined development.

Does editing Package.swift manually break Xcode workspace integration?

Editing Package.swift manually risks breaking Xcode workspace integration if syntax is invalid. Applying verified, safe edits to platforms, products, and dependencies ensures your Swift package remains consistent and correctly integrated with Xcode.

How do I add a new executable product to my Swift package?

To add a new executable product to your Swift package, you modify the products definition in Package.swift. This guided edit configures the SPM manifest to expose the new product and link it to the appropriate targets.