Swift package extension workflow
Skill gaelic-ghost/socket/plugins/apple-dev-skills/skills/swift-package-extension-workflow
Plan and validate SwiftPM build or command plugins, macros, package traits, generated sources, permissions, and Xcode handoffs. Use for Package.swift extension work or Swiftly/Xcode capability differences.From its SKILL.md
npx -y skills add gaelic-ghost/socket --skill swift-package-extension-workflowAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 6 stars6 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
7.2 KB, ~1.5k tokens by cl100k_base, as published. Nobody here has run it
Swift Package Extension Workflow
Purpose
Own SwiftPM extension work that does not belong in ordinary package build/run or testing workflows. Keep package plugins, macros, traits, generated-source policy, permission review, and toolchain comparison in one package-first path, then hand off when Xcode-managed project context becomes authoritative.
When To Use
- Use this skill for build tool plugins, command plugins, plugin products, target plugin usage, and plugin commands.
- Use this skill for macro targets, macro declaration/implementation boundaries, expansion inspection, diagnostics, and macro tests.
- Use this skill for package traits, default traits, optional dependencies, conditional compilation, and trait-aware build/test matrices.
- Use this skill for generated sources, generated build products, plugin sandboxing, write access, or network permissions.
- Use this skill when the Swiftly-selected toolchain and Xcode-selected toolchain may differ.
- Recommend
swift-package-build-run-workflowfor ordinary manifests, dependencies, resources, builds, and executable runs. - Recommend
swift-package-testing-workflowwhen ordinary test organization or failure diagnosis is primary. - Recommend
format-swift-sourcesfor formatter-specific plugin operation after this skill establishes plugin permissions and ownership. - Recommend
xcode-build-run-workfloworxcode-testing-workflowwhen schemes, destinations, app hosts, Xcode project context, or Xcode-only evidence controls the result. - Recommend
explore-apple-swift-docswhen the task is documentation lookup rather than package mutation or execution.
Single-Path Workflow
- Inspect
Package.swift,Plugins/, macro targets, generated outputs, test targets, and any Xcode project or workspace markers. - Establish both toolchain identities before planning commands:
- Swiftly path:
swiftly use --print-location,swift --version, and relevantswift package,swift build, orswift testhelp. - Xcode path:
xcode-select -p,xcrun --find swift,xcrun swift --version, and matchingxcrun swift package, build, or test help. - If Swiftly is set to
xcode, record that bridge explicitly instead of presenting the two command paths as independent compiler distributions. - Do not assume the two toolchains expose identical SwiftPM commands, flags, manifest APIs, macro support, or plugin behavior.
- Swiftly path:
- Read the relevant official SwiftPM, Swift Evolution, or Apple/Xcode documentation and state the behavior relied on before editing.
- Classify the primary extension concern as
build-tool-plugin,command-plugin,macro,traits, orgenerated-source. - Run
scripts/run_workflow.pyfor repo-shape inspection and a non-mutating command plan. - Load only the reference needed for the selected concern:
- plugins:
references/package-plugins-build-command-and-xcode.md - permissions:
references/plugin-permissions-sandbox-and-outputs.md - macros:
references/swift-macros-package-shape.md - traits:
references/package-traits-feature-flags.md - generated files:
references/generated-source-and-build-products.md
- plugins:
- Use
references/cli-command-matrix.mdto keep Swiftly and Xcode commands distinct. - Apply
references/xcode-handoff-conditions.mdbefore using Xcode-managed execution or changing Xcode-owned project state. - Validate the smallest relevant matrix first, then the supported Swift minor window and both host toolchains when the package claims both.
- Report the manifest/API floor, selected toolchain, commands run, generated or permission-sensitive outputs, and any handoff.
Inputs
extension_type:build-tool-plugin,command-plugin,macro,traits, orgenerated-source.request: optional natural-language request used to inferextension_type.repo_root: package path; defaults to the current directory.toolchain_scope:swiftly,xcode, orboth; defaults tobothfor Apple ecosystem compatibility work.mixed_root_opt_in: allow package-first planning when Xcode markers share the package root.
Outputs
status:success,handoff, orblocked.path_type:primaryorfallback.output: extension type, repo shape, toolchain scope, planned commands, evidence requirements, and one next step.
Guards and Stop Conditions
- Stop when the package root or
Package.swiftcannot be resolved. - Stop before raising the tools-version or manifest API floor without confirming the package support window.
- Keep beta or snapshot toolchain evidence separate from the latest-stable-plus-previous-stable support promise.
- Do not treat
swift --versionas evidence for the Xcode toolchain; inspectxcrun swift --versionseparately. - Do not disable the plugin sandbox as a routine workaround. Name the required capability and grant the narrowest permission.
- Do not let build tool plugins modify package sources; generate into plugin-controlled build output locations.
- Do not check in derived output merely to hide a nondeterministic generator.
- Do not use traits to remove API when enabled; design traits as additive feature choices.
- Stop with a handoff when Xcode project context, scheme/destination state, app-hosted execution, or project membership determines correctness.
Fallbacks and Handoffs
- Fall back to a command plan when execution would mutate the package or request permissions the user did not authorize.
- Hand ordinary package execution to
swift-package-build-run-workflowafter extension shape and flags are settled. - Hand ordinary test diagnosis to
swift-package-testing-workflow; retain ownership of macro/plugin test shape and trait matrices. - Hand Xcode-managed builds to
xcode-build-run-workflowand Xcode-native tests toxcode-testing-workflowwith the exact package, plugin, macro, trait, scheme, and destination context. - Use
format-swift-sourcesfor formatter-specific behavior without duplicating the general plugin permission model.
Customization
- Use
references/customization.template.yamlandreferences/customization-flow.md. scripts/customization_config.pystores and reports customization state.- The workflow currently keeps fixed package-first and least-permission defaults.
References
Workflow References
references/package-plugins-build-command-and-xcode.mdreferences/plugin-permissions-sandbox-and-outputs.mdreferences/swift-macros-package-shape.mdreferences/package-traits-feature-flags.mdreferences/generated-source-and-build-products.mdreferences/xcode-handoff-conditions.mdreferences/cli-command-matrix.md
Contract References
references/customization.template.yamlreferences/customization-flow.md
Support References
- Recommend
references/snippets/apple-swift-package-core.mdwhen reusable package policy is needed in an end-user repo. references/snippets/apple-swift-package-core.md
Script Inventory
scripts/run_workflow.pyscripts/customization_config.py
What ships with it: 13 files
38.8 KB alongside SKILL.md, 2 of them executable
agents/
- openai.yaml228 B
references/
- cli-command-matrix.md1.8 KB
- customization-flow.md787 B
- customization.template.yaml50 B
- generated-source-and-build-products.md1.2 KB
- package-plugins-build-command-and-xcode.md2.1 KB
- package-traits-feature-flags.md1.3 KB
- plugin-permissions-sandbox-and-outputs.md1.5 KB
- snippets/apple-swift-package-core.md14.7 KB
- swift-macros-package-shape.md1.3 KB
- xcode-handoff-conditions.md1.1 KB
scripts/
- customization_config.pyruns6.2 KB
- run_workflow.pyruns6.6 KB