Setup Swift Library
| This documentation was generated with the assistance of AI. Please report any inaccuracies. |
Generate the standard Swift Package Manager library toolchain at the repository root — Package.swift, the
Sources/<Name>/ and Tests/<Name>Tests/ layout, .swiftlint.yml, a formatter config, a DocC catalog page, and,
when opted in, .spi.yml and sonar-project.properties.
Purpose
iru-setup-swift-library bootstraps a new Swift/SwiftPM library from an explicit, genericized house template
embedded in the skill itself. It announces up front whether it is creating the package from scratch or updating an
existing one, and for every file of its own that already exists it warns and asks Update / Keep as is / Replace /
Stop (or applies on-existing from args). Every file starts from swift package init --type library’s own scaffold, then this
skill rewrites it: `Package.swift gets // swift-tools-version: 6.0, a platforms: array derived from the
selected Apple platforms, a swift-docc-plugin dependency, and swiftLanguageModes: [.v6]; Sources/<Name>/
gets a placeholder Sendable type; Tests/<Name>Tests/ gets both a Swift Testing @Test example and an XCTest
example; and .swiftlint.yml, a .swift-format/.swiftformat config, and a DocC catalog page round out the
toolchain. It is the Swift/Apple equivalent of Setup Java Library,
Setup TypeScript Library, and Setup Android Library for this
catalog’s other ecosystems.
Plugin
Shipped by the iru-swift plugin of the ai-catalog marketplace (install with /plugin install iru-swift@ai-catalog; see Plugins).
Inputs
| Argument | Required | Description | Default |
|---|---|---|---|
|
No |
Pre-resolved parameters passed by an orchestrating skill (e.g.
Setup Swift Repository) as newline-separated |
None — if absent or unrecognized, every field is asked interactively. |
|
Yes (unless supplied via |
The SwiftPM package identity written to |
None |
|
Yes (unless supplied via |
One or more of |
None |
|
Yes (unless supplied via |
Minimum OS version per selected Apple platform, e.g. |
None — no sensible universal default |
|
Yes (unless supplied via |
Resolved via |
None — user must choose |
|
Yes (unless supplied via |
Populates the generated doc-comment license headers (Steps 6). SwiftPM has no POM/ |
None |
|
No |
Whether the repository is open source; drives the recommended defaults offered for |
Asked directly ( |
|
No |
Whether the library is distributed for other projects to depend on via a git URL/tag; gates whether |
|
|
No |
Whether to wire up a SonarQube/SonarCloud scan ( |
|
|
No |
Which formatter config to write: |
|
|
No |
|
Unset (treated as unknown) |
|
No |
|
Unset |
|
No |
|
|
|
No |
|
|
Outputs
-
Package.swift, rewritten in full afterswift package init --type library --name <Name>. -
Sources/<Name>/<Name>.swift(a placeholderSendablestruct),Tests/<Name>Tests/<Name>Tests.swift(Swift Testing@Test), andTests/<Name>Tests/<Name>XCTests.swift(XCTest), sharing one test target. -
.swiftlint.yml(opt-in strict rules,excluded: .build) and either.swift-formator.swiftformat, depending onformatter. -
Sources/<Name>/<Name>.docc/<Name>.md, a DocC catalog page. -
.spi.yml, only whenpublish: yes. -
sonar-project.properties, only whensonaris notnone. -
A report of the resolved
package-name/<Name>, platforms and deployment targets, license, and every yes/no/gated choice; the mode announced up front (from scratch or update); per file whether it was created, updated, replaced or kept as is (with each mismatch listed for a kept file, and howvisibility/cishaped the Sonar recommendation); whetherswift build/swift testsucceeded; and explicit warnings (review before build/commit,SONAR_TOKENand a CI step still needed forsonar-project.propertiesto mean anything,.spi.ymlalone doesn’t submit to the Swift Package Index, no.gitignoretouched, SwiftLint/swiftformat/.spi.ymlsubmission unverified locally).
The generated files' bytes come from template files under templates/ (and, where a template needs variant-specific notes, reference/) in .claude/skills/iru-setup-swift-library/; the skill reads only the files for the variant it resolved, not the whole set, which keeps its SKILL.md small.
Execution flow
Dependencies
Invokes
None — iru-setup-swift-library is a leaf skill; it does not call any other skill in this catalog.
Invoked by
-
Setup Swift Repository (Step 5, library flavor) — this catalog’s Swift/Apple bootstrap orchestrator runs
iru-setup-swift-libraryafter resolving the shared bootstrap inputs, passing them throughargsso this skill’s own Step 2 questions are skipped.
Related agents
-
iru-gate-runner— Step 13 runsswift buildthenswift testthrough this agent so the caller gets a compact pass/fail summary instead of raw command output.
Source
SKILL.md on GitHub — the file this page was generated from.