lang-swift
Skill0 starsChanged 7 days agoMITView on GitHub
Use when writing, reviewing, testing or setting up Swift backend code in a loops run (the swift language pack) - toolchain, layout, race policy, coverage, idioms and footguns.
- Reads credentials
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- alexderz/agentic-toolboxtheir own version, first seen Oct 17, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- alexderz/agentic-toolbox★ 5same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository35 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- skills/work/platforms/claude.mdCLAUDE.md
- llms.txtllms.txt
- clarifySkill
- consistencySkill
- debuggingSkill
- documentationSkill
- featureSkill
- hexagonalSkill
- initSkill
- jobs-and-state-machinesSkill
- lang-clojureSkill
- lang-cppSkill
- lang-csharpSkill
- lang-elixirSkill
- lang-erlangSkill
- lang-goSkill
- lang-javaSkill
- lang-kotlinSkill
- lang-phpSkill
- lang-pythonSkill
- lang-rubySkill
- lang-rustSkill
- lang-scalaSkill
- lang-typescriptSkill
- memorySkill
- parallel-workSkill
- performanceSkill
- qualitySkill
- reportSkill
- review-integrationSkill
- statusSkill
- testingSkill
- workSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Follow the project's own config over the pack defaults: an existing .swift-format, .swiftlint.yml, .editorconfig, framework layout (Vapor …
- Very specific: line 34
Every target compiles in Swift 6 language mode: a 6.x swift-tools-version, never .swiftLanguageMode(.v5) without a logged override …
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Swift (server-side) language pack
Rules: specs/languages/swift/RULES.md (IDs SWIFT-<SEC>-NN). Pack data: loops lang show swift. Universal practice: specs/ARCHITECTURE.md, specs/SOLID.md, specs/WORKFLOW.md.
When it applies
loops lang detect reports swift (a Package.swift at the root). Targets: SwiftPM only, Swift 6.4.x, SwiftNIO runtime, Hummingbird 2 or Vapor 4. No .xcodeproj for a server.
Project rules first
Follow the project's own config over the pack defaults: an existing .swift-format, .swiftlint.yml, .editorconfig, framework layout (Vapor Sources/App, Hummingbird buildApplication), tools version, target names. Log every override with loops run override (ROLES.md "Project rules first"). loops lang show swift lists config_files to read first.
The toolchain the gate runs
Agents run loops gate, or single checks while iterating (loops gate --only <check>,…). The checks, from pack.json:
| Check | Command | Notes |
build (required) | swift build --force-resolved-versions --explicit-target-dependency-import-check error | a stale Package.resolved or an undeclared import fails |
swift-format (required once .swift-format exists) | swift format lint --strict --recursive Sources Tests | --strict makes warnings fail; fix with swift format format --in-place --recursive … |
swiftlint (optional, needs .swiftlint.yml) | swiftlint lint --strict | install: brew install swiftlint; Linux via its Docker image |
arch | loops arch | regex parser, module = target name (SWIFT-ARCH-06/07) |
test (required) | swift test --sanitize=thread --enable-code-coverage | see race policy |
coverage (required) | lcov from llvm-cov export | see coverage recipe |
sbom (optional, off) | swift package generate-sbom | emits SPDX/CycloneDX only; there is no first-party vuln check (SWIFT-TOOL-05) |
Single test while iterating: swift test --filter 'DomainTests.OrderTests/testPlace', --skip-build after a build, swift test list to list (SWIFT-TEST-10). There is no -race; do not invent one.
Caches: SwiftPM has no cache env vars. The gate and the env hook add --scratch-path <run>/swift/build after the subcommand; the shared --cache-path, --config-path, --security-path stay global (SWIFT-OPS-05). Never hardcode .build/<triple>/debug: ask swift build --show-bin-path (SWIFT-TOOL-07).
Race policy (WORKFLOW §6, mode flag)
- Every target compiles in Swift 6 language mode: a 6.x
swift-tools-version, never.swiftLanguageMode(.v5)without a logged override (SWIFT-CONC-02, -04). - Tests run with
swift test --sanitize=thread(the pack'srace.flags). The test guard denies aswift testwithout it. - Shared mutable state is an
actor, aMutexor an immutableSendablevalue.@unchecked Sendableandnonisolated(unsafe)need a lock and a comment. - TSan cannot combine with
--sanitize=address; run ASan/UBSan as a separate optional job. If TSan cannot run on the host, the gate fails with "race policy unavailable"; it never skips.
Coverage recipe
swift test --enable-code-coverage writes default.profdata beside the path printed by --show-codecov-path. The pack then runs llvm-cov export -format=lcov (via xcrun on macOS) with one -object per test binary: macOS <T>.xctest/Contents/MacOS/<T>, Linux <T>.so under .build/out/Products/Debug-linux-<arch> (the <T>-test-runner binary holds only generated entry-point code, no package sources). Extra positionals are source filters and drop targets silently, so never pass objects without -object. Tests/, .build/, checkouts and DerivedSources are filtered out. New-code coverage must be at least 70% (WORKFLOW §6). Details: testing.md.
Prerequisites the architect or swift-engineer adds in wave 0 (D13, logged overrides)
.swift-formatcommitted, e.g.{"version": 1, "indentation": {"spaces": 4}}to matchswift package init(the stock template failslint --strictagainst the default 2 spaces), or runswift format format -i -r Sources Testsonce. Its presence makes the format check required.Package.resolvedcommitted for services;.swift-versionpinning the toolchain, mirrored in the Docker base image and CI.- A
.gitignorewith/.build,.swiftpm/xcode/,.netrc,*.profraw. - Layer targets in
Package.swiftwithdependencies:pointing inward.
How the loops layers map
Package.swift tools-version 6.x; targets are the boundaries
Sources/
Domain/ target, dependencies: [] (pure: no NIO, Vapor, Foundation networking)
Application/ dependencies: ["Domain"] use cases + ports (protocols)
<X>Adapter/ inbound (HTTPAdapter) / outbound (PostgresAdapter); depend on Application
App/ executableTarget: @main, config, wiring
Tests/<Target>Tests/ mirror the targets; Swift TestingDirection is enforced twice: SwiftPM dependencies: plus --explicit-target-dependency-import-check error, and loops arch for purity (Date(), UUID(), Task { in Domain).
Top 10 footguns
try!,!or an out-of-range index traps and kills the process:guard let,.first,try.- Blocking the cooperative pool (
DispatchSemaphore, sync I/O inasync): async clients,Task.sleep(for:). @unchecked Sendableornonisolated(unsafe)as a silencer:actororMutex.- Dropping a target to
.v5to get green: migrate withswift package migrate, log it. Task {}orTask.detachedfor request work: structured concurrency.- Retain cycles in escaping closures:
[weak self]. - Shipping a debug build:
-c release. branch:dependencies or an uncommittedPackage.resolved:from:, commit,--force-resolved-versions.- A shared
DateFormatter, non-UTC dates,Doublemoney:FormatStyle,Decimal. import Vapor/Fluent/NIO in Domain: targetdependencies: [], Fluent models in the adapter.
Load on demand
repo.md: layout, manifest, lockfile, toolchain pin, CI, releases.architecture.md: targets as layers, access levels, ports, DI, purity.idioms.md: errors, optionals, value types, enums, resources, time, API design.concurrency.md: Swift 6 mode, actors, Sendable, TSan, cancellation, lifecycle.testing.md: Swift Testing, fakes, coverage export, flakiness, TDD loop.security.md: injection, deserialization, crypto, supply chain, SAST.data-api.md: persistence, HTTP and messaging, observability, deployment.frameworks.md: Hummingbird, Vapor, SSWG packages and their footguns.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

