Logo: Sota Swift

Sota Swift

Communautéit
martinholovsky
sota-swift

State-of-the-art Swift engineering rules (Swift 6 language mode) that Claude applies when writing or auditing Swift on ANY target — server-side services (Vapor, Hummingbird, SwiftNIO), CLIs, libraries, packages and apps. Covers optionals and error handling, value types and API design, Swift 6 data-race safety (Sendable, actors, isolation, cancellation), ARC and retain cycles, unsafe pointers and strict memory safety, security (CryptoKit/swift-crypto, Codable and NSKeyedUnarchiver, SQLKit raw SQL, Process, path traversal, NIOSSL/AsyncHTTPClient TLS), server hardening (auth middleware, cookie defaults, release builds), performance, and SwiftPM supply chain (Package.resolved, plugins and macros, SBOM). Trigger keywords - Swift, SwiftPM, Package.swift, Package.resolved, Vapor, Hummingbird, SwiftNIO, async/await, actor, Sendable, @MainActor, Task, Codable, ARC, weak self, Unsafe pointer, Swift Testing, XCTest, SwiftLint, swift-format, server-side Swift. Use for BOTH building and auditing Swift code.

Iwwersiicht

Editeurmartinholovsky
RepositorySOTA-skills
Skill-Nummsota-swift
Stären
28
Forks
3
Matgeliwwert Dateien
9
LizenzCC-BY-4.0
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 9 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    martinholovsky huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Sota Swift an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/martinholovsky/SOTA-skills/tree/main/skills/sota-swift
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/martinholovsky/SOTA-skills.git /tmp/SOTA-skills
mkdir -p .claude/skills
cp -r /tmp/SOTA-skills/skills/sota-swift .claude/skills/sota-swift
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Sota Swift an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Sota Swift automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Sota Swift net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

SOTA Swift (2026)

Purpose

Expert-level rules for producing and auditing production Swift, on any target. Swift is a language first and an Apple-platform toolkit second: a Vapor service on Linux, a CLI and an iOS app share every rule here. Platform concerns route elsewhere: app lifecycle, store review, Keychain, push and offline sync → sota-mobile; containers → sota-sandboxing; a command-line tool's flags, output and exit codes → sota-cli-ux; telemetry → sota-observability.

Version floor. swift.org publishes no end-of-life or support-window policy for older Swift releases (searched the swift.org site source, 2026-10-07); the nearest written bar is the Swift Server Workgroup's graduation criteria — "Support new GA versions of Swift within 30d" and a "documented support strategy for at least one previous major version". So pin the toolchain you build with, verify the latest release at swift.org, and treat the language mode as the load-bearing line: Swift 6 mode makes data-race safety a compile error. Feature notes below name the release that introduced each feature.

BUILD mode

  1. Declare the toolchain and language mode in Package.swift (swift-tools-version: 6.x, swiftLanguageModes: — swiftLanguageVersions is deprecated since 6.1, SE-0441) and pin the toolchain for CI (rules/08).
  2. Read the rules files that match the work (index below). Concurrency (rules/03) applies to any code with async, actors or shared state; security (rules/05) to anything touching input, files, processes, SQL or the network; server code also reads rules/06.
  3. Write value types, exhaustive enums and non-optional straight-line code (rules/01); keep the public surface small and evolvable (rules/02).
  4. Self-audit last: walk each loaded file's Audit checklist against the diff, then the router's principle 5 (abuse control, transport, tests, logs) before presenting.

AUDIT mode

Coverage: every rules/ file's Audit checklist applies in AUDIT mode. Mark one not applicable only with its reason in the report — never skip a file because the thing it checks for is absent, since that absence may be the finding.

  1. Recon: Package.swift (tools version, language modes, unsafeFlags, plugins, macros, binary targets), Package.resolved, CI config, the server framework in use.
  2. Run what is installed (never install unasked; ask the operator for what is missing, router principle 6): the compiler in Swift 6 mode with -warnings-as-errors, SwiftLint, swift build --sbom-spec (6.4+), a dependency scanner (rules/09), CodeQL's Swift queries where CI has them.
  3. Walk every applicable rules file's Audit checklist; each probe below is a grep you can run.
  4. Report in the canonical format; severity per the table, chain closure per the sota router.

Severity conventions (refines the router's rules/03 §1 inside this skill)

SeveritySwift examples
CriticalSQL built with \(unsafeRaw:) from request input; certificateVerification: .none on a production client; /bin/sh -c with interpolated input; NSKeyedUnarchiver.unarchiveObject(with:) on untrusted bytes
Highdata race behind nonisolated(unsafe) / @unchecked Sendable on reachable state; unauthenticated route group missing its guard middleware; session cookies left at Vapor's isSecure: false default; debug build shipped (raw error text to clients); plugin/macro dependency unreviewed on a Linux CI that runs them unsandboxed
Mediumtry!/!/as! on input-derived values; Double for money; unbounded AsyncStream buffer; Task.detached without reason; ReDoS-prone regex on input
Lowtry? on a write path; any P on a hot path; missing final; IUO outside two-phase init

Finding format

file:line | rule | severity | effort | fix — the router's canonical row; expand each surviving finding to the router's rules/03 §2 evidence block.

Rules index

FileRead this when…
rules/01-idioms-and-errors.mdWriting any Swift: value types vs classes, enums, optionals and force-unwraps, throws/typed throws/try?, integer overflow and money, dates and clocks
rules/02-api-design.mdDesigning a module or package API: protocols vs generics (some/any), access control (public/package), library evolution and @frozen, deprecation, SemVer
rules/03-concurrency.mdAny async, actor, Task, Sendable or shared mutable state: Swift 6 mode, isolation escape hatches, reentrancy, structured concurrency, cancellation and timeouts, streams and backpressure
rules/04-memory-and-unsafe.mdRetain cycles, weak/unowned, resource ownership (defer, ~Copyable), unsafe pointers, C interop, strict memory safety
rules/05-security.mdInput, files, processes, SQL, HTTP, crypto, decoding, regex, logs, secrets — the language-level security surface
rules/06-server-side.mdVapor/Hummingbird/SwiftNIO services: auth middleware order, cookie and session defaults, release vs debug, body limits, error responses, Linux Foundation
rules/07-performance.mdProfiling first, allocations, ARC traffic, existentials, copy-on-write, benchmarks in CI
rules/08-tooling-ci-testing.mdToolchain pinning, warnings-as-errors, SwiftLint/swift-format and every suppression, Swift Testing/XCTest, sanitizers, flaky tests
rules/09-supply-chain.mdPackage.resolved, version requirements, registries and package identity, plugins and macros (build-time code), binary targets, SBOM, vulnerability scanning, adopting a package

Top 10 non-negotiables

  1. Swift 6 language mode for all first-party code; every nonisolated(unsafe), @unchecked Sendable, @preconcurrency and unowned(unsafe) carries a comment naming the invariant that makes it safe.
  2. No !, try! or as! on values derived from input; guard let/throw instead.
  3. Untyped throws on public APIs; typed throws only inside a closed boundary.
  4. Structured concurrency first; every unstructured Task has an owner that cancels it; long loops check cancellation.
  5. No retain cycles: escaping closures stored by self capture [weak self].
  6. SQL binds, never interpolates: no \(unsafeRaw:)/unsafeSQL: with input; processes take an argument array, never /bin/sh -c.
  7. TLS verification stays on; minimum TLS 1.2 set explicitly on NIOSSL clients.
  8. Ship release builds (swift build -c release); production behaviour never depends on a debug build's #if DEBUG or Vapor's compile-time isRelease.
  9. Commit Package.resolved and resolve with --force-resolved-versions in CI; review plugins and macros as build-time code — on Linux they run unsandboxed.
  10. Warnings are errors in CI, and every SwiftLint/compiler suppression is visible and justified.

Operating notes

  • Swift moves fast; Swift Evolution proposal status (swift.org/swift-evolution) is the primary source for whether a feature has shipped. "Accepted" is not "implemented".
  • Facts here carry their verification date; re-check before pinning a version or quoting a default.

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Sota Swift?

State-of-the-art Swift engineering rules (Swift 6 language mode) that Claude applies when writing or auditing Swift on ANY target — server-side services (Vapor, Hummingbird, SwiftNIO), CLIs, libraries, packages and apps. Covers optionals and error handling, value types and API design, Swift 6 data-race safety (Sendable, actors, isolation, cancellation), ARC and retain cycles, unsafe pointers and strict memory safety, security (CryptoKit/swift-crypto, Codable and NSKeyedUnarchiver, SQLKit raw SQL, Process, path traversal, NIOSSL/AsyncHTTPClient TLS), server hardening (auth middleware, cookie...

Firwat Sota Swift op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Sota Swift besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Sota Swift an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/martinholovsky/SOTA-skills/tree/main/skills/sota-swift an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Sota Swift benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Sota Swift benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Sota Swift domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Sota Swift gratis?

Jo. martinholovsky huet de Skill ënner der Lizenz CC-BY-4.0 op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇