Skip to content

Commit bd21dab

Browse files
committed
docs: note optional configuration traits
1 parent 1211558 commit bd21dab

14 files changed

Lines changed: 28 additions & 15 deletions

File tree

shared/agents-snippets/apple-swift-package-core.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Use this snippet in repository `AGENTS.md` files when you want baseline standard
4747
- For asynchronous event-driven tests in Swift Testing, prefer `confirmation(...)` with an explicit expected count or count range instead of ad hoc sleeps or polling loops.
4848
- Keep XCTest for integration points that still require it, for legacy package surfaces that have not migrated yet, or when a dependency or platform toolchain still expects XCTest.
4949
- Prefer first-party and top-tier Swift ecosystem packages from Apple, `swiftlang`, the Swift Server Work Group, and similarly trusted core Swift projects when they simplify the code and make it easier to reason about.
50-
- Commonly approved examples include `swift-configuration` and `swift-async-algorithms` when they reduce bespoke code and improve readability. New Swift packages should include `swift-configuration` by default with the `Configuration` product and package traits `.defaults`, `Reloading`, `YAML`, and `CommandLineArguments` unless the package has a concrete reason to remove that dependency.
50+
- Commonly approved examples include `swift-configuration` and `swift-async-algorithms` when they reduce bespoke code and improve readability. New Swift packages should include `swift-configuration` by default with the `Configuration` product and package traits `.defaults`, `Reloading`, `YAML`, and `CommandLineArguments` unless the package has a concrete reason to remove that dependency. The `PropertyList` trait is also available when property-list configuration parsing is needed, and the `Logging` trait is available when configuration access should integrate with `SwiftLog.Logger`.
5151
- For packages, server-side, or cross-platform Swift, prefer Swift Logging as the primary logging API.
5252
- Prefer Swift OpenTelemetry for telemetry and instrumentation when telemetry is needed, and prefer existing ecosystem integrations over bespoke wrappers.
5353
- Prefer a checked-in repo-root `.swiftformat` file as the default Swift formatting source of truth, and prefer a pre-commit hook that formats staged Swift sources and then verifies them with `swiftformat --lint` before commit.
@@ -60,7 +60,7 @@ Use this snippet in repository `AGENTS.md` files when you want baseline standard
6060
- Prefer `swift package` subcommands for dependency, target, and manifest-adjacent changes before hand-editing `Package.swift`.
6161
- Edit `Package.swift` intentionally and keep it readable; agents may modify it when package structure, targets, products, or dependencies need to change, and should try to keep package graph updates consolidated in one change when possible.
6262
- Keep `Package.swift` explicit about its package-wide Swift language mode. On current Swift 6-era manifests, prefer `swiftLanguageModes: [.v6]` as the default declaration, treat `swiftLanguageVersions` as a legacy alias used only when an older manifest surface requires it, and remember that lowering the manifest's `// swift-tools-version:` from the bootstrap default is often appropriate when the package should support an older Swift 6 toolchain, but never below `6.1` while trait-enabled dependencies remain in the manifest.
63-
- Keep dependency manifests aligned with the default `swift-configuration` baseline unless the package has a concrete reason to remove it: depend on `https://github.com/apple/swift-configuration` from `1.2.0`, enable the `.defaults`, `Reloading`, `YAML`, and `CommandLineArguments` package traits, and add the `Configuration` product to the primary target.
63+
- Keep dependency manifests aligned with the default `swift-configuration` baseline unless the package has a concrete reason to remove it: depend on `https://github.com/apple/swift-configuration` from `1.2.0`, enable the `.defaults`, `Reloading`, `YAML`, and `CommandLineArguments` package traits, and add the `Configuration` product to the primary target. Add the `PropertyList` trait when the package should parse property-list configuration, and add the `Logging` trait when configuration access should integrate with `SwiftLog.Logger`.
6464
- Keep dependency provenance concise but explicit enough for another contributor to fetch the same package: use package-manager, package-registry, GitHub URL, or other real remote repository requirements, and do not commit machine-local dependency paths such as `/Users/...`, `~/...`, `../...`, local worktrees, or private checkout paths. Avoid branch- or revision-based requirements unless the user explicitly asks for that level of control.
6565
- Treat `Package.resolved` and similar package-manager outputs as generated files; do not hand-edit them.
6666
- Keep package resources under the owning target directory, typically below `Sources/<TargetName>/Resources` or `Tests/<TargetName>Tests/Resources`, so target membership stays obvious.

skills/bootstrap-swift-package/assets/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
- For package configuration not covered by CLI commands, update `Package.swift` intentionally and keep edits minimal.
2424
- Edit `Package.swift` intentionally and keep it readable; agents may modify it when package structure, targets, products, or dependencies need to change, and should try to keep package graph updates consolidated in one change when possible.
2525
- Keep `Package.swift` explicit about its package-wide Swift language mode. On current Swift 6-era manifests, prefer `swiftLanguageModes: [.v6]` as the default declaration, treat `swiftLanguageVersions` as a legacy alias used only when an older manifest surface requires it, and remember that lowering the manifest's `// swift-tools-version:` from the bootstrap default is often appropriate when the package should support an older Swift 6 toolchain, but never below `6.1` while trait-enabled dependencies remain in the manifest.
26-
- Keep `swift-configuration` as the default configuration dependency for new packages unless the package has a concrete reason to remove it. The generated manifest should depend on `https://github.com/apple/swift-configuration` from `1.2.0`, enable the `.defaults`, `Reloading`, `YAML`, and `CommandLineArguments` package traits, and add the `Configuration` product to the primary target.
26+
- Keep `swift-configuration` as the default configuration dependency for new packages unless the package has a concrete reason to remove it. The generated manifest should depend on `https://github.com/apple/swift-configuration` from `1.2.0`, enable the `.defaults`, `Reloading`, `YAML`, and `CommandLineArguments` package traits, and add the `Configuration` product to the primary target. Add the `PropertyList` trait when the package should parse property-list configuration, and add the `Logging` trait when configuration access should integrate with `SwiftLog.Logger`.
2727
- Keep dependency provenance concise but explicit enough for another contributor to fetch the same package: use package-manager, package-registry, GitHub URL, or other real remote repository requirements, and do not commit machine-local dependency paths such as `/Users/...`, `~/...`, `../...`, local worktrees, or private checkout paths. Avoid branch- or revision-based requirements unless the user explicitly asks for that level of control.
2828
- Treat `Package.resolved` and similar package-manager outputs as generated files; do not hand-edit them.
2929
- Validate package changes with:

skills/bootstrap-swift-package/references/automation-prompts.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ Verification:
9191
- Confirm `Package.swift` keeps the explicit Swift 6 language-mode declaration `swiftLanguageModes: [.v6]`.
9292
- Confirm `Package.swift` keeps `// swift-tools-version:` at `6.1` or newer while the trait-enabled `swift-configuration` dependency remains in the manifest, even if it is lowered from the scaffold default.
9393
- Confirm `Package.swift` includes `swift-configuration` from `1.2.0`, enables `.defaults`, `Reloading`, `YAML`, and `CommandLineArguments`, and adds the `Configuration` product to the primary target.
94+
- Confirm the generated guidance notes that `PropertyList` is available for property-list configuration parsing and `Logging` is available for `SwiftLog.Logger` integration.
9495
- If validation is enabled, verify `swift build` and `swift test` success.
9596
- If branch protection is configured, require the GitHub Actions check context `validate`, not `Validate Repo Maintenance / validate`.
9697

skills/bootstrap-swift-package/references/package-types.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ The generated manifest should include `swift-configuration` by default:
3838
- dependency traits: `.defaults`, `Reloading`, `YAML`, and `CommandLineArguments`
3939
- primary target product: `.product(name: "Configuration", package: "swift-configuration")`
4040

41+
The `PropertyList` trait is also available when a package should parse property-list configuration, and the `Logging` trait is available when configuration access should integrate with `SwiftLog.Logger`.
42+
4143
## Testing Modes
4244

4345
- Supported and validated Swift toolchain floor: `6.1+`.

skills/bootstrap-swift-package/references/snippets/apple-swift-package-core.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Use this snippet in repository `AGENTS.md` files when you want baseline standard
4747
- For asynchronous event-driven tests in Swift Testing, prefer `confirmation(...)` with an explicit expected count or count range instead of ad hoc sleeps or polling loops.
4848
- Keep XCTest for integration points that still require it, for legacy package surfaces that have not migrated yet, or when a dependency or platform toolchain still expects XCTest.
4949
- Prefer first-party and top-tier Swift ecosystem packages from Apple, `swiftlang`, the Swift Server Work Group, and similarly trusted core Swift projects when they simplify the code and make it easier to reason about.
50-
- Commonly approved examples include `swift-configuration` and `swift-async-algorithms` when they reduce bespoke code and improve readability. New Swift packages should include `swift-configuration` by default with the `Configuration` product and package traits `.defaults`, `Reloading`, `YAML`, and `CommandLineArguments` unless the package has a concrete reason to remove that dependency.
50+
- Commonly approved examples include `swift-configuration` and `swift-async-algorithms` when they reduce bespoke code and improve readability. New Swift packages should include `swift-configuration` by default with the `Configuration` product and package traits `.defaults`, `Reloading`, `YAML`, and `CommandLineArguments` unless the package has a concrete reason to remove that dependency. The `PropertyList` trait is also available when property-list configuration parsing is needed, and the `Logging` trait is available when configuration access should integrate with `SwiftLog.Logger`.
5151
- For packages, server-side, or cross-platform Swift, prefer Swift Logging as the primary logging API.
5252
- Prefer Swift OpenTelemetry for telemetry and instrumentation when telemetry is needed, and prefer existing ecosystem integrations over bespoke wrappers.
5353
- Prefer a checked-in repo-root `.swiftformat` file as the default Swift formatting source of truth, and prefer a pre-commit hook that formats staged Swift sources and then verifies them with `swiftformat --lint` before commit.
@@ -60,7 +60,7 @@ Use this snippet in repository `AGENTS.md` files when you want baseline standard
6060
- Prefer `swift package` subcommands for dependency, target, and manifest-adjacent changes before hand-editing `Package.swift`.
6161
- Edit `Package.swift` intentionally and keep it readable; agents may modify it when package structure, targets, products, or dependencies need to change, and should try to keep package graph updates consolidated in one change when possible.
6262
- Keep `Package.swift` explicit about its package-wide Swift language mode. On current Swift 6-era manifests, prefer `swiftLanguageModes: [.v6]` as the default declaration, treat `swiftLanguageVersions` as a legacy alias used only when an older manifest surface requires it, and remember that lowering the manifest's `// swift-tools-version:` from the bootstrap default is often appropriate when the package should support an older Swift 6 toolchain, but never below `6.1` while trait-enabled dependencies remain in the manifest.
63-
- Keep dependency manifests aligned with the default `swift-configuration` baseline unless the package has a concrete reason to remove it: depend on `https://github.com/apple/swift-configuration` from `1.2.0`, enable the `.defaults`, `Reloading`, `YAML`, and `CommandLineArguments` package traits, and add the `Configuration` product to the primary target.
63+
- Keep dependency manifests aligned with the default `swift-configuration` baseline unless the package has a concrete reason to remove it: depend on `https://github.com/apple/swift-configuration` from `1.2.0`, enable the `.defaults`, `Reloading`, `YAML`, and `CommandLineArguments` package traits, and add the `Configuration` product to the primary target. Add the `PropertyList` trait when the package should parse property-list configuration, and add the `Logging` trait when configuration access should integrate with `SwiftLog.Logger`.
6464
- Keep dependency provenance concise but explicit enough for another contributor to fetch the same package: use package-manager, package-registry, GitHub URL, or other real remote repository requirements, and do not commit machine-local dependency paths such as `/Users/...`, `~/...`, `../...`, local worktrees, or private checkout paths. Avoid branch- or revision-based requirements unless the user explicitly asks for that level of control.
6565
- Treat `Package.resolved` and similar package-manager outputs as generated files; do not hand-edit them.
6666
- Keep package resources under the owning target directory, typically below `Sources/<TargetName>/Resources` or `Tests/<TargetName>Tests/Resources`, so target membership stays obvious.

skills/swift-package-build-run-workflow/references/snippets/apple-swift-package-core.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Use this snippet in repository `AGENTS.md` files when you want baseline standard
4747
- For asynchronous event-driven tests in Swift Testing, prefer `confirmation(...)` with an explicit expected count or count range instead of ad hoc sleeps or polling loops.
4848
- Keep XCTest for integration points that still require it, for legacy package surfaces that have not migrated yet, or when a dependency or platform toolchain still expects XCTest.
4949
- Prefer first-party and top-tier Swift ecosystem packages from Apple, `swiftlang`, the Swift Server Work Group, and similarly trusted core Swift projects when they simplify the code and make it easier to reason about.
50-
- Commonly approved examples include `swift-configuration` and `swift-async-algorithms` when they reduce bespoke code and improve readability. New Swift packages should include `swift-configuration` by default with the `Configuration` product and package traits `.defaults`, `Reloading`, `YAML`, and `CommandLineArguments` unless the package has a concrete reason to remove that dependency.
50+
- Commonly approved examples include `swift-configuration` and `swift-async-algorithms` when they reduce bespoke code and improve readability. New Swift packages should include `swift-configuration` by default with the `Configuration` product and package traits `.defaults`, `Reloading`, `YAML`, and `CommandLineArguments` unless the package has a concrete reason to remove that dependency. The `PropertyList` trait is also available when property-list configuration parsing is needed, and the `Logging` trait is available when configuration access should integrate with `SwiftLog.Logger`.
5151
- For packages, server-side, or cross-platform Swift, prefer Swift Logging as the primary logging API.
5252
- Prefer Swift OpenTelemetry for telemetry and instrumentation when telemetry is needed, and prefer existing ecosystem integrations over bespoke wrappers.
5353
- Prefer a checked-in repo-root `.swiftformat` file as the default Swift formatting source of truth, and prefer a pre-commit hook that formats staged Swift sources and then verifies them with `swiftformat --lint` before commit.
@@ -60,7 +60,7 @@ Use this snippet in repository `AGENTS.md` files when you want baseline standard
6060
- Prefer `swift package` subcommands for dependency, target, and manifest-adjacent changes before hand-editing `Package.swift`.
6161
- Edit `Package.swift` intentionally and keep it readable; agents may modify it when package structure, targets, products, or dependencies need to change, and should try to keep package graph updates consolidated in one change when possible.
6262
- Keep `Package.swift` explicit about its package-wide Swift language mode. On current Swift 6-era manifests, prefer `swiftLanguageModes: [.v6]` as the default declaration, treat `swiftLanguageVersions` as a legacy alias used only when an older manifest surface requires it, and remember that lowering the manifest's `// swift-tools-version:` from the bootstrap default is often appropriate when the package should support an older Swift 6 toolchain, but never below `6.1` while trait-enabled dependencies remain in the manifest.
63-
- Keep dependency manifests aligned with the default `swift-configuration` baseline unless the package has a concrete reason to remove it: depend on `https://github.com/apple/swift-configuration` from `1.2.0`, enable the `.defaults`, `Reloading`, `YAML`, and `CommandLineArguments` package traits, and add the `Configuration` product to the primary target.
63+
- Keep dependency manifests aligned with the default `swift-configuration` baseline unless the package has a concrete reason to remove it: depend on `https://github.com/apple/swift-configuration` from `1.2.0`, enable the `.defaults`, `Reloading`, `YAML`, and `CommandLineArguments` package traits, and add the `Configuration` product to the primary target. Add the `PropertyList` trait when the package should parse property-list configuration, and add the `Logging` trait when configuration access should integrate with `SwiftLog.Logger`.
6464
- Keep dependency provenance concise but explicit enough for another contributor to fetch the same package: use package-manager, package-registry, GitHub URL, or other real remote repository requirements, and do not commit machine-local dependency paths such as `/Users/...`, `~/...`, `../...`, local worktrees, or private checkout paths. Avoid branch- or revision-based requirements unless the user explicitly asks for that level of control.
6565
- Treat `Package.resolved` and similar package-manager outputs as generated files; do not hand-edit them.
6666
- Keep package resources under the owning target directory, typically below `Sources/<TargetName>/Resources` or `Tests/<TargetName>Tests/Resources`, so target membership stays obvious.

0 commit comments

Comments
 (0)